diff options
41 files changed, 173 insertions, 78 deletions
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/snippets.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/snippets.lua index 96c52a7..aff6f62 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/snippets.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/snippets.lua @@ -33,25 +33,25 @@ return { vim.cmd.runtime({ args = { "lua/TheSiahxyz/snippets/*.lua" }, bang = true }) -- load custom snippets - vim.keymap.set({ "i", "x" }, "<A-L>", function() + vim.keymap.set({ "i", "x" }, "<C-L>", function() if ls.expand_or_jumpable() then ls.expand_or_jump() end end, { silent = true, desc = "Expand snippet or jump to the next snippet node" }) - vim.keymap.set({ "i", "x" }, "<A-H>", function() + vim.keymap.set({ "i", "x" }, "<C-H>", function() if ls.jumpable(-1) then ls.jump(-1) end end, { silent = true, desc = "Previous spot in the snippet" }) - vim.keymap.set({ "i", "x" }, "<A-l>", function() + vim.keymap.set({ "i", "s" }, "<C-j>", function() if ls.choice_active() then ls.change_choice(1) end end, { silent = true, desc = "Next snippet choice" }) - vim.keymap.set({ "i", "x" }, "<A-h>", function() + vim.keymap.set({ "i", "s" }, "<C-k>", function() if ls.choice_active() then ls.change_choice(-1) end diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua index 90528a1..4f233d1 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua @@ -3,15 +3,47 @@ local ls = require("luasnip") local s = ls.snippet local i = ls.insert_node local f = ls.function_node +local c = ls.choice_node +local t = ls.text_node +local d = ls.dynamic_node +local sn = ls.snippet_node local fmt = require("luasnip.extras.fmt").fmta +local function bgm_node_generator() + return function() + local handle = io.popen("ssh root@thesiah.xyz 'ls /var/www/thesiah/bgm/' 2>/dev/null") + if not handle then + return sn(nil, { i(1, "bgm") }) + end + + local result = handle:read("*a") + handle:close() + + if not result or result == "" then + return sn(nil, { i(1, "bgm") }) + end + + local choices = {} + for filename in result:gmatch("[^\r\n]+") do + table.insert(choices, t(filename)) + end + + if #choices == 0 then + return sn(nil, { i(1, "bgm") }) + end + + return sn(nil, { c(1, choices) }) + end +end + local diary_snippet = s( "diary", fmt( [[--- title: <title> date: <date> +bgm: <bgm> --- <story> @@ -21,6 +53,7 @@ date: <date> date = f(function() return os.date("%Y-%m-%d") end, {}), + bgm = d(2, bgm_node_generator(), {}), story = i(3), } ) diff --git a/ar/.config/lf/lfrc b/ar/.config/lf/lfrc index 64416d3..becd52c 100644 --- a/ar/.config/lf/lfrc +++ b/ar/.config/lf/lfrc @@ -101,16 +101,24 @@ cmd yank-basename $basename -a -- $fx | head -c-1 | xclip -i -selection clipboar cmd yank-basename-without-extension &basename -a -- $fx | cut -d. -f1 | head -c-1 | xclip -i -selection clipboard # Create -cmd mkdir ${{ clear; tput cup $(($(tput lines)/3)); tput bold - printf "Directory Name: " - read ans - mkdir -p $ans -}} -cmd mkfile ${{ - clear; tput cup $(($(tput lines)/3)); tput bold - printf "File Name: " - read ans - $EDITOR $ans +cmd mkdir %{{ + IFS=" " + file="$*" + mkdir -p -- "$file" + lf -remote "send $id cd \"$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')\"" +}} +cmd touch %{{ + IFS=" " + file="$*" + case "$file" in + /*) ;; + *) file="$PWD/$file" ;; + esac + dir="${file%/*}" + [ "$dir" != "$file" ] && mkdir -p -- "$dir" + touch -- "$file" + file="$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')" + lf -remote "send $id :select \"$file\"; \$\$EDITOR \"$file\"" }} cmd link %{{ set -- $(cat ~/.local/share/lf/files) @@ -500,8 +508,8 @@ map yt $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/ map yy copy # Create -map Md mkdir -map Mf mkfile +map Md push :mkdir<space> +map Mf push :touch<space> map Ml link # Cut diff --git a/ar/.config/sesh/sesh.toml b/ar/.config/sesh/sesh.toml index 349c5ba..77f1b9f 100644 --- a/ar/.config/sesh/sesh.toml +++ b/ar/.config/sesh/sesh.toml @@ -30,7 +30,7 @@ name = "config" path = "~/.config" [[session]] -name = "dotfiles" +name = "_dotfiles" path = "~/.dotfiles" [[session]] diff --git a/ar/.config/shell/aliasrc b/ar/.config/shell/aliasrc index 1e129f6..1cf6045 100644 --- a/ar/.config/shell/aliasrc +++ b/ar/.config/shell/aliasrc @@ -12,7 +12,7 @@ [ -f "$MBSYNCRC" ] && alias mbsync='mbsync -c $MBSYNCRC' # sudo not required for some system commands -for command in blkid lsblk mount umount pacman poweroff reboot shutdown su sv updatedb; do +for command in arp-scan blkid docker ecrypt lazydocker lsblk mount umount pacman poweroff reboot shutdown su sv updatedb; do alias $command="sudo $command" done unset command diff --git a/ar/.local/bin/cron/checkup b/ar/.local/bin/cron/checkup index 801d406..2ea6772 100755 --- a/ar/.local/bin/cron/checkup +++ b/ar/.local/bin/cron/checkup @@ -7,7 +7,7 @@ notify-send "š¦ Repository Sync" "Checking for package updates..." sudo pacman -Syyuw --noconfirm || notify-send "ā Error downloading updates. Check your internet connection, if pacman is already running, or run update manually to see errors." -pkill -RTMIN+16 "${STATUSBAR:-dwmblocks}" +pkill -RTMIN+14 "${STATUSBAR:-dwmblocks}" if pacman -Qu | grep -v "\[ignored\]"; then notify-send "š Repository Sync" "Updates available. Click statusbar icon (š¦) or run sb-popupgrade in terminal for update." diff --git a/ar/.local/bin/cron/crontog b/ar/.local/bin/cron/crontog index 70e7cf1..ccabe61 100755 --- a/ar/.local/bin/cron/crontog +++ b/ar/.local/bin/cron/crontog @@ -23,4 +23,4 @@ else fi # Notify status bar to update -pkill -RTMIN+3 "${STATUSBAR:-dwmblocks}" +pkill -RTMIN+2 "${STATUSBAR:-dwmblocks}" diff --git a/ar/.local/bin/cron/newsup b/ar/.local/bin/cron/newsup index 346ec75..f8b40b7 100755 --- a/ar/.local/bin/cron/newsup +++ b/ar/.local/bin/cron/newsup @@ -8,8 +8,8 @@ pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name "^newsboat$")" R && exit echo š >/tmp/newsupdate -pkill -RTMIN+19 "${STATUSBAR:-dwmblocks}" +pkill -RTMIN+17 "${STATUSBAR:-dwmblocks}" /usr/bin/newsboat -x reload rm -f /tmp/newsupdate -pkill -RTMIN+19 "${STATUSBAR:-dwmblocks}" +pkill -RTMIN+17 "${STATUSBAR:-dwmblocks}" /usr/bin/notify-send "š° RSS feed update complete." diff --git a/ar/.local/bin/dmenurecord b/ar/.local/bin/dmenurecord index 621133d..a497aa4 100755 --- a/ar/.local/bin/dmenurecord +++ b/ar/.local/bin/dmenurecord @@ -17,7 +17,7 @@ getdim() { xrandr | grep -oP '(?<=current ).*(?=,)' | tr -d ' '; } updateicon() { echo "$1" >/tmp/recordingicon - pkill -RTMIN+24 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+22 "${STATUSBAR:-dwmblocks}" } killrecording() { @@ -25,7 +25,7 @@ killrecording() { kill -15 "$recpid" rm -f /tmp/recordingpid updateicon "" - pkill -RTMIN+24 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+22 "${STATUSBAR:-dwmblocks}" } getmonitor() { diff --git a/ar/.local/bin/dmenuupgrade b/ar/.local/bin/dmenuupgrade index b43ff4c..b23e80a 100755 --- a/ar/.local/bin/dmenuupgrade +++ b/ar/.local/bin/dmenuupgrade @@ -16,7 +16,7 @@ case "$selection" in if [ "$(printf "No\nYes" | dmenu -i -p 'Proceed with upgrade for all packages?')" = "Yes" ]; then notify-send "š¦ Upgrading all packages..." yay -Syu --noconfirm - pkill -RTMIN+16 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+14 "${STATUSBAR:-dwmblocks}" notify-send "ā
Upgrade of all packages completed." else notify-send "ā Upgrade cancelled." @@ -31,7 +31,7 @@ case "$selection" in if [ "$(printf "No\nYes" | dmenu -i -p 'Proceed with pacman upgrade?')" = "Yes" ]; then notify-send "š¦ Upgrading pacman packages..." printf "%s" "$pacman_updates" | awk '{print $1}' | xargs sudo pacman -S --noconfirm - pkill -RTMIN+16 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+14 "${STATUSBAR:-dwmblocks}" notify-send "ā
Pacman packages upgrade completed." else notify-send "ā Upgrade cancelled." @@ -46,7 +46,7 @@ case "$selection" in if [ "$(printf "No\nYes" | dmenu -i -p 'Proceed with upgrade for this package?')" = "Yes" ]; then notify-send "š¦ Upgrading package: $selection..." sudo pacman -S --noconfirm "$(printf "%s" "$selection" | awk '{print $1}')" - pkill -RTMIN+16 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+14 "${STATUSBAR:-dwmblocks}" notify-send "ā
Upgrade completed for package: $selection." else notify-send "ā Upgrade cancelled." @@ -73,7 +73,7 @@ case "$selection" in if [ "$(printf "No\nYes" | dmenu -i -p 'Proceed with AUR upgrade?')" = "Yes" ]; then notify-send "š¦ Upgrading AUR packages..." yay -Syu --aur --noconfirm - pkill -RTMIN+16 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+14 "${STATUSBAR:-dwmblocks}" notify-send "ā
AUR packages upgrade completed." else notify-send "ā Upgrade cancelled." @@ -88,7 +88,7 @@ case "$selection" in if [ "$(printf "No\nYes" | dmenu -i -p 'Proceed with upgrade for this package?')" = "Yes" ]; then notify-send "š¦ Upgrading AUR package: $selection..." yay -S --noconfirm "$(printf "%s" "$selection" | awk '{print $2}')" - pkill -RTMIN+16 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+14 "${STATUSBAR:-dwmblocks}" notify-send "ā
Upgrade completed for AUR package: $selection." else notify-send "ā Upgrade cancelled." diff --git a/ar/.local/bin/ethwifi b/ar/.local/bin/ethwifi index 26366e9..c4fa0c6 100755 --- a/ar/.local/bin/ethwifi +++ b/ar/.local/bin/ethwifi @@ -28,4 +28,4 @@ else fi # Refresh status bar -pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}" +pkill -RTMIN+6 "${STATUSBAR:-dwmblocks}" diff --git a/ar/.local/bin/extractkeys b/ar/.local/bin/extractkeys index b45358d..4e4e5b4 100755 --- a/ar/.local/bin/extractkeys +++ b/ar/.local/bin/extractkeys @@ -125,6 +125,7 @@ for file_path in "${config_files[@]}"; do s/&layouts\[12\]/"|M|"/g; s/&layouts\[13\]/">M>"/g; s/^\s*//g; + s/pkexec //g; /^\s*0\s*$/d ') diff --git a/ar/.local/bin/fzffiles b/ar/.local/bin/fzffiles index 9f5cd90..64c7a6d 100755 --- a/ar/.local/bin/fzffiles +++ b/ar/.local/bin/fzffiles @@ -11,7 +11,7 @@ IFS=' files=$(fzf-tmux \ --header "^a pwd ^b public ^d .dotfiles ^f configs ^g git ^h home ^k desktop ^r scripts ^s suckless ^u staged files ^v private ^/ help" \ --preview "selection={}; - clean=\$(printf '%s' \"\$selection\" | sed -e 's/^š //' -e 's/^āļø //' -e 's/^ā
//' -e 's/^ā //' -e 's/^š //' -e 's/^ā //'); + clean=\$(printf '%s' \"\$selection\" | sed -e 's/^š //' -e 's/^ā //' -e 's/^ā
//' -e 's/^ā //' -e 's/^š //' -e 's/^ā //'); [ -z \"\$clean\" ] && { echo 'No selection'; exit 0; } target=\$(readlink -f \"\$clean\" 2>/dev/null || printf '%s' \"\$clean\"); if [ -z \"\$target\" ]; then @@ -65,7 +65,7 @@ files=$(fzf-tmux \ else if (staged == \"!\" && unstaged == \"!\") icon=\"ā\"; else if (staged != \" \" && staged != \"?\" && unstaged != \" \" && unstaged != \"?\") icon=\"š\"; else if (staged != \" \" && staged != \"?\") icon=\"ā
\"; - else if (unstaged != \" \") icon=\"āļø\"; + else if (unstaged != \" \") icon=\"ā\"; else icon=\"ā\"; print icon \" \" root \"/\" file }'; else echo 'This is not a git repository.'; fi)" \ diff --git a/ar/.local/bin/gitupdate b/ar/.local/bin/gitupdate index 6ee163a..3dabf34 100755 --- a/ar/.local/bin/gitupdate +++ b/ar/.local/bin/gitupdate @@ -2,8 +2,6 @@ set -eu -pidof transmission-daemon >/dev/null && echo "Turn off transmission-daemon first!" && exit 1 - # Check if inside a Git repository ! git rev-parse --is-inside-work-tree >/dev/null 2>&1 && echo "Not a git repository." && exit 1 @@ -87,4 +85,4 @@ printf "\n[repo] %s(%s): %s\n" "$(basename "$repo_root")" "$branch" "$message" # Return to the original directory cd - >/dev/null -command -v dwmblocks >/dev/null 2>&1 && pkill -RTMIN+18 "${STATUSBAR:-dwmblocks}" +command -v dwmblocks >/dev/null 2>&1 && pkill -RTMIN+16 "${STATUSBAR:-dwmblocks}" diff --git a/ar/.local/bin/monitorbright b/ar/.local/bin/monitorbright index 2de2e5d..db2bcf3 100755 --- a/ar/.local/bin/monitorbright +++ b/ar/.local/bin/monitorbright @@ -15,10 +15,6 @@ case "$monitor" in esac new_brightness=$(echo "if ($new_brightness > 1) 1 else if ($new_brightness < 0) 0 else $new_brightness" | bc -l) xrandr --output "$monitor" --brightness "$new_brightness" - current_brightness=$(echo "$new_brightness * 100" | bc -l) - else - current_brightness=$(echo "$current_brightness * 100" | bc -l) fi - printf "šŖ%.0f%%\n" "$current_brightness" ;; esac diff --git a/ar/.local/bin/opensessions b/ar/.local/bin/opensessions index d16f42f..e05e68a 100755 --- a/ar/.local/bin/opensessions +++ b/ar/.local/bin/opensessions @@ -9,7 +9,7 @@ dirs=$(echo "$dirs" | tr -s ' ' '\n' | sed '/^$/d') # function to clean and create a valid session name get_session_name() { - basename "$1" | sed 's/[^a-zA-Z0-9]/_/g' + basename "$1" | sed 's/[^a-zA-Z0-9-]/_/g' } set -- $dirs diff --git a/ar/.local/bin/ovpn b/ar/.local/bin/ovpn index a89c357..10ecc01 100755 --- a/ar/.local/bin/ovpn +++ b/ar/.local/bin/ovpn @@ -7,7 +7,6 @@ turnonoffvpn() { ;; *off*) nmcli connection down "$THESIAH_VPN" 2>/dev/null && notify-send "āļø THESIAH_VPN: OFF" || notify-send "āļø Error to disconnect" - ;; esac } diff --git a/ar/.local/bin/qndl b/ar/.local/bin/qndl index 46b4aa8..2757eb8 100755 --- a/ar/.local/bin/qndl +++ b/ar/.local/bin/qndl @@ -47,7 +47,7 @@ case $type in video_id=$(echo "$line" | awk '{print $2}') ytdl_cmd="$ytdl_cmd_base --output \"$ytdl_output_format\" \"https://www.youtube.com/watch?v=$video_id\"" idnum=$(tsp bash -c "$ytdl_cmd") - pkill -RTMIN+21 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+19 "${STATUSBAR:-dwmblocks}" done <"$archive_file" exit 0 ;; @@ -120,7 +120,7 @@ filename=$($simulation_cmd 2>/dev/null) [ -f /tmp/qplaylist ] && rm -rf /tmp/qplaylist notify-send "ā³ Downloading $download_type:" "$filename" idnum=$(tsp bash -c "$ytdl_cmd") -pkill -RTMIN+21 "${STATUSBAR:-dwmblocks}" +pkill -RTMIN+19 "${STATUSBAR:-dwmblocks}" # Notify upon completion tsp -D "$idnum" notify-send "ā
$download_type download complete:" "$url" || diff --git a/ar/.local/bin/statusbar/sb-brightness b/ar/.local/bin/statusbar/sb-brightness index 909e676..e18fa2c 100755 --- a/ar/.local/bin/statusbar/sb-brightness +++ b/ar/.local/bin/statusbar/sb-brightness @@ -1,11 +1,31 @@ #!/bin/sh +monitor=$(xrandr --query | grep -i '\sconnected' | grep '[0-9]x[0-9]' | grep -i 'primary' | cut -d ' ' -f1) +[ -z "$monitor" ] && monitor=$(xrandr --query | grep -i '\sconnected' | grep '[0-9]x[0-9]' | cut -d ' ' -f1) +case "$monitor" in +*DP* | *HDMI*) + current_brightness=$(xrandr --verbose | grep -i "^$monitor connected" -A5 | grep -i "Brightness:" | cut -d ' ' -f2) + current_brightness=$(printf "%.0f\n" "$(echo "$current_brightness * 100" | bc -l)") + ;; +esac + case $BLOCK_BUTTON in 3) notify-send "š Backlight module -- Scroll up & down changes backlight" ;; -4) monbright -inc 5 ;; -5) monbright -dec 5 ;; +- Scroll up & down changes screen brightness +- Shift + Scroll up & down changes monitor backlight" ;; +4) pkexec brillo -A 5 -q ;; +5) pkexec brillo -U 5 -q ;; 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; +7) monbright -inc 5 ;; +8) monbright -dec 5 ;; +9) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac -monitorbright +if [ -r /sys/class/backlight/*/brightness ]; then + curr_brightness=$(cat /sys/class/backlight/*/brightness) + max_brightness=$(cat /sys/class/backlight/*/max_brightness) + brightness_per=$((100 * curr_brightness / max_brightness)) + printf "%s %s\n" "š”${brightness_per}%" "šŖ$current_brightness" +else + printf "%s\n" "šŖ$current_brightness" +fi diff --git a/ar/.local/bin/statusbar/sb-cpu b/ar/.local/bin/statusbar/sb-cpu index 0cb6f4f..753542f 100755 --- a/ar/.local/bin/statusbar/sb-cpu +++ b/ar/.local/bin/statusbar/sb-cpu @@ -3,7 +3,7 @@ case $BLOCK_BUTTON in 1) notify-send "š„ CPU hogs" "$(ps axch -o cmd,%cpu | awk '{cmd[$1]+=$2} END {for (i in cmd) print i, cmd[i]}' | sort -nrk2 | head)\\n(100% per core)" ;; 2) setsid -f "$TERMINAL" -e htop ;; -3) notify-send "š„ CPU module " "\- Shows CPU temperature +3) notify-send "š§ CPU module " "\- Shows CPU temperature - Left click to show intensive processes - Middle click to open htop" ;; 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; diff --git a/ar/.local/bin/statusbar/sb-forecast b/ar/.local/bin/statusbar/sb-forecast index 4f78303..65bcd1a 100755 --- a/ar/.local/bin/statusbar/sb-forecast +++ b/ar/.local/bin/statusbar/sb-forecast @@ -11,7 +11,8 @@ weatherreportjson="${XDG_CACHE_HOME:-${HOME}/.cache}/weatherreport.json" error() { rm -f "$weatherreport" "$weatherreportjson" - notify-send -u critical "ā Failed to update 'weather$1'" + notify-send "ā Failed to update 'weather$1'" + echo "ā" exit 1 } @@ -360,6 +361,6 @@ After $secs seconds, new clicks will also automatically update the doppler RADAR 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac -checkforecast "$weatherreport" "3600" || { getweatherreport && pkill -RTMIN+15 "${STATUSBAR:-dwmblocks}" && sleep 3; } -checkforecast "$weatherreportjson" "86400" || { getweatherreportjson && pkill -RTMIN+15 "${STATUSBAR:-dwmblocks}" && sleep 3; } +checkforecast "$weatherreport" "3600" || { getweatherreport && pkill -RTMIN+13 "${STATUSBAR:-dwmblocks}" && sleep 3; } +checkforecast "$weatherreportjson" "86400" || { getweatherreportjson && pkill -RTMIN+13 "${STATUSBAR:-dwmblocks}" && sleep 3; } showweather diff --git a/ar/.local/bin/statusbar/sb-internet b/ar/.local/bin/statusbar/sb-internet index 1484f33..eeab61a 100755 --- a/ar/.local/bin/statusbar/sb-internet +++ b/ar/.local/bin/statusbar/sb-internet @@ -26,7 +26,7 @@ fi case $BLOCK_BUTTON in 1) "$TERMINAL" -e nmtui - pkill -RTMIN+7 dwmblocks + pkill -RTMIN+6 dwmblocks ;; 2) wifi_dev="$(nmcli -t -f DEVICE,TYPE device | @@ -43,9 +43,10 @@ case $BLOCK_BUTTON in notify-send "Wi-Fi" "Wi-Fi connected" fi - pkill -RTMIN+7 dwmblocks + pkill -RTMIN+6 dwmblocks ;; 3) notify-send "š Internet module" "\- Left click to connect +- Middle click to toggle wifi ā: wifi disabled š”: no wifi connection š: wifi connection with quality @@ -71,7 +72,7 @@ fi grep -q 'up' /sys/class/net/e*/operstate && ethericon="š" || ethericon="ā" # TUN -grep -q 'up' /sys/class/net/tun*/operstate 2>/dev/null && tunicon="š°" +[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon="š°" icons="" [ -n "$wifiicon" ] && icons="${icons}$wifiicon " diff --git a/ar/.local/bin/statusbar/sb-keyboard b/ar/.local/bin/statusbar/sb-keyboard index 67b5f6d..2257b1b 100755 --- a/ar/.local/bin/statusbar/sb-keyboard +++ b/ar/.local/bin/statusbar/sb-keyboard @@ -3,7 +3,7 @@ # works on any init system # requirements: dmenu, xorg-setxkbmap case $BLOCK_BUTTON in -1) fcitx5-remote -t && kill -44 "$(pidof "${STATUSBAR:-dwmblocks}")" ;; +1) fcitx5-remote -t && kill -43 "$(pidof "${STATUSBAR:-dwmblocks}")" ;; 2) remaps ;; 3) notify-send "⨠Input Method module" "\- Shows current input method (defalt US) - Left click to switch language (EN/KO) @@ -14,7 +14,7 @@ case $BLOCK_BUTTON in [ -z "$kb_choice" ] && exit 0 kb="$(echo "$kb_choice" | awk '{print $3}')" setxkbmap "$kb" - pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}" ;; esac diff --git a/ar/.local/bin/statusbar/sb-mailbox b/ar/.local/bin/statusbar/sb-mailbox index c772a0d..6926b6e 100755 --- a/ar/.local/bin/statusbar/sb-mailbox +++ b/ar/.local/bin/statusbar/sb-mailbox @@ -6,7 +6,7 @@ case $BLOCK_BUTTON in 1) setsid -w -f "$TERMINAL" -e neomutt - pkill -RTMIN+20 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+18 "${STATUSBAR:-dwmblocks}" ;; 2) setsid -f mw -Y >/dev/null ;; 3) notify-send "š¬ Mail module" "\- Shows unread mail diff --git a/ar/.local/bin/statusbar/sb-memory b/ar/.local/bin/statusbar/sb-memory index 01eb0e6..3b71f3c 100755 --- a/ar/.local/bin/statusbar/sb-memory +++ b/ar/.local/bin/statusbar/sb-memory @@ -3,9 +3,10 @@ case $BLOCK_BUTTON in 1) notify-send "š Memory hogs" "$(ps axch -o cmd,%mem | awk '{cmd[$1]+=$2} END {for (i in cmd) print i, cmd[i]}' | sort -nrk2 | head)" ;; 2) setsid -f "$TERMINAL" -e htop ;; -3) notify-send "š Memory module" "\- Shows Memory used/total +3) notify-send "š Memory module" "\- Shows Memory temperature and used/total - Left click to show memory hogs -- Middle click to open htop" ;; +- Middle click to open htop +š”ļø: Memory temperature" ;; 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac @@ -16,9 +17,9 @@ nvme_temp=$(sensors 2>/dev/null | if [ -n "$width" ] && [ "$width" -eq "$width" ] 2>/dev/null; then if [ "$width" -lt 1920 ]; then free --mebi | sed -n '2{p;q}' | - awk -v t="$nvme_temp" '{printf "š¾%s° š%d%%\n", t, ($3/$2)*100+0.5}' + awk -v t="$nvme_temp" '{printf "š”%s° š%d%%\n", t, ($3/$2)*100+0.5}' else free --mebi | sed -n '2{p;q}' | - awk -v t="$nvme_temp" '{printf "š¾%s° š%dGB/%dGB", t, $3/1000+0.5, $2/1000+0.5}' + awk -v t="$nvme_temp" '{printf "š”%s° š%dGB/%dGB", t, $3/1000+0.5, $2/1000+0.5}' fi fi diff --git a/ar/.local/bin/statusbar/sb-mpdup b/ar/.local/bin/statusbar/sb-mpdup index 90e9c7e..fa9b61b 100755 --- a/ar/.local/bin/statusbar/sb-mpdup +++ b/ar/.local/bin/statusbar/sb-mpdup @@ -4,5 +4,5 @@ # music player's status. mpd must be running on X's start for this to work. while :; do - mpc idle >/dev/null && kill -57 "$(pidof "${STATUSBAR:-dwmblocks}")" || break + mpc idle >/dev/null && kill -55 "$(pidof "${STATUSBAR:-dwmblocks}")" || break done diff --git a/ar/.local/bin/statusbar/sb-packages b/ar/.local/bin/statusbar/sb-packages index 5955c75..467bfb3 100755 --- a/ar/.local/bin/statusbar/sb-packages +++ b/ar/.local/bin/statusbar/sb-packages @@ -15,7 +15,7 @@ # [Action] # Description = Updating statusbar... # When = PostTransaction -# Exec = /usr/bin/pkill -RTMIN+16 dwmblocks # Or i3blocks if using i3. +# Exec = /usr/bin/pkill -RTMIN+14 dwmblocks # Or i3blocks if using i3. case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e sb-popupgrade && remaps ;; diff --git a/ar/.local/bin/statusbar/sb-popupgrade b/ar/.local/bin/statusbar/sb-popupgrade index 14036eb..221c7db 100755 --- a/ar/.local/bin/statusbar/sb-popupgrade +++ b/ar/.local/bin/statusbar/sb-popupgrade @@ -3,7 +3,7 @@ printf "Beginning upgrade\\n" yay -Syu -pkill -RTMIN+16 "${STATUSBAR:-dwmblocks}" +pkill -RTMIN+14 "${STATUSBAR:-dwmblocks}" printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n" read -r _ diff --git a/ar/.local/bin/statusbar/sb-price b/ar/.local/bin/statusbar/sb-price index 84d86b6..70703f8 100755 --- a/ar/.local/bin/statusbar/sb-price +++ b/ar/.local/bin/statusbar/sb-price @@ -64,4 +64,8 @@ esac notify-send "$icon Update complete" "$name price is now \$$(cat "$pricefile")" -[ -f "$pricefile" ] && printf "%s%s%0.2f" "$icon" "$symb" "$(cat "$pricefile")" +[ -f "$pricefile" ] && { + price=$(cat "$pricefile") + formatted_price=$(printf "%0.2f" "$price" | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta') + printf "%s%s%s" "$icon" "$symb" "$formatted_price" +} diff --git a/ar/.local/bin/statusbar/sb-queues b/ar/.local/bin/statusbar/sb-queues index 40445f8..477fa7f 100755 --- a/ar/.local/bin/statusbar/sb-queues +++ b/ar/.local/bin/statusbar/sb-queues @@ -18,7 +18,7 @@ EOF if [ -z "$url" ]; then notify-send "š¤ No active yt-dlp downloads" fi - pkill -RTMIN+21 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+19 "${STATUSBAR:-dwmblocks}" } # This block displays the number of running and queued background tasks. Requires tsp. diff --git a/ar/.local/bin/statusbar/sb-volume b/ar/.local/bin/statusbar/sb-volume index 7881bfd..291e78d 100755 --- a/ar/.local/bin/statusbar/sb-volume +++ b/ar/.local/bin/statusbar/sb-volume @@ -5,7 +5,7 @@ case $BLOCK_BUTTON in 1) setsid -w -f "$TERMINAL" -e pulsemixer - pkill -RTMIN+5 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+4 "${STATUSBAR:-dwmblocks}" ;; 2) wpctl set-mute @DEFAULT_SINK@ toggle ;; 3) notify-send "š¢ Volume module" "\- Shows volume š, š if muted diff --git a/ar/.local/bin/synctime b/ar/.local/bin/synctime index 47f4310..664639f 100755 --- a/ar/.local/bin/synctime +++ b/ar/.local/bin/synctime @@ -19,4 +19,4 @@ sudo hwclock --systohc echo "Current timezone: $current_zone" date -pkill -RTMIN+3 ${STATUSBAR:-dwmblocks} +pkill -RTMIN+2 ${STATUSBAR:-dwmblocks} diff --git a/ar/.local/bin/sysact b/ar/.local/bin/sysact index d4f3653..64ef127 100755 --- a/ar/.local/bin/sysact +++ b/ar/.local/bin/sysact @@ -11,10 +11,10 @@ lock() { mpc pause pauseallmpv wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle - kill -39 "$(pidof dwmblocks)" + kill -38 "$(pidof dwmblocks)" slock wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle - kill -39 "$(pidof dwmblocks)" + kill -38 "$(pidof dwmblocks)" } wmpid() { # This function is needed if there are multiple instances of the window manager. diff --git a/ar/.local/bin/td-toggle b/ar/.local/bin/td-toggle index 4bbe75c..c71d53f 100755 --- a/ar/.local/bin/td-toggle +++ b/ar/.local/bin/td-toggle @@ -8,4 +8,4 @@ else ifinstalled transmission-cli || exit [ "$(printf "No\\nYes" | dmenu -i -p "Turn on transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "š transmission-daemon enabled." fi -sleep 3 && pkill -RTMIN+22 "${STATUSBAR:-dwmblocks}" +sleep 3 && pkill -RTMIN+20 "${STATUSBAR:-dwmblocks}" diff --git a/ar/.local/bin/tordone b/ar/.local/bin/tordone index 4e097a0..016568f 100755 --- a/ar/.local/bin/tordone +++ b/ar/.local/bin/tordone @@ -5,6 +5,6 @@ if [ -n "$completed_torrents" ]; then for torrent_id in $completed_torrents; do transmission-remote -n "$USER" -t "$torrent_id" -r done - pkill -RTMIN+22 "${STATUSBAR:-dwmblocks}" && notify-send "ā
Transmission-daemon" "Torrent(s) $TR_TORRENT_NAME has completed downloading. Deleting torrent files." + pkill -RTMIN+20 "${STATUSBAR:-dwmblocks}" && notify-send "ā
Transmission-daemon" "Torrent(s) $TR_TORRENT_NAME has completed downloading. Deleting torrent files." [ -z "$(transmission-remote -n "$USER" -l | grep -v "Sum:")" ] && killall transmission-daemon && notify-send "ā Transmission-daemon disabled." fi diff --git a/ar/.local/bin/torwrap b/ar/.local/bin/torwrap index 54f5c0e..624778a 100755 --- a/ar/.local/bin/torwrap +++ b/ar/.local/bin/torwrap @@ -5,4 +5,4 @@ ifinstalled stig transmission-cli || exit 1 ! pidof transmission-daemon >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." "${TERMINAL:-st}" -n stig -e stig -pkill -RTMIN+22 "${STATUSBAR:-dwmblocks}" +pkill -RTMIN+20 "${STATUSBAR:-dwmblocks}" diff --git a/ar/.local/bin/transadd b/ar/.local/bin/transadd index ffd8ded..567b1bc 100755 --- a/ar/.local/bin/transadd +++ b/ar/.local/bin/transadd @@ -4,7 +4,7 @@ # transmission-daemon sometimes fails to take remote requests in its first moments, hence the sleep. -pidof transmission-daemon >/dev/null || (transmission-daemon && notify-send "š” Starting transmission daemon..." && sleep 3 && pkill -RTMIN+22 "${STATUSBAR:-dwmblocks}") +pidof transmission-daemon >/dev/null || (transmission-daemon && notify-send "š” Starting transmission daemon..." && sleep 3 && pkill -RTMIN+20 "${STATUSBAR:-dwmblocks}") directory="$HOME/Torrents" diff --git a/global/.local/share/thesiah/chars/emoji b/global/.local/share/thesiah/chars/emoji index 093c6c3..6513cbb 100644 --- a/global/.local/share/thesiah/chars/emoji +++ b/global/.local/share/thesiah/chars/emoji @@ -310,7 +310,7 @@ š¬ men holding hands š kiss š couple with heart -š£ļø speaking head +š£ speaking head š¤ bust in silhouette š„ busts in silhouette š« people hugging diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua index ee97612..36bd545 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua @@ -346,7 +346,7 @@ return { vim.o.autoread = true -- Recommended/example keymaps. - vim.keymap.set({ "n", "x" }, "<C-q>", function() + vim.keymap.set({ "n", "x" }, "<C-a>", function() require("opencode").ask("@this: ", { submit = true }) end, { desc = "Ask opencode" }) vim.keymap.set({ "n", "x" }, "<C-x>", function() @@ -456,7 +456,7 @@ return { instructions_file = "avante.md", ---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string ---@type Provider - provider = "claude", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode + provider = "openai", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode ---@alias Mode "agentic" | "legacy" ---@type Mode mode = "agentic", -- The default mode for interaction. "agentic" uses tools to automatically generate code, "legacy" uses the old planning method to generate code. @@ -467,7 +467,6 @@ return { providers = { claude = { endpoint = "https://api.anthropic.com", - auth_type = "max", -- Set to "max" to sign in with Claude Pro/Max subscription model = "claude-sonnet-4-20250514", timeout = 30000, -- Timeout in milliseconds extra_request_body = { diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua index 90528a1..f1c636b 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua @@ -3,15 +3,46 @@ local ls = require("luasnip") local s = ls.snippet local i = ls.insert_node local f = ls.function_node +local c = ls.choice_node +local t = ls.text_node local fmt = require("luasnip.extras.fmt").fmta +local function bgm_list() + local handle = io.popen("ssh root@thesiah.xyz 'ls /var/www/thesiah/bgm/' 2>/dev/null") + if not handle then + return nil + end + + local result = handle:read("*a") + handle:close() + + if not result or result == "" then + return nil + end + + local choices = {} + for filename in result:gmatch("[^\r\n]+") do + table.insert(choices, t(filename)) + end + + if #choices == 0 then + return nil + end + + return choices +end + +local bgm_choices = bgm_list() +local bgm_node = bgm_choices and c(2, bgm_choices) or i(2, "bgm") + local diary_snippet = s( "diary", fmt( [[--- title: <title> date: <date> +bgm: <bgm> --- <story> @@ -21,6 +52,7 @@ date: <date> date = f(function() return os.date("%Y-%m-%d") end, {}), + bgm = bgm_node, story = i(3), } ) diff --git a/mac/.config/git/ignore b/mac/.config/git/ignore index 2121586..7c177dc 100644 --- a/mac/.config/git/ignore +++ b/mac/.config/git/ignore @@ -119,3 +119,5 @@ thesiah.mom # thesiah.mom */thesiah/thesiah.mom + +**/.claude/settings.local.json |
