Skip to content

Instantly share code, notes, and snippets.

View naranyala's full-sized avatar
🎯
F11 - back to the context

FMH (@gema_naranyala) naranyala

🎯
F11 - back to the context
View GitHub Profile
@naranyala
naranyala / tmux.conf
Last active August 8, 2023 03:14
focus-mode-tmux-config, the only one tmux config you need
# focus-mode tmux-config (github.com/naranyala)
## remote work first, desktop and mobile (termux)
## seamless neovim integration
## best possible keymap productivity
set -gq status-utf8 on
set -g escape-time 0
set -g default-terminal "screen-256color"
set -ga terminal-overrides "xterm-256color"
#!/bin/bash
# Obsidian Sync
# works on desktop and mobile (termux)
# simply run `sh bin/sync_obsidian.sh`
echo "-- start obsidian sync ..."
git add .
git commit -m "Obsidian sync at $(date)"
#!/bin/bash
#############################################
# KITTY THEMES SETUP (github.com/naranyala) #
#############################################
dir="~/.config/kitty/kitty-themes"
width=$(tput cols)
separator=$(printf '%*s' "$width" | tr ' ' '-')
#!/bin/bash
# ENHANCED CHEATSHEETS (github.com/naranyala)
####################################
# combining: curl, cht.sh, and bat #
####################################
# Check if the query is provided as the first command-line argument
if [[ -n "$1" ]]; then
#!/bin/bash
# ENHANCED MAN (github.com/naranyala)
##########################
# combining: man and bat #
##########################
# Check if the command is provided as the first command-line argument
if [[ -n "$1" ]]; then
#!/bin/bash
# Function to display the folder structure with colorized sizes using tree command, awk, and sed
display_folder_structure() {
local dir_path="$1"
tree -ah --du "$dir_path" | awk '
$2 ~ /K/ || $2 ~ /M/ || $2 ~ /G/ || $2 ~ /T/ || $2 ~ /P/ || $2 ~ /E/ || $2 ~ /Z/ || $2 ~ /Y/ || $2 ~ /B/ {
print $0
}
' | sed -E 's/(.*[[:digit:]]+)K/\o033[34m\1K\o033[0m/g; s/(.*[[:digit:]]+)M/\o033[32m\1M\o033[0m/g; s/(.*[[:digit:]]+)G/\o033[31m\1G\o033[0m/g; s/(.*[[:digit:]]+)T/\o033[35m\1T\o033[0m/g; s/(.*[[:digit:]]+)P/\o033[36m\1P\o033[0m/g; s/(.*[[:digit:]]+)E/\o033[33m\1E\o033[0m/g; s/(.*[[:digit:]]+)Z/\o033[35m\1Z\o033[0m/g; s/(.*[[:digit:]]+)Y/\o033[36m\1Y\o033[0m/g; s/(.*[[:digit:]]+)B/\o033[34m\1B\o033[0m/g'
#!/bin/bash
# Function to kill a process
kill_process() {
echo "Killing process with PID: $1"
kill "$1"
}
# Prompt the user for the process name if not provided as an argument
if [ $# -eq 0 ]; then
#!/bin/bash
# Check if the compressed file argument is provided
if [ -z "$1" ]; then
echo "Please provide the path to the compressed file as the first argument."
exit 1
fi
# Verify if the compressed file exists
compressed_file="$1"
#!/bin/bash
# Verify if the directory argument is provided
if [ -z "$1" ]; then
echo "Please provide the path to the directory you want to compress as the first argument."
exit 1
fi
# Verify if the directory exists
directory="$1"
#!/bin/bash
# Verify if the directory argument is provided
if [ -z "$1" ]; then
echo "Please provide the path to the directory you want to compress as the first argument."
exit 1
fi
# Verify if the directory exists
directory="$1"