-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c0fb33
commit 46c1bfc
Showing
14 changed files
with
129 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,35 @@ | ||
#!/bin/sh | ||
# display current brightness | ||
# Display current brightness | ||
|
||
# get first two digits of brightness value | ||
brightnum=$(xbacklight -get) | ||
[[ "$brightnum" = "" ]] && echo "🚱" exit 1 | ||
brightness=$(printf "${brightnum%.*}") | ||
# current brightness | ||
curr_brightness=$(cat /sys/class/backlight/*/brightness) | ||
|
||
if [[ "$brightness" -gt "70" ]]; then | ||
echo "🌞$brightness" | ||
elif [[ "$brightness" -le "10" ]]; then | ||
echo "🌑$brightness" | ||
elif [[ "$brightness" -lt "30" ]]; then | ||
echo "🌦$brightness" | ||
# max_brightness | ||
max_brightness=$(cat /sys/class/backlight/*/max_brightness) | ||
|
||
# brightness percentage | ||
brightness_per=$((100 * curr_brightness / max_brightness)) | ||
|
||
case $BLOCK_BUTTON in | ||
1) | ||
;; | ||
3) | ||
notify-send "💡 Brightness module" "\- Shows current brightness level ☀️." | ||
;; | ||
6) | ||
setsid -f "$TERMINAL" -e "$EDITOR" "$0" | ||
;; | ||
esac | ||
|
||
# Assign emoji based on brightness | ||
if [[ $brightness_per -ge 70 ]]; then | ||
bright_icon="🌞" | ||
elif [[ $brightness_per -ge 40 && $brightness_per -lt 70 ]]; then | ||
bright_icon="🌤️" | ||
elif [[ $brightness_per -ge 15 && $brightness_per -lt 40 ]]; then | ||
bright_icon="⛅" | ||
else | ||
echo "⛅$brightness" | ||
bright_icon="🌙" | ||
fi | ||
|
||
echo "${bright_icon} ${brightness_per}%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#!/bin/sh | ||
# show if caps lock is on or off | ||
# Show caps lock status | ||
|
||
# caps lock status | ||
# Get caps lock status | ||
capslock=$(xset q | grep "Caps Lock:" | awk '{print $4}') | ||
|
||
case $BLOCK_BUTTON in | ||
1) | ||
1) | ||
pkill -RTMIN+26 "${STATUSBAR:-dwmblocks}";; | ||
3) notify-send "Caps Lock indicator" "Caps Lock is currently $capslock" ;; | ||
6) "$TERMINAL" -e "$EDITOR" "$0" ;; | ||
esac | ||
|
||
printf "🔒$capslock" | ||
printf "🔒 $capslock" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#!/bin/bash | ||
# get fan speed | ||
# Get ThinkPad fan speed | ||
|
||
speed=$(cat /proc/acpi/ibm/fan | grep level | head -n 1 | awk '{print $2}') | ||
# Get fan speed | ||
speed=$(cat /proc/acpi/ibm/fan | awk '/level:/ {print $2}') | ||
|
||
printf "💨" | ||
icon="💨" | ||
|
||
if [ "$speed" = "auto" ]; then | ||
printf " a" | ||
else if [ "$speed" = "disengaged" ]; then | ||
printf " max" | ||
else | ||
printf " $speed" | ||
fi | ||
fi | ||
case $speed in | ||
"auto") tspeed="auto" ;; | ||
"disengaged") tspeed="max" ;; | ||
*) tspeed="$speed" ;; | ||
esac | ||
|
||
echo "$icon $tspeed" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
#!/bin/sh | ||
|
||
# Show wifi 📶 and percent strength or 📡 if none. | ||
# Show 🌐 if connected to ethernet or ❎ if none. | ||
# Show 🔒 if a vpn connection is active | ||
|
||
case $BLOCK_BUTTON in | ||
1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;; | ||
3) notify-send "🌐 Internet module" "\- Click to connect | ||
❌: wifi disabled | ||
📡: no wifi connection | ||
📶: wifi connection with quality | ||
❎: no ethernet | ||
🌐: ethernet working | ||
🔒: vpn is active | ||
" ;; | ||
6) "$TERMINAL" -e "$EDITOR" "$0" ;; | ||
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; | ||
esac | ||
|
||
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in | ||
down) wifiicon="📡 " ;; | ||
# up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" wifiname=$(iw dev wlp3s0 info | grep ssid | awk '{print $2}');; | ||
up) wifiicon="$(awk '/^\s*w/ { print "📶 " }' /proc/net/wireless)" wifiname=$(iw dev wlp3s0 info | grep ssid | awk '{print $2}');; | ||
esac | ||
# Wifi | ||
if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then | ||
# Chanhe | ||
wifiname="📶 $(iw dev | awk '/ssid/ {print $2}')" | ||
wifiicon="$wifiname $(awk '/^\s*w/ { print int($3 * 100 / 70) "% " }' /proc/net/wireless)" | ||
elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then | ||
[ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="📡 " || wifiicon="❌ " | ||
fi | ||
|
||
# Ethernet | ||
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐 " || ethericon="❎ " | ||
|
||
# TUN | ||
[ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" 🔒" | ||
|
||
printf "%s%s%s\n" "$wifiicon" "$wifiname " "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)" | ||
printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.