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,30 @@
# Script: system-eprivacy
A small script to manage the ePrivacy state for ThinkPads.
![system-eprivacy](screenshots/1.png)
## Dependencies
* `inotify-tools`
## Configuration
You have to add the `/usr/bin/tee /proc/acpi/ibm/lcdshadow` command to the `/etc/sudoers` NOPASSWD of your user:
```
user ALL = NOPASSWD: /usr/bin/tee /proc/acpi/ibm/lcdshadow
```
## Module
```ini
[module/system-eprivacy]
type = custom/script
exec = ~/polybar-scripts/system-eprivacy.sh
tail = true
click-left = ~/polybar-scripts/system-eprivacy.sh --toggle &
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,39 @@
#!/bin/sh
# shellcheck disable=SC2034
eprivacy_status () {
grep status /proc/acpi/ibm/lcdshadow | awk '{ print $2 }'
}
eprivacy_print () {
if [ "$(eprivacy_status)" = 0 ]; then
echo "#1"
else
echo "#2"
fi
}
eprivacy_watch () {
eprivacy_print
inotifywait -q -m -e modify /proc/acpi/ibm/lcdshadow | while read -r "event" ; do
eprivacy_print
done
}
eprivacy_toggle () {
if [ "$(eprivacy_status)" = 0 ]; then
echo 1 | sudo tee /proc/acpi/ibm/lcdshadow > /dev/null
else
echo 0 | sudo tee /proc/acpi/ibm/lcdshadow > /dev/null
fi
}
case "$1" in
--toggle)
eprivacy_toggle
;;
*)
eprivacy_watch
;;
esac