diff options
Diffstat (limited to 'ar/.local/bin/statusbar')
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-battery | 4 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-bghitness | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-brightness | 28 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-clock | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-cpu | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-forecast | 8 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-internet | 56 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-iplocate | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-keyboard | 8 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-mailbox | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-memory | 12 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-mpdup | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-music | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-packages | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-popupgrade | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-queues | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-repos | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-tasks | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-torrent | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-volume | 2 |
20 files changed, 105 insertions, 39 deletions
diff --git a/ar/.local/bin/statusbar/sb-battery b/ar/.local/bin/statusbar/sb-battery index faf3d04..fc02f61 100755 --- a/ar/.local/bin/statusbar/sb-battery +++ b/ar/.local/bin/statusbar/sb-battery @@ -10,7 +10,7 @@ get_status_icon() { Discharging) echo "π" ;; Charging) echo "π" ;; "Not charging") echo "π" ;; - Unknown) echo "β»οΈ" ;; + Unknown) echo "β»" ;; *) echo "" ;; esac } @@ -57,7 +57,7 @@ case "$BLOCK_BUTTON" in 2) bluetooth && devices "hid*" ;; # Middle click for Bluetooth battery levels 3) notify-send "π Battery module" "\- π: discharging - π: not charging -- β»οΈ: stagnant charge +- β»: stagnant charge - π: charging - β‘: fully charged - β: battery very low! diff --git a/ar/.local/bin/statusbar/sb-bghitness b/ar/.local/bin/statusbar/sb-bghitness index 0aabfb6..83dc809 100755 --- a/ar/.local/bin/statusbar/sb-bghitness +++ b/ar/.local/bin/statusbar/sb-bghitness @@ -10,7 +10,7 @@ max_brightness=$(cat /sys/class/backlight/*/max_brightness) brightness_per=$((100 * curr_brightness / max_brightness)) case $BLOCK_BUTTON in -3) notify-send "π‘ Brightness module" "\- Shows current brightness level βοΈ." ;; +3) notify-send "π‘ Brightness module" "\- Shows current brightness level β ." ;; 4) pkexec brillo -A 5 -q ;; 5) pkexec brillo -U 5 -q ;; 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; 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-clock b/ar/.local/bin/statusbar/sb-clock index a5992a5..d909326 100755 --- a/ar/.local/bin/statusbar/sb-clock +++ b/ar/.local/bin/statusbar/sb-clock @@ -1,7 +1,7 @@ #!/bin/sh # Get current hour and minute -calendar="ποΈ" +calendar="π" hour=$(date '+%I') minute=$(date '+%M') diff --git a/ar/.local/bin/statusbar/sb-cpu b/ar/.local/bin/statusbar/sb-cpu index 565ca26..0cb6f4f 100755 --- a/ar/.local/bin/statusbar/sb-cpu +++ b/ar/.local/bin/statusbar/sb-cpu @@ -9,4 +9,4 @@ case $BLOCK_BUTTON in 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac -sensors | awk '/Core 0/ {printf "π§%dΒ°\n", $3}' +sensors | awk '/Tctl:/ {gsub(/[+Β°C]/,"",$2); printf "π§%sΒ°", $2}' diff --git a/ar/.local/bin/statusbar/sb-forecast b/ar/.local/bin/statusbar/sb-forecast index d9dded0..063c8e5 100755 --- a/ar/.local/bin/statusbar/sb-forecast +++ b/ar/.local/bin/statusbar/sb-forecast @@ -59,7 +59,7 @@ gethightemp() { jq -r '.weather[0].hourly[].tempC' "$weatherreportjson" | sort - gethumidity() { humidity=$(get_nearest_hourly | jq -r '.humidity') case "$humidity" in - [0-9] | [1-2][0-9]) echo "ποΈ: $humidity%" ;; + [0-9] | [1-2][0-9]) echo "π: $humidity%" ;; [3-4][0-9]) echo "π²: $humidity%" ;; [5-6][0-9]) echo "π§: $humidity%" ;; [7-8][0-9]) echo "π¦: $humidity%" ;; @@ -351,7 +351,7 @@ case $BLOCK_BUTTON in π₯Ά: Daily lowest temperature π₯΅: Daily highest temperature" notify-send "$(todayweather)" - notify-send "πΊοΈ Doppler RADAR module" "\- Middle click for local Doppler RADAR + notify-send "πΊ Doppler RADAR module" "\- Middle click for local Doppler RADAR - Shift + middle click to update RADAR location After $secs seconds, new clicks will also automatically update the doppler RADAR" ;; @@ -360,6 +360,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 df43676..4dfb605 100755 --- a/ar/.local/bin/statusbar/sb-internet +++ b/ar/.local/bin/statusbar/sb-internet @@ -2,12 +2,48 @@ # Show wifi π and percent strength or π‘ if none. # Show π if connected to ethernet or β if none. -# Show π°οΈ if a vpn connection is active +# Show π° if a vpn connection is active + +eth_con="$(nmcli -t -f NAME,TYPE,DEVICE connection show | + awk -F: '$2=="ethernet" && $3!="" { print $1; exit }')" + +wifi_con="$(nmcli -t -f NAME,TYPE connection show | + awk -F: '$2=="wifi" { print $1; exit }')" + +if [ -n "$eth_con" ]; then + nmcli connection modify "$eth_con" ipv4.method auto + nmcli connection modify "$eth_con" ipv4.never-default no + nmcli connection modify "$eth_con" ipv4.dns-priority -42 + nmcli connection modify "$eth_con" ipv4.route-metric 100 + nmcli connection modify "$eth_con" connection.autoconnect yes +fi + +if [ -n "$wifi_con" ]; then + nmcli connection modify "$wifi_con" ipv4.dns-priority 100 + nmcli connection modify "$wifi_con" ipv4.route-metric 600 +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 | + awk -F: '$2=="wifi" { print $1; exit }')" + + wifi_state="$(nmcli -t -f DEVICE,STATE device | + awk -F: -v dev="$wifi_dev" '$1==dev { print $2 }')" + + if [ "$wifi_state" = "connected" ]; then + nmcli radio wifi off + notify-send "Wi-Fi" "Wi-Fi disconnected" + else + nmcli radio wifi on + notify-send "Wi-Fi" "Wi-Fi connected" + fi + + pkill -RTMIN+6 dwmblocks ;; 3) notify-send "π Internet module" "\- Left click to connect β: wifi disabled @@ -15,23 +51,27 @@ case $BLOCK_BUTTON in π: wifi connection with quality β: no ethernet π: ethernet working -π°οΈ: vpn is active +π°: vpn is active " ;; 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac # Wifi -if grep -q 'up' /sys/class/net/w*/operstate; then - wifiicon="$(awk '/^\s*w/ { print "π" int($3 * 100 / 70) "%" }' /proc/net/wireless)" -elif grep -q 'down' /sys/class/net/w*/operstate; then - grep -q '0x1003' /sys/class/net/w*/flags && wifiicon="π‘" || wifiicon="β" +if grep -q 'up' /sys/class/net/w*/operstate 2>/dev/null; then + if grep -q '^\s*w' /proc/net/wireless; then + wifiicon="$(awk '/^\s*w/ { print "π" int($3 * 100 / 70) "%" }' /proc/net/wireless)" + else + wifiicon="π‘" + fi +elif grep -q 'down' /sys/class/net/w*/operstate 2>/dev/null; then + wifiicon="β" fi # Ethernet grep -q 'up' /sys/class/net/e*/operstate && ethericon="π" || ethericon="β" # TUN -[ -n "$(cat /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-iplocate b/ar/.local/bin/statusbar/sb-iplocate index d84445e..d7a9349 100755 --- a/ar/.local/bin/statusbar/sb-iplocate +++ b/ar/.local/bin/statusbar/sb-iplocate @@ -10,6 +10,6 @@ set -e ifinstalled "geoip" addr="$(geoiplookup "$(curl -sfm 1 ifconfig.me 2>/dev/null)")" name="${addr##*, }" -flag="$(grep "flag: $name" "${XDG_DATA_HOME:-${HOME}/.local/share}/larbs/emoji")" +flag="$(grep "flag: $name" "${XDG_DATA_HOME:-${HOME}/.local/share}/thesiah/chars/emoji")" flag="${flag%% *}" printf "%s %s\\n" "$flag" "$name" diff --git a/ar/.local/bin/statusbar/sb-keyboard b/ar/.local/bin/statusbar/sb-keyboard index 34fa2bc..2257b1b 100755 --- a/ar/.local/bin/statusbar/sb-keyboard +++ b/ar/.local/bin/statusbar/sb-keyboard @@ -3,9 +3,9 @@ # 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) +3) notify-send "β¨ Input Method module" "\- Shows current input method (defalt US) - Left click to switch language (EN/KO) - Middle click to change keyboard" ;; 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; @@ -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 @@ -28,4 +28,4 @@ hangul) lang="KO" ;; *) lang="??" ;; esac -echo "β¨οΈ$lang" +echo "β¨$lang" 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 5b06d29..3c9dd03 100755 --- a/ar/.local/bin/statusbar/sb-memory +++ b/ar/.local/bin/statusbar/sb-memory @@ -10,9 +10,15 @@ case $BLOCK_BUTTON in esac width=$(xrandr | grep "\*" | awk '{print $1}' | sed 's/x[0-9]*//g' | head -n1) +nvme_temp=$(sensors 2>/dev/null | + awk '/Composite:/ {gsub(/[+Β°C]/,"",$2); print $2; exit}') if [ -n "$width" ] && [ "$width" -eq "$width" ] 2>/dev/null; then - [ "$width" -lt 1920 ] && - free --mebi | sed -n '2{p;q}' | awk '{printf ("π%d%%\n", ($3/$2)*100+0.5 )}' || - free --mebi | sed -n '2{p;q}' | awk '{printf ("π%dGB/%dGB", $3/1000+0.5,$2/1000+0.5)}' + 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}' + 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}' + 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-music b/ar/.local/bin/statusbar/sb-music index a71969f..d730116 100755 --- a/ar/.local/bin/statusbar/sb-music +++ b/ar/.local/bin/statusbar/sb-music @@ -61,7 +61,7 @@ case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e ncmpcpp ;; # left click, opens ncmpcpp 2) mpc toggle ;; # middle click, pause/unpause 3) # right click - { [ -n "$(mpc current)" ] && [ -n "$(mpc queued)" ]; } && notify-send "π΅ $(mpc current)" "βοΈ $(mpc queued)" + { [ -n "$(mpc current)" ] && [ -n "$(mpc queued)" ]; } && notify-send "π΅ $(mpc current)" "β $(mpc queued)" notify-send "π΅ Music module" "\- Shows mpd song playing and status - π΅ if playing - βΈ if paused 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-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-repos b/ar/.local/bin/statusbar/sb-repos index 2c259ba..d5acfac 100755 --- a/ar/.local/bin/statusbar/sb-repos +++ b/ar/.local/bin/statusbar/sb-repos @@ -9,7 +9,7 @@ private_repos="$HOME/Private/repos" public_repos="${XDG_PUBLICSHARE_DIR:-${HOME}/Public}/repos" # Icon indicators -dotfiles_icon="βοΈ" +dotfiles_icon="β" suckless_icon="π " private_icon="π " public_icon="π’" diff --git a/ar/.local/bin/statusbar/sb-tasks b/ar/.local/bin/statusbar/sb-tasks index 66be81b..5fc61df 100755 --- a/ar/.local/bin/statusbar/sb-tasks +++ b/ar/.local/bin/statusbar/sb-tasks @@ -67,7 +67,7 @@ $(printf "%b" "$overdue_list")" ;; 2) check_task_sync ;; 3) - notify-send "ποΈ Task Module" "Shows task counts. + notify-send "π Task Module" "Shows task counts. - Left click: Show tasks due soon. - Middle click: Show follow-up tasks." ;; diff --git a/ar/.local/bin/statusbar/sb-torrent b/ar/.local/bin/statusbar/sb-torrent index ec104b4..3e4b729 100755 --- a/ar/.local/bin/statusbar/sb-torrent +++ b/ar/.local/bin/statusbar/sb-torrent @@ -5,7 +5,7 @@ status=$(transmission-remote -l | grep % | s/.*Stopped.*/A π/; s/.*Seeding.*/Z π±/; s/.*100%.*/N β
/; - s/.*Idle.*/B π°οΈ/; + s/.*Idle.*/B π°/; s/.*Uploading.*/L πΌ/; s/.*Downloading.*/M π½/; s/.*%.*/Q β/" | 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 |
