power menu, redshift, polybar

This commit is contained in:
azpsen
2024-01-28 16:37:10 -06:00
parent 89516a6ce1
commit 319b44ecbd
307 changed files with 7642 additions and 5 deletions

View File

@@ -0,0 +1,16 @@
# Script: info-timezone
A custom polybar script to switch the timezone of the date displayed.
![info-timezone](screenshots/1.gif)
## Module
```ini
[module/info-timezone]
type = custom/script
exec = ~/polybar-scripts/info-timezone.sh
tail = true
click-left = kill -USR1 %pid%
```

View File

@@ -0,0 +1,35 @@
#!/bin/sh
# Change format here. see `man date` for format controls.
FORMAT="%I:%M %p"
# Add the timezones of your choice. see `timedatectl list-timezones`.
set -- "UTC-0" "Australia/Sydney" "Asia/Kolkata" "America/Chicago"
TIMEZONES_LENGTH=$#
current_idx=1
print_date() {
TZ=${current_timezone:?} date +"${FORMAT}" | echo "${current_timezone:?}: $(cat -)"
}
update_current_timezone() {
current_idx=$(($((current_idx+1)) % $(("$TIMEZONES_LENGTH"+1))))
if [ $current_idx -lt 1 ]; then
current_idx=1
fi
}
click() {
update_current_timezone
print_date
}
trap "click" USR1
while true; do
eval "current_timezone=\${$current_idx}"
print_date current_timezone
sleep 5 &
wait
done

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB