aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMohammad Reza Karimi <m.r.karimi.j@gmail.com>2026-01-24 19:24:55 -0500
committerMohammad Reza Karimi <m.r.karimi.j@gmail.com>2026-01-24 19:24:55 -0500
commite2a70a92822b22633562e9695c300efec2b5cbeb (patch)
treefbd1658be1ab5edb1470d9a8e4b758818cc7124c /scripts
parent4052357e021085bc1c761108446ee09a778ade15 (diff)
updates
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dot-local/bin/colorpick6
-rwxr-xr-xscripts/dot-local/bin/mailsync4
-rwxr-xr-xscripts/dot-local/bin/pywal17
-rwxr-xr-xscripts/dot-local/bin/toggle-alacritty-font-size8
-rwxr-xr-xscripts/dot-local/bin/toggle-waybar3
-rwxr-xr-xscripts/dot-local/bin/void-vm3
6 files changed, 40 insertions, 1 deletions
diff --git a/scripts/dot-local/bin/colorpick b/scripts/dot-local/bin/colorpick
new file mode 100755
index 0000000..6159387
--- /dev/null
+++ b/scripts/dot-local/bin/colorpick
@@ -0,0 +1,6 @@
+#!/bin/sh
+color=$(grim -g "$(slurp -p -b00000000)" -t ppm - | magick convert - -format '%[pixel:p{0,0}]' txt:- | tail -n 1 | awk '{print $3}')
+if [ -n "$color" ]; then
+ notify-send "ColorPick" "$color"
+ wl-copy "$color"
+fi
diff --git a/scripts/dot-local/bin/mailsync b/scripts/dot-local/bin/mailsync
index 7e16626..be2f93d 100755
--- a/scripts/dot-local/bin/mailsync
+++ b/scripts/dot-local/bin/mailsync
@@ -8,7 +8,7 @@ fi
mbsync_running()
{
- account_escaped=$(printf '%s\n' "$1" | sed 's/[.[\*^$()+?{|\\]/\\&/g')
+ local account_escaped=$(printf '%s\n' "$1" | sed 's/[.[\*^$()+?{|\\]/\\&/g')
pgrep -f "^mbsync([[:space:]]+[^ ]+)*[[:space:]]+$account_escaped($|[[:space:]])" >/dev/null ||
pgrep -f "^mbsync([[:space:]]+[^ ]+)*[[:space:]]+-a($|[[:space:]])" >/dev/null
@@ -53,6 +53,7 @@ sync_and_notify()
{
mbsync $mbsync_flag "$1"
+ local new newcount
new=$(fd --type f --changed-after "@$time_lastrun" . "$MAILDIR/$1/INBOX/new/" "$MAILDIR/$1/INBOX/cur/" 2>/dev/null)
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
@@ -64,6 +65,7 @@ sync_and_notify()
$((newcount > 0)))
echo "$newcount new mail for $1."
for file in $new; do
+ local subject from
# Extract and decode subject and sender from mail.
subject=$(awk '/^Subject: / && ++n == 1,/^.*: / && ++i == 2' "$file" | head -n-1 |
perl -CS -MEncode -ne 'print decode("MIME-Header", $_)' |
diff --git a/scripts/dot-local/bin/pywal b/scripts/dot-local/bin/pywal
new file mode 100755
index 0000000..ef494a0
--- /dev/null
+++ b/scripts/dot-local/bin/pywal
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+wal_args=
+if [ "$1" = -i ]; then
+ shift
+ wal_args="-i $@"
+elif [ "$1" = -l ]; then
+ shift
+ theme=$(ls /usr/lib/python3.14/site-packages/pywal/colorschemes/dark | sed 's/\.json$//' | fzf)
+ wal_args="--theme $theme $@"
+elif [ -z "$1" ]; then
+ wal_args="--theme random_dark"
+else
+ wal_args="--theme $@"
+fi
+
+wal $wal_args --cols16 -o ~/.config/wal/scripts/niri-colors.sh && touch -m ~/.config/ironbar/style.css
diff --git a/scripts/dot-local/bin/toggle-alacritty-font-size b/scripts/dot-local/bin/toggle-alacritty-font-size
new file mode 100755
index 0000000..9ea9a8c
--- /dev/null
+++ b/scripts/dot-local/bin/toggle-alacritty-font-size
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+size=$(alacritty msg get-config | jq -r '.font.size')
+if [ $size = "25.0" ]; then
+ alacritty msg config 'font.size=12'
+else
+ alacritty msg config 'font.size=25'
+fi
diff --git a/scripts/dot-local/bin/toggle-waybar b/scripts/dot-local/bin/toggle-waybar
new file mode 100755
index 0000000..fe3bc53
--- /dev/null
+++ b/scripts/dot-local/bin/toggle-waybar
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+kill -s USR1 $(pgrep waybar)
diff --git a/scripts/dot-local/bin/void-vm b/scripts/dot-local/bin/void-vm
new file mode 100755
index 0000000..0c935a2
--- /dev/null
+++ b/scripts/dot-local/bin/void-vm
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec qemu-system-x86_64 -drive file=$HOME/probe/qemu/void-linux.img,format=qcow2,if=virtio -m 16G -enable-kvm -machine q35 -device intel-iommu -cpu host -smp cores=2,threads=4,sockets=1 -nic user,model=virtio-net-pci -device virtio-vga-gl -display sdl,gl=on -drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd -drive if=pflash,format=raw,file=$HOME/probe/qemu/OVMF_VARS.4m.fd -monitor unix:/tmp/monitor.sock,server,nowait