notification configured

This commit is contained in:
Semere Meharena Mebrahtom 2026-07-19 22:17:48 +02:00
parent 6f3c035316
commit e9bdc40a28
Signed by: semere
GPG key ID: 7FC937214DF30488
6 changed files with 106 additions and 29 deletions

View file

@ -26,6 +26,8 @@ allModules
self.nixosModules.helix
self.nixosModules.zen-browser
self.nixosModules.niri
self.nixosModules.osd
self.nixosModules.fnott
self.nixosModules.greetd
];
};

View file

@ -61,6 +61,7 @@
brightnessctl
wl-clipboard
fuzzel
libnotify
fnott
foot
tor-browser
@ -150,20 +151,6 @@
};
};
services.fnott = {
enable = true;
settings = {
main = {
font = "JetBrainsMono Nerd Font:size=11";
background = "1a1a24e0";
border-color = "b085f5ff";
border-size = 2;
padding-vertical = 12;
padding-horizontal = 16;
summary-color = "ffffffff";
body-color = "e0e0e0ff";
};
};
};
};
}

32
modules/fnott.nix Normal file
View file

@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
userVars,
...
}:
{
home-manager.users."${userVars.username}" = {
services.fnott = {
enable = true;
settings = {
main = {
title-font = "JetBrainsMono Nerd Font:size=11";
summary-font = "JetBrainsMono Nerd Font:size=11";
body-font = "JetBrainsMono Nerd Font:size=11";
background = "1a1a24e0";
border-color = "b085f5ff";
border-size = 2;
min-width = 450;
progress-bar-height = 14;
progress-color = "b085f5cc";
padding-vertical = 12;
padding-horizontal = 16;
summary-color = "ffffffff";
body-color = "e0e0e0ff";
};
};
};
};
}

View file

@ -79,7 +79,7 @@
};
soft-wrap = {
enable = true;
enable = false;
};
smart-tab = {

View file

@ -59,13 +59,8 @@
Mod+H { focus-column-left; }
Mod+L { focus-column-right; }
Mod+J { focus-window-down; }
Mod+K { focus-window-up; }
Mod+Shift+H { move-column-left; }
Mod+Shift+L { move-column-right; }
Mod+Shift+J { move-window-down; }
Mod+Shift+K { move-window-up; }
Mod+J { focus-window-or-workspace-down; }
Mod+K { focus-window-or-workspace-up; }
Mod+1 { focus-workspace "browser"; }
Mod+2 { focus-workspace "term"; }
@ -77,6 +72,11 @@
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
Mod+Shift+H { move-column-left; }
Mod+Shift+L { move-column-right; }
Mod+Shift+J { move-window-down; }
Mod+Shift+K { move-window-up; }
Mod+Shift+1 { move-column-to-workspace "browser"; }
Mod+Shift+2 { move-column-to-workspace "term"; }
Mod+Shift+3 { move-column-to-workspace 3; }
@ -95,7 +95,7 @@
Mod+Return { spawn "foot"; }
Mod+D { spawn "fuzzel"; }
Mod+B { spawn "zen-beta"; }
Mod+Ctrl+L { spawn "swaylock"; }
Mod+Alt+L { spawn "swaylock"; }
Mod+Shift+E { quit; }
Mod+V { toggle-window-floating; }
@ -108,11 +108,11 @@
Mod+Comma { consume-window-into-column; }
Mod+Period { expel-window-from-column; }
XF86AudioRaiseVolume { spawn "pamixer" "-i" "5"; }
XF86AudioLowerVolume { spawn "pamixer" "-d" "5"; }
XF86AudioMute { spawn "pamixer" "-t"; }
XF86MonBrightnessUp { spawn "brightnessctl" "set" "10%+"; }
XF86MonBrightnessDown { spawn "brightnessctl" "set" "10%-"; }
XF86AudioRaiseVolume { spawn "~/.config/fnott/scripts/osd.sh" "volume" "raise"; }
XF86AudioLowerVolume { spawn "~/.config/fnott/scripts/osd.sh" "volume" "lower"; }
XF86AudioMute { spawn "~/.config/fnott/scripts/osd.sh" "volume" "mute"; }
XF86MonBrightnessUp { spawn "~/.config/fnott/scripts/osd.sh" "brightness" "raise"; }
XF86MonBrightnessDown { spawn "~/.config/fnott/scripts/osd.sh" "brightness" "lower"; }
Print { screenshot; }
Mod+Print { screenshot-screen; }

56
modules/osd.nix Normal file
View file

@ -0,0 +1,56 @@
{
config,
lib,
pkgs,
userVars,
...
}:
{
home-manager.users."${userVars.username}" = {
xdg.configFile."fnott/scripts/osd.sh" = {
text = ''
#!/usr/bin/env bash
# usage: osd.sh [volume|brightness] [raise|lower|mute]
ACTION=$1
DIRECTION=$2
if [ "$ACTION" = "volume" ]; then
if [ "$DIRECTION" = "raise" ]; then
pamixer -i 5
elif [ "$DIRECTION" = "lower" ]; then
pamixer -d 5
elif [ "$DIRECTION" = "mute" ]; then
pamixer -t
fi
# Query state
VOLUME=$(pamixer --get-volume)
MUTED=$(pamixer --get-mute-status)
if [ "$MUTED" = "true" ]; then
notify-send -h int:value:0 -h string:x-canonical-private-synchronous:volume -i audio-volume-muted -t 1000 "Muted"
else
notify-send -h int:value:"$VOLUME" -h string:x-canonical-private-synchronous:volume -i audio-volume-high -t 1000 "Volume: $VOLUME%"
fi
elif [ "$ACTION" = "brightness" ]; then
if [ "$DIRECTION" = "raise" ]; then
brightnessctl set 10%+
elif [ "$DIRECTION" = "lower" ]; then
brightnessctl set 10%-
fi
# Query state
CURR=$(brightnessctl get)
MAX=$(brightnessctl max)
PCT=$(( (CURR * 100) / MAX ))
notify-send -h int:value:"$PCT" -h string:x-canonical-private-synchronous:brightness -i display-brightness -t 1000 "Brightness: $PCT%"
fi
'';
executable = true;
};
};
}