diff options
author | awy <awy@tutamail.com> | 2024-08-27 17:36:26 +0300 |
---|---|---|
committer | awy <awy@tutamail.com> | 2024-08-27 17:36:26 +0300 |
commit | fd953c5191677355b789ea636f61de5a83fbf38c (patch) | |
tree | 1d4c45e6ffa8590fe2511f4ca7f5f8374c5781b5 /.local/bin | |
parent | 427dc591da83a94e352840c335ea41b96983e7e4 (diff) |
stuff
Diffstat (limited to '.local/bin')
-rwxr-xr-x | .local/bin/start-portal | 7 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-clock | 12 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-doppler | 7 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-microphone | 38 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-nettraf | 16 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-volume | 42 |
6 files changed, 84 insertions, 38 deletions
diff --git a/.local/bin/start-portal b/.local/bin/start-portal new file mode 100755 index 0000000..4fe3003 --- /dev/null +++ b/.local/bin/start-portal @@ -0,0 +1,7 @@ +#!/bin/dash + +killall "xdg-desktop-portal" "xdg-desktop-portal-hyprland" "xdg-desktop-portal-wlr" +sleep "2" +"/lib/xdg-desktop-portal-hyprland" & +sleep "2" +"/lib/xdg-desktop-portal" & diff --git a/.local/bin/statusbar/sb-clock b/.local/bin/statusbar/sb-clock index bdf3590..67ad409 100755 --- a/.local/bin/statusbar/sb-clock +++ b/.local/bin/statusbar/sb-clock @@ -18,4 +18,14 @@ case "$clock" in "12") icon="π" ;; esac -date "+%b %d (%a) $icon %H:%M" +if [ ! -n "$1" ]; then + date "+%b %d (%a) $icon %H:%M" +else + if [ "$1" -eq 1 ]; then + notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|tr -d ' ')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" + elif [ "$1" -eq 3 ]; then + notify-send "π
Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` +- Middle click opens calcurse if installed" + fi +fi + diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler index f9bb8fe..aad82c4 100755 --- a/.local/bin/statusbar/sb-doppler +++ b/.local/bin/statusbar/sb-doppler @@ -4,17 +4,14 @@ showdoppler() { hyprctl dispatch exec "[float; size 800 800;]" 'curl -s https://meteoinfo.ru/hmc-output/rmap/phenomena.gif | imv - -H 1200 -W 1200' } -sendnotif() { - notify-send "πΊοΈ Doppler RADAR module" "\- Left click for local Doppler RADAR. -- Middle click to update RADAR location." -} if [ ! -n "$1" ]; then echo π
else if [ "$1" -eq 1 ]; then showdoppler elif [ "$1" -eq 3 ]; then - sendnotif + notify-send "πΊοΈ Doppler RADAR module" "\- Left click for local Doppler RADAR. +- You need to manually edit the url in the script to change location." fi fi diff --git a/.local/bin/statusbar/sb-microphone b/.local/bin/statusbar/sb-microphone index e07e0de..01a44cf 100755 --- a/.local/bin/statusbar/sb-microphone +++ b/.local/bin/statusbar/sb-microphone @@ -1,12 +1,7 @@ #!/bin/sh - +var=$1 mic="$(wpctl get-volume @DEFAULT_SOURCE@)" -# If muted, print π and exit. -[ "$mic" != "${mic%\[MUTED\]}" ] && echo ο± && exit - -mic="${mic#Volume: }" - split() { # For ommiting the . without calling and external program. IFS=$2 @@ -14,11 +9,28 @@ split() { printf '%s' "$@" } -mic="$(printf "%.0f" "$(split "$mic" ".")")" - -case 1 in - $((mic >= 1)) ) icon="ποΈ" ;; - * ) echo ο± && exit ;; -esac +sig() { + if [ ! -n "$var" ]; then + if [ -n "$flag" ] ; then + echo "$icon" + else + case 1 in + $((mic >= 1)) ) icon="ποΈ" ;; + * ) echo ο± && exit ;; + esac + echo "$icon $mic%" + fi + else + if [ "$var" -eq 3 ]; then + notify-send "π€ Microphone module" "\- Shows volume ποΈ, ο± if muted. +- Middle click to mute. +- Scroll to change." + fi + fi + exit +} -echo "$icon $mic%" +[ "$mic" != "${mic%\[MUTED\]}" ] && icon="ο±" && flag=1 && sig +mic="${mic#Volume: }" +mic="$(printf "%.0f" "$(split "$mic" ".")")" +sig diff --git a/.local/bin/statusbar/sb-nettraf b/.local/bin/statusbar/sb-nettraf index 88df9bd..c9aa417 100755 --- a/.local/bin/statusbar/sb-nettraf +++ b/.local/bin/statusbar/sb-nettraf @@ -16,7 +16,15 @@ update() { printf %d\\n $(( sum - old )) } -rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) -tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) - -printf "π»%4sB πΊ%4sB\\n" $(numfmt --to=iec $rx $tx) +if [ ! -n "$1" ]; then + rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) + tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) + printf "π»%4sB πΊ%4sB\\n" $(numfmt --to=iec $rx $tx) +else + if [ "$1" -eq 1 ]; then + hyprctl dispatch exec "[float; size 1800 1300;]" 'kitty -e sh -c "bmon"' + elif [ "$1" -eq 3 ]; then + notify-send "π Network traffic module" "π»: Traffic received +πΊ: Traffic transmitted" + fi +fi diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index e3501d1..06dd23a 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -1,12 +1,7 @@ #!/bin/sh - +var=$1 vol="$(wpctl get-volume @DEFAULT_SINK@)" -# If muted, print π and exit. -[ "$vol" != "${vol%\[MUTED\]}" ] && echo π && exit - -vol="${vol#Volume: }" - split() { # For ommiting the . without calling and external program. IFS=$2 @@ -14,13 +9,30 @@ split() { printf '%s' "$@" } -vol="$(printf "%.0f" "$(split "$vol" ".")")" - -case 1 in - $((vol >= 70)) ) icon="π" ;; - $((vol >= 30)) ) icon="π" ;; - $((vol >= 1)) ) icon="π" ;; - * ) echo π && exit ;; -esac +sig() { + if [ ! -n "$var" ]; then + if [ -n "$flag" ] ; then + echo "$icon" + else + case 1 in + $((vol >= 70)) ) icon="π" ;; + $((vol >= 30)) ) icon="π" ;; + $((vol >= 1)) ) icon="π" ;; + * ) echo π && exit ;; + esac + echo "$icon $vol%" + fi + else + if [ "$var" -eq 3 ]; then + notify-send "π’ Volume module" "\- Shows volume π, π if muted. +- Middle click to mute. +- Scroll to change." + fi + fi + exit +} -echo "$icon $vol%" +[ "$vol" != "${vol%\[MUTED\]}" ] && icon="π" && flag=1 && sig +vol="${vol#Volume: }" +vol="$(printf "%.0f" "$(split "$vol" ".")")" +sig |