build status notifications for volume and brightness

This commit is contained in:
Never Gude 2026-03-15 20:20:28 +01:00
parent 41aaa02156
commit 78dce1ecfa
11 changed files with 188 additions and 93 deletions

View file

@ -0,0 +1 @@
50-user.conf

View file

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>serif</family>
<prefer><family>Caladea</family></prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer><family>Adwaita Sans</family></prefer>
</alias>
<alias>
<family>monospace</family>
<prefer><family>Adwaita Mono</family></prefer>
</alias>
</fontconfig>

View file

@ -1,5 +1,5 @@
# output=<not set>
font=Adwaita Mono
font=monospace
# dpi-aware=auto
# use-bold=no
prompt=""
@ -50,18 +50,18 @@ inner-pad=4
# enable-mouse=yes
[colors]
background=191919E5
background=191919ff
text=ffffffff
message=999999ff
message=7f7f7fff
prompt=999999ff
placeholder=505050ff
input=ffffffff
match=7fc8ffff
selection=7f7f7f7f
selection=505050ff
selection-text=ffffffff
selection-match=7fc8ffff
counter=999999ff
border=7f7f7fE5
border=999999ff
[border]
width=2

View file

@ -1,4 +1,4 @@
font=Adwaita Sans 10
font=sans-serif
default-timeout=5000
@ -7,6 +7,22 @@ anchor=top-center
margin=12
padding=8
background-color=#191919E5
border-color=#505050
progress-color=source #909090E5
background-color=#505050E5
border-color=#999999
progress-color=source #7f7f7fE5
[urgency=low]
border-color=#7f7f7f
[urgency=high]
border-color=#9b0000
default-timeout=0
[category=status]
anchor=center
group-by=category
history=0
format=<b>%s</b>\n%b
default-timeout=1000
# vim: ft=conf

View file

@ -344,9 +344,15 @@ window-rule {
match app-id=r#"ipe$"# title="^Ipe: waiting$"
open-floating true
}
window-rule {
match is-floating=true
baba-is-float true
}
// Example: block out two password managers from screen capture.
// (This example rule is commented out with a "/-" in front.)
/-window-rule {
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
@ -394,9 +400,9 @@ binds {
// Example volume keys mappings for PipeWire & WirePlumber.
// The allow-when-locked=true property makes them work even when the session is locked.
// Using spawn-sh allows to pass multiple arguments together with the command.
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; }
XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 0.05+ && volumenotify.fish"; }
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 0.05- && volumenotify.fish"; }
XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && volumenotify.fish"; }
XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }
XF86AudioPlay allow-when-locked=true { spawn-sh "mpc toggle"; }
@ -405,8 +411,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-sh "brightnessctl --class=backlight set +5% && brightnessnotify.fish"; }
XF86MonBrightnessDown allow-when-locked=true { spawn-sh "brightnessctl --class=backlight set 5%- && brightnessnotify.fish"; }
// Open/close the Overview: a zoomed-out view of workspaces and windows.
// You can also move the mouse into the top-left hot corner,

View file

@ -1,85 +1,107 @@
{
"layer": "top",
"modules-left": ["niri/workspaces"],
"modules-center": ["niri/window"],
"modules-right": ["bluetooth", "network", "wireplumber#source", "wireplumber#sink", "battery", "clock"],
"layer": "top",
"modules-left": ["niri/workspaces"],
"modules-center": ["niri/window"],
"modules-right": ["bluetooth", "network", "wireplumber#source", "wireplumber#sink", "battery", "clock"],
"inhibitor": {
"what": "handle-lid-switch",
"format": "{icon}",
"format-icons": {
"activated": "󰅶",
"deactivated": "󰾪"
},
"tooltip": false
},
"inhibitor": {
"what": "handle-lid-switch",
"format": "{icon}",
"format-icons": {
"activated": "󰅶",
"deactivated": "󰾪"
},
"tooltip": false
},
"niri/window": {
"max-length": 100
},
"niri/window": {
"max-length": 100
},
"bluetooth": {
// "controller": "controller1", // specify the alias of the controller if there are more than 1 on the system
"format": "",
"format-disabled": "󰂲", // an empty format will hide the module
"format-connected": "󰂯",
"tooltip-format": "{controller_alias}\t{controller_address}",
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{device_enumerate}",
"tooltip-format-enumerate-connected": "{device_alias}\t{device_address}"
},
"bluetooth": {
// "controller": "controller1", // specify the alias of the controller if there are more than 1 on the system
"format": "",
"format-disabled": "󰂲", // an empty format will hide the module
"format-connected": "󰂯",
"tooltip-format": "{controller_alias}\t{controller_address}",
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{device_enumerate}",
"tooltip-format-enumerate-connected": "{device_alias}\t{device_address}"
},
"network": {
"interface": "wlp2s0",
"format": "{ifname}",
"format-icons": ["󰤟", "󰤢", "󰤥", "󰤨"],
"format-wifi": "{icon}",
"format-ethernet": "󰈁",
"format-disconnected": "", //An empty format will hide the module.
"tooltip-format": "{ifname}",
"tooltip-format-wifi": "󰖩 {essid} ({signalStrength}%)",
"tooltip-format-ethernet": "󰈁 {ifname}",
"tooltip-format-disconnected": "Disconnected"
},
"network": {
"interface": "wlp2s0",
"format": "{ifname}",
"format-icons": ["󰤟", "󰤢", "󰤥", "󰤨"],
"format-wifi": "{icon}",
"format-ethernet": "󰈁",
"format-disconnected": "", //An empty format will hide the module.
"tooltip-format": "{ifname}",
"tooltip-format-wifi": "󰖩 {essid} ({signalStrength}%)",
"tooltip-format-ethernet": "󰈁 {ifname}",
"tooltip-format-disconnected": "Disconnected"
},
"wireplumber#sink": {
"format": "{icon}",
"format-muted": "󰖁",
"format-icons": ["󰕿", "󰖀", "󰕾"],
"tooltip-format": "{node_name} ({volume}%)",
"on-click-right": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
"scroll-step": 5
},
"wireplumber#sink": {
"format": "{icon}",
"format-muted": "󰖁",
"format-icons": ["󰕿", "󰖀", "󰕾"],
"tooltip-format": "{node_name} ({volume}%)",
"on-click-right": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
"scroll-step": 5
},
"wireplumber#source": {
"node-type": "Audio/Source",
"format": "󰍬",
"format-muted": "󰍭",
"tooltip-format": "{node_name} ({volume}%)",
"on-click-right": "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle",
"scroll-step": 5
},
"wireplumber#source": {
"node-type": "Audio/Source",
"format": "󰍬",
"format-muted": "󰍭",
"tooltip-format": "{node_name} ({volume}%)",
"on-click-right": "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle",
"scroll-step": 5
},
"battery": {
"interval": 60,
"states": {
"warning": 30,
"critical": 15
},
"events": {
"on-discharging-warning": "notify-send -u normal 'Low Battery'",
"on-discharging-critical": "notify-send -u critical 'Very Low Battery'"
},
"format": "{icon}",
"format-icons": ["󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"],
"format-charging": "󰂄",
"tooltip-format": "{time} ({capacity}%)"
},
"battery": {
"interval": 60,
"states": {
"warning": 30,
"critical": 15
},
"events": {
"on-discharging-warning": "notify-send -u normal 'Low Battery'",
"on-discharging-critical": "notify-send -u critical 'Very Low Battery'"
},
"format": "{icon}",
"format-icons": ["󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"],
"format-charging": "󰂄",
"tooltip-format": "Battery ({capacity}%)\n{power}W {time}"
},
"clock": {
"format-alt": "{:%a, %d. %b %H:%M}",
"tooltip": false
}
"clock": {
"format": "{:%H:%M}",
"format-alt": "{:%A, %B %d, %Y (%R)}",
"tooltip-format": "<tt><small>{calendar}</small></tt>",
"calendar": {
"mode" : "year",
"mode-mon-col" : 3,
"weeks-pos" : "right",
"on-scroll" : 1,
"on-click-right": "mode",
"format": {
"months": "<span color='#ffffff'><b>{}</b></span>",
"days": "<span color='#999999'>{}</span>",
"weeks": "<span color='#505050'>W{}</span>",
"weekdays": "<span color='#7f7f7f'>{}</span>",
"today": "<span color='#7fc8ff'><b>{}</b></span>"
}
},
"actions": {
"on-click-right": "mode",
"on-click-forward": "tz_up",
"on-click-backward": "tz_down",
"on-scroll-up": "shift_up",
"on-scroll-down": "shift_down"
}
}
}

View file

@ -8,7 +8,7 @@
tooltip {
font-weight: normal;
background: rgba(25, 25, 25, 0.9);
border: solid 2px #505050;
border: solid 2px rgba(80, 80, 80, 0.9);
border-radius: 0px;
}

View file

@ -1,5 +1,6 @@
#!/usr/bin/env fish
# Select folders in current semester
function open_semester
set recent "/home/never/Documents/InNa/25_WiSe/"
set options (ls $recent)
@ -8,6 +9,7 @@ function open_semester
alacritty --working-directory $recent/$input
end
# Open user directories
function open_location
set options "25_WiSe" "󰈙 Documents" "󰝚 Music" "󰋩 Pictures" "󰕧 Videos" "󰇚 Downloads"
set input (menu $options)
@ -28,6 +30,7 @@ function open_location
end
end
# Open WueCampus Courses
function open_course
set options "Algorithmen und Datenstrukturen" "Modellbildung und Simulation" "Amateurfunkkurs" "Datenbanken"
set input (menu $options)
@ -44,6 +47,7 @@ function open_course
end
end
# Select the default audio source
function audio_source
set dump (string trim -c '"' (pw-dump | jq '.[] | select(.info.props."media.class" == "Audio/Source")' | jq '.id, .info.props."node.description"'))
@ -63,6 +67,7 @@ function audio_source
wpctl set-default $ids[$input]
end
# Select the default audio sink
function audio_sink
set dump (string trim -c '"' (pw-dump | jq '.[] | select(.info.props."media.class" == "Audio/Sink")' | jq '.id, .info.props."node.description"'))
@ -82,6 +87,7 @@ function audio_sink
wpctl set-default $ids[$input]
end
# Select the network connection profile
function network_connection
set options (nmcli --terse --fields name connection show)
set input (menu $options || exit)
@ -89,6 +95,7 @@ function network_connection
notify-send "Connect to network $input" (nmcli connection up $input)
end
# Select a paired bluetooth connection
function bluetooth_connection
set dump (bluetoothctl devices | string replace "Device " "" | string split -m 1 " ")
@ -108,18 +115,23 @@ function bluetooth_connection
notify-send "Connect to bluetooth device $names[$input]" (bluetoothctl connect $ids[$input] | string collect)
end
# Select the system color scheme preference
function color_scheme
set options "Light" "Dark"
set input (menu $options)
switch $input
case $options[1]
niri msg action do-screen-transition
dconf write /org/gnome/desktop/interface/color-scheme \'prefer-light\'
case $options[2]
niri msg action do-screen-transition
dconf write /org/gnome/desktop/interface/color-scheme \'prefer-dark\'
end
end
# Select sub menu
set options "󱂵 Open Location" "󰑴 Open WueCampus Course" "󰍬 Select Audio Source" "󰕾 Select Audio Sink" "󰂯 Select Bluetooth" "󰛳 Select Network" "󰔎 Color Scheme"
set input (menu $options)

View file

@ -0,0 +1,8 @@
#!/usr/bin/env fish
set brightness (brightnessctl --class=backlight get)
set max_brightness (brightnessctl --class=backlight max)
set brightness (math --scale 0 --scale-mode round "($brightness / $max_brightness) * 100")
notify-send -c 'status' -h int:value:$brightness "Brightness: $brightness%"

View file

@ -0,0 +1,7 @@
#!/usr/bin/env fish
set volume (string match -r '[0-9]+.[0-9]+' (wpctl get-volume @DEFAULT_AUDIO_SINK@))
set volume (math --scale 0 --scale-mode round "$volume * 100")
notify-send -c 'status' -h int:value:$volume "Volume: $volume%"

View file

@ -22,7 +22,7 @@ stow ./
Install necessary software.
```sh
sudo dnf install fish niri waybar fuzzel mako swaylock swaybg swayidle alacritty
sudo dnf install fish niri brightnessctl waybar fuzzel mako swaylock swaybg swayidle alacritty
```
Change the shell to `fish`.
@ -51,6 +51,13 @@ Install the packages.
sudo dnf install qt6-qtbase-devel qt6-qtbase-static qt6-qt3d-devel harfbuzz-devel qt6-qtsvg-devel qt6-qtspeech-devel
```
### LuaKit
Build the develop branch of [Luakit](https://github.com/luakit/luakit).
Install the packages.
```sh
sudo dnf install gtk3-devel webkit2gtk4.1-devel sqlite3pp-devel luajit-devel lua5.1-filesystem
```
### mpd
Install mpd.
```sh