updates to tiling

This commit is contained in:
Sean Kovacs 2025-12-13 12:09:17 -05:00
commit 7c4101d064
Signed by: sckova
GPG key ID: 00F325187C68651A
8 changed files with 122 additions and 13 deletions

View file

@ -179,7 +179,7 @@ layout {
// off // off
width 1 width 1
active-color "#6c7086" active-color "#fab387"
// active-gradient from="#fab387" to="#89b4fa" angle=90 // active-gradient from="#fab387" to="#89b4fa" angle=90
inactive-color "#313244" inactive-color "#313244"
// inactive-gradient from="#313244" to="#6c7086" angle=90 // inactive-gradient from="#313244" to="#6c7086" angle=90
@ -252,6 +252,10 @@ layout {
// This line starts waybar, a commonly used bar for Wayland compositors. // This line starts waybar, a commonly used bar for Wayland compositors.
spawn-at-startup "waybar" spawn-at-startup "waybar"
// run tailscale system tray
spawn-at-startup "sudo tailscale set --operator=$USER"
spawn-at-startup "tailscale systray"
// Instead let's start quickshell, which is similar but made with Qt/QML // Instead let's start quickshell, which is similar but made with Qt/QML
// spawn-at-startup "quickshell" // spawn-at-startup "quickshell"
@ -374,8 +378,8 @@ binds {
// Example brightness key mappings for brightnessctl. // Example brightness key mappings for brightnessctl.
// You can use regular spawn with multiple arguments too (to avoid going through "sh"), // You can use regular spawn with multiple arguments too (to avoid going through "sh"),
// but you need to manually put each argument in separate "" quotes. // but you need to manually put each argument in separate "" quotes.
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; } XF86MonBrightnessUp allow-when-locked=true { spawn "/home/sckova/.config/niri/scripts/brightness.sh" "5"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; } XF86MonBrightnessDown allow-when-locked=true { spawn "/home/sckova/.config/niri/scripts/brightness.sh" "-5"; }
// Open/close the Overview: a zoomed-out view of workspaces and windows. // Open/close the Overview: a zoomed-out view of workspaces and windows.
// You can also move the mouse into the top-left hot corner, // You can also move the mouse into the top-left hot corner,

View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
WAYBAR_SIGNAL=8 # SIGRTMIN+8
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <integer -100..100>" >&2
exit 1
fi
value="$1"
# Validate integer range
if ! [[ "$value" =~ ^-?[0-9]+$ ]] || [ "$value" -lt -100 ] || [ "$value" -gt 100 ]; then
echo "Error: argument must be an integer between -100 and 100" >&2
exit 1
fi
# Apply brightness change with correct syntax
if [ "$value" -gt 0 ]; then
brightnessctl s "+${value}%" >/dev/null
elif [ "$value" -lt 0 ]; then
brightnessctl s "${value#-}%-" >/dev/null
else
: # no-op for 0
fi
# Notify Waybar to refresh
pkill -RTMIN+"$WAYBAR_SIGNAL" waybar

View file

@ -8,24 +8,24 @@
"margin-bottom": 0, "margin-bottom": 0,
"margin-left": 0, "margin-left": 0,
"modules-left": ["sway/workspaces"], "modules-left": ["custom/niri-window"],
"modules-center": [], "modules-center": [],
"modules-right": [ "modules-right": [
"tray", "tray",
"cpu_text",
"cpu", "cpu",
"memory", "memory",
"battery", "battery",
"network", "network",
"custom/brightness",
"pulseaudio", "pulseaudio",
"custom/clock", "custom/clock",
], ],
"sway/workspaces": { "custom/niri-window": {
"disable-scroll": true, "exec": "/home/sckova/.config/waybar/scripts/niri-window.sh",
"all-outputs": true, "restart-interval": 1,
"tooltip": false, "tooltip": false,
}, },
@ -75,6 +75,13 @@
"tooltip": false, "tooltip": false,
}, },
"custom/brightness": {
"exec": "/home/sckova/.config/waybar/scripts/brightness.sh",
"restart-interval": 10,
"signal": 8,
"tooltip": false,
},
"pulseaudio": { "pulseaudio": {
"scroll-step": 5, "scroll-step": 5,
"max-volume": 150, "max-volume": 150,

View 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}%"

View file

@ -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"

View 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

View file

@ -4,14 +4,16 @@
border-radius: 0; border-radius: 0;
min-height: 0; min-height: 0;
font-family: "Noto Sans"; font-family: "Noto Sans";
/*font-weight: bold;*/
font-size: 12px; font-size: 12px;
padding: 0; padding: 0;
} }
window#waybar { window#waybar {
background: transparent; background: black;
border-bottom-color: @mantle; border: 2px solid @base;
border-top-width: 0px;
border-left-width: 0px;
border-right-width: 0px;
} }
tooltip { tooltip {
@ -19,12 +21,14 @@ tooltip {
border-color: @peach; border-color: @peach;
} }
#custom-niri-window,
#custom-clock, #custom-clock,
#tray, #tray,
#cpu, #cpu,
#memory, #memory,
#battery, #battery,
#network, #network,
#custom-brightness,
#pulseaudio { #pulseaudio {
background-color: @base; background-color: @base;
color: @text; color: @text;
@ -56,6 +60,11 @@ tooltip {
color: #1d2021; color: #1d2021;
} }
#custom-niri-window {
margin-left: 6px;
border-color: @yellow;
}
#cpu { #cpu {
border-color: @maroon; border-color: @maroon;
} }
@ -72,6 +81,10 @@ tooltip {
border-color: @teal; border-color: @teal;
} }
#custom-brightness {
border-color: @sky;
}
#pulseaudio { #pulseaudio {
border-color: @blue; border-color: @blue;
} }

View file

@ -105,7 +105,10 @@
enable = true; enable = true;
}; };
programs.niri.enable = true; programs.niri = {
enable = true;
useNautilus = false;
};
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;
security.pam.services.niri.enableGnomeKeyring = true; security.pam.services.niri.enableGnomeKeyring = true;