summaryrefslogtreecommitdiff
path: root/ar/.local/bin/statusbar
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.local/bin/statusbar')
-rwxr-xr-xar/.local/bin/statusbar/sb-battery4
-rwxr-xr-xar/.local/bin/statusbar/sb-bghitness2
-rwxr-xr-xar/.local/bin/statusbar/sb-brightness28
-rwxr-xr-xar/.local/bin/statusbar/sb-clock2
-rwxr-xr-xar/.local/bin/statusbar/sb-cpu2
-rwxr-xr-xar/.local/bin/statusbar/sb-forecast8
-rwxr-xr-xar/.local/bin/statusbar/sb-internet56
-rwxr-xr-xar/.local/bin/statusbar/sb-iplocate2
-rwxr-xr-xar/.local/bin/statusbar/sb-keyboard8
-rwxr-xr-xar/.local/bin/statusbar/sb-mailbox2
-rwxr-xr-xar/.local/bin/statusbar/sb-memory12
-rwxr-xr-xar/.local/bin/statusbar/sb-mpdup2
-rwxr-xr-xar/.local/bin/statusbar/sb-music2
-rwxr-xr-xar/.local/bin/statusbar/sb-packages2
-rwxr-xr-xar/.local/bin/statusbar/sb-popupgrade2
-rwxr-xr-xar/.local/bin/statusbar/sb-queues2
-rwxr-xr-xar/.local/bin/statusbar/sb-repos2
-rwxr-xr-xar/.local/bin/statusbar/sb-tasks2
-rwxr-xr-xar/.local/bin/statusbar/sb-torrent2
-rwxr-xr-xar/.local/bin/statusbar/sb-volume2
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