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-timew
This script displays the daily tracked time. You can click it, to start tracking, using timew.
You can use the `--weekday` toggle, to view daily or weekly time spend. (may take the `interval` time to update)
## Module
```ini
[module/info-timew]
type = custom/script
exec = ~/polybar-scripts/info-timew.sh
interval = 10
click-left = ~/polybar-scripts/info-timew.sh --toggle
click-right = ~/polybar-scripts/info-timew.sh --weekday
```

View File

@@ -0,0 +1,40 @@
#!/bin/sh
MODE_FILE="$HOME/.config/polybar/info-timew.mode"
if [ ! -f "${MODE_FILE}" ]; then
touch "${MODE_FILE}"
echo "d" > "${MODE_FILE}"
fi
ACTUAL_MODE=$(cat "${MODE_FILE}")
if timew > /dev/null 2>&1; then
if [ "$ACTUAL_MODE" = "w" ]; then
printf '%s/week' "$(timew summary :week | awk '{print $NF}' | tail -2 | head -1)"
else
printf '%s/day' "$(timew summary :day | awk '{print $NF}' | tail -2 | head -1)"
fi
else
printf "no tracking"
fi
if [ "${1}" = "--weekday" ]; then
if [ "$ACTUAL_MODE" = "w" ]; then
echo "d" > "${MODE_FILE}"
else
echo "w" > "${MODE_FILE}"
fi
fi
if [ "${1}" = "--toggle" ]; then
if timew; then
timew stop;
else
timew start;
fi
fi