updates to tiling
This commit is contained in:
parent
8a7dd224f9
commit
53973bbfb1
8 changed files with 122 additions and 13 deletions
16
home/tiling/waybar/config/scripts/brightness.sh
Executable file
16
home/tiling/waybar/config/scripts/brightness.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
MAX=500
|
||||
|
||||
current=$(brightnessctl g)
|
||||
|
||||
# Guard against empty or non-numeric output
|
||||
if ! [[ "$current" =~ ^[0-9]+$ ]]; then
|
||||
echo "brightnessctl returned invalid value" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
percentage=$(( current * 100 / MAX ))
|
||||
|
||||
echo "bright ${percentage}%"
|
||||
|
||||
|
|
@ -1 +1,13 @@
|
|||
date +"%a, %b %d @ %I:%M%P"
|
||||
#!/usr/bin/env bash
|
||||
|
||||
day=$(date +%-d)
|
||||
|
||||
case "$day" in
|
||||
11|12|13) suffix="th" ;;
|
||||
*1) suffix="st" ;;
|
||||
*2) suffix="nd" ;;
|
||||
*3) suffix="rd" ;;
|
||||
*) suffix="th" ;;
|
||||
esac
|
||||
|
||||
date +"%a, %b $day$suffix %Y @ %I:%M%P"
|
||||
|
|
|
|||
25
home/tiling/waybar/config/scripts/niri-window.sh
Executable file
25
home/tiling/waybar/config/scripts/niri-window.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
last=""
|
||||
|
||||
while :; do
|
||||
current=$(
|
||||
niri msg focused-window | awk -F'"' '
|
||||
/App ID:/ { app = $2 }
|
||||
/Title:/ { title = $2 }
|
||||
END {
|
||||
if (app && title) {
|
||||
print app " - " title
|
||||
}
|
||||
}
|
||||
'
|
||||
)
|
||||
|
||||
if [[ -n "$current" && "$current" != "$last" ]]; then
|
||||
printf '%s\n' "$current"
|
||||
last="$current"
|
||||
fi
|
||||
|
||||
sleep 0.01
|
||||
done
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue