diff --git a/.scripts/dmenumount b/.scripts/dmenumount index 2cdf152..e0bb500 100755 --- a/.scripts/dmenumount +++ b/.scripts/dmenumount @@ -1,7 +1,5 @@ #!/bin/sh -# Should be run with sudo. - # Gives a dmenu prompt to mount unmounted drives. # If they're in /etc/fstab, they'll be mounted automatically. # Otherwise, you'll be prompted to give a mountpoint from already existsing directories. @@ -24,4 +22,4 @@ if [[ ! -d "$mountpoint" ]]; then mkdiryn=$(echo -e "No\nYes" | dmenu -i -p "$mountpoint does not exist. Create it?") [[ "$mkdiryn" = Yes ]] && sudo mkdir -p "$mountpoint" fi -sudo mount "$chosen" "$mountpoint" +sudo mount $chosen $mountpoint && pgrep -x dunst && notify-send "$chosen mounted to $mountpoint." diff --git a/.scripts/dmenuumount b/.scripts/dmenuumount index 5a26677..d333e2a 100755 --- a/.scripts/dmenuumount +++ b/.scripts/dmenuumount @@ -11,4 +11,4 @@ drives=$(lsblk -lp | grep "t /" | grep -v "$exclusionregex" | awk '{print $1, "( [[ "$drives" = "" ]] && exit chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}') [[ "$chosen" = "" ]] && exit -sudo umount $chosen +sudo umount $chosen && pgrep -x dunst && notify-send "$chosen unmounted." diff --git a/.scripts/i3battery b/.scripts/i3battery new file mode 100755 index 0000000..a632b9b --- /dev/null +++ b/.scripts/i3battery @@ -0,0 +1,2 @@ +#!/bin/sh +#acpi | cut -d " " -f3-5 | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g" diff --git a/.scripts/i3mail b/.scripts/i3mail new file mode 100755 index 0000000..9b4aa3e --- /dev/null +++ b/.scripts/i3mail @@ -0,0 +1,5 @@ +#!/bin/sh +case $BLOCK_BUTTON in + 1) $TERMINAL -e neomutt ;; +esac +echo $(find ~/.mail -wholename */INBOX/new/* | wc -l) diff --git a/.scripts/i3mpd b/.scripts/i3mpd new file mode 100755 index 0000000..b2a34bb --- /dev/null +++ b/.scripts/i3mpd @@ -0,0 +1,18 @@ +#!/bin/bash + +# Pass the password in the block instance +if [[ -n $BLOCK_INSTANCE ]]; then + password=("-h" "$BLOCK_INSTANCE@localhost") +fi + +filter() { + tr '\n' ' ' | grep -Po '.*(?= \[playing\])|paused' | tr -d '\n' +} + +case $BLOCK_BUTTON in + 1) mpc $password status | filter && $TERMINAL -e ncmpcpp & disown ;; # right click, pause/unpause + 3) mpc $password toggle | filter ;; # right click, pause/unpause + 4) mpc $password prev | filter ;; # scroll up, previous + 5) mpc $password next | filter ;; # scroll down, next + *) mpc $password status | filter ;; +esac diff --git a/.scripts/i3volume b/.scripts/i3volume new file mode 100755 index 0000000..b47a6fa --- /dev/null +++ b/.scripts/i3volume @@ -0,0 +1,12 @@ +#!/bin/bash + +case $BLOCK_BUTTON in + 1) $TERMINAL -e ncpamixer & disown ;; + 3) pamixer -t ;; + 4) pamixer -i 5 ;; + 5) pamixer -d 5 ;; +esac + +printpastatus() { [[ $(pamixer --get-mute) = "true" ]] && echo -n 🔇 && exit +echo 🔊 $(pamixer --get-volume)% ;} +printpastatus diff --git a/.scripts/i3weather b/.scripts/i3weather new file mode 100755 index 0000000..2464795 --- /dev/null +++ b/.scripts/i3weather @@ -0,0 +1,12 @@ +#!/bin/bash + +[[ $BLOCK_BUTTON = "1" ]] && st -e w3m wttr.in + +ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit + +curl wttr.in > ~/.weatherreport + +echo -n ☔ $(cat ~/.weatherreport | sed -n 16p | sed -e 's/[^m]*m//g' | grep -o "[0-9]*%" | sort -n | sed -e '$!d') + +cat ~/.weatherreport | sed -n 13p | sed -e 's/[^m]*m//g;s/[^0-9]/ /g;s/ /\n/g;/^s*$/d' | grep [0-9] | sort -n | sed -e 1b -e '$!d' | tr '\n' ' ' | awk '{print " ❄️",$1 "°","☀️",$2 "°"}' + diff --git a/.scripts/larbs.png b/.scripts/larbs.png new file mode 100644 index 0000000..0dbc687 Binary files /dev/null and b/.scripts/larbs.png differ