updates to tiling
This commit is contained in:
parent
0680b63126
commit
7c4101d064
8 changed files with 122 additions and 13 deletions
|
|
@ -179,7 +179,7 @@ layout {
|
|||
// off
|
||||
|
||||
width 1
|
||||
active-color "#6c7086"
|
||||
active-color "#fab387"
|
||||
// active-gradient from="#fab387" to="#89b4fa" angle=90
|
||||
inactive-color "#313244"
|
||||
// inactive-gradient from="#313244" to="#6c7086" angle=90
|
||||
|
|
@ -252,6 +252,10 @@ layout {
|
|||
// This line starts waybar, a commonly used bar for Wayland compositors.
|
||||
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
|
||||
// spawn-at-startup "quickshell"
|
||||
|
||||
|
|
@ -374,8 +378,8 @@ binds {
|
|||
// Example brightness key mappings for brightnessctl.
|
||||
// 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.
|
||||
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; }
|
||||
XF86MonBrightnessDown 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 "/home/sckova/.config/niri/scripts/brightness.sh" "-5"; }
|
||||
|
||||
// Open/close the Overview: a zoomed-out view of workspaces and windows.
|
||||
// You can also move the mouse into the top-left hot corner,
|
||||
|
|
|
|||
29
home/tiling/niri/config/scripts/brightness.sh
Executable file
29
home/tiling/niri/config/scripts/brightness.sh
Executable 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
|
||||
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,10 @@
|
|||
enable = true;
|
||||
};
|
||||
|
||||
programs.niri.enable = true;
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
useNautilus = false;
|
||||
};
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
security.pam.services.niri.enableGnomeKeyring = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue