updates to tiling
This commit is contained in:
parent
0680b63126
commit
7c4101d064
8 changed files with 122 additions and 13 deletions
|
|
@ -8,24 +8,24 @@
|
|||
"margin-bottom": 0,
|
||||
"margin-left": 0,
|
||||
|
||||
"modules-left": ["sway/workspaces"],
|
||||
"modules-left": ["custom/niri-window"],
|
||||
|
||||
"modules-center": [],
|
||||
|
||||
"modules-right": [
|
||||
"tray",
|
||||
"cpu_text",
|
||||
"cpu",
|
||||
"memory",
|
||||
"battery",
|
||||
"network",
|
||||
"custom/brightness",
|
||||
"pulseaudio",
|
||||
"custom/clock",
|
||||
],
|
||||
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true,
|
||||
"all-outputs": true,
|
||||
"custom/niri-window": {
|
||||
"exec": "/home/sckova/.config/waybar/scripts/niri-window.sh",
|
||||
"restart-interval": 1,
|
||||
"tooltip": false,
|
||||
},
|
||||
|
||||
|
|
@ -75,6 +75,13 @@
|
|||
"tooltip": false,
|
||||
},
|
||||
|
||||
"custom/brightness": {
|
||||
"exec": "/home/sckova/.config/waybar/scripts/brightness.sh",
|
||||
"restart-interval": 10,
|
||||
"signal": 8,
|
||||
"tooltip": false,
|
||||
},
|
||||
|
||||
"pulseaudio": {
|
||||
"scroll-step": 5,
|
||||
"max-volume": 150,
|
||||
|
|
|
|||
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
|
||||
|
||||
|
|
@ -4,14 +4,16 @@
|
|||
border-radius: 0;
|
||||
min-height: 0;
|
||||
font-family: "Noto Sans";
|
||||
/*font-weight: bold;*/
|
||||
font-size: 12px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: transparent;
|
||||
border-bottom-color: @mantle;
|
||||
background: black;
|
||||
border: 2px solid @base;
|
||||
border-top-width: 0px;
|
||||
border-left-width: 0px;
|
||||
border-right-width: 0px;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
|
|
@ -19,12 +21,14 @@ tooltip {
|
|||
border-color: @peach;
|
||||
}
|
||||
|
||||
#custom-niri-window,
|
||||
#custom-clock,
|
||||
#tray,
|
||||
#cpu,
|
||||
#memory,
|
||||
#battery,
|
||||
#network,
|
||||
#custom-brightness,
|
||||
#pulseaudio {
|
||||
background-color: @base;
|
||||
color: @text;
|
||||
|
|
@ -56,6 +60,11 @@ tooltip {
|
|||
color: #1d2021;
|
||||
}
|
||||
|
||||
#custom-niri-window {
|
||||
margin-left: 6px;
|
||||
border-color: @yellow;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
border-color: @maroon;
|
||||
}
|
||||
|
|
@ -72,6 +81,10 @@ tooltip {
|
|||
border-color: @teal;
|
||||
}
|
||||
|
||||
#custom-brightness {
|
||||
border-color: @sky;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
border-color: @blue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue