notifications

This commit is contained in:
2026-03-02 18:52:24 +01:00
parent 976d6cf554
commit 411e350482
15 changed files with 112 additions and 35 deletions

View File

@@ -136,17 +136,6 @@
XDG_STATE_HOME = "$HOME/.local/state"; XDG_STATE_HOME = "$HOME/.local/state";
}; };
# Hyprlock
security.pam.services.hyprlock = {
text = ''
auth sufficient pam_fprint.so
auth include login
'';
};
# Fingerprint SDDM
services.fprintd.enable = true;
# Enabling the Keyring. # Enabling the Keyring.
security.pam.services.login.enableGnomeKeyring = true; security.pam.services.login.enableGnomeKeyring = true;
security.pam.services.sddm.enableGnomeKeyring = true; security.pam.services.sddm.enableGnomeKeyring = true;

View File

@@ -6,6 +6,7 @@
./calibre.nix ./calibre.nix
./digikam.nix ./digikam.nix
./dolphin.nix ./dolphin.nix
./dunst.nix
./eww ./eww
./git.nix ./git.nix
./hyprlock.nix ./hyprlock.nix

49
home/programs/dunst.nix Normal file
View File

@@ -0,0 +1,49 @@
{ ... }:
{
services.dunst = {
enable = true;
settings = {
global = {
# Your exact styling - unchanged
monitor = 1;
origin = "top-right";
offset = "15x25";
width = 300;
height = 100;
gap_size = 5;
notification_limit = 5;
# font removed as requested
frame_width = 1;
separator_color = "frame";
corner_radius = 12;
corners = "top-left,bottom";
progress_bar_corner_radius = 8;
progress_bar_corners = "top-left,bottom-right";
timeout = 5;
idle_threshold = 120;
max_icon_size = 64;
enable_recursive_icon_lookup = true;
show_indicators = true;
sticky_history = true;
history_length = 20;
mouse_left_click = "close_current";
mouse_right_click = "close_all";
mouse_middle_click = "context_all";
format = "<b>%a</b>\\n%s\\n<i>%b</i>";
};
urgency_low = {
timeout = 3;
};
urgency_normal = {
timeout = 5;
};
urgency_critical = {
timeout = 0;
};
};
};
}

View File

@@ -1,4 +1,4 @@
;; /-- Bar --> ;; ── Bar ─────────────────────────────────────────────────────────────
(defwindow bar [] (defwindow bar []
:geometry (geometry :geometry (geometry
@@ -42,14 +42,14 @@
) )
) )
;; /-- Widget Separator --> ;; ── Widget Separator ────────────────────────────────────────────────
(defwidget widSep [] (defwidget widSep []
(label (label
:class "text separator" :class "text separator"
:text "|")) :text "|"))
;; /-- Idle Inhibitor --> ;; ── Idle Inhibitor ──────────────────────────────────────────────────
(deflisten idle_inhibitor "journalctl --output=cat --output-fields=JOB_TYPE --user --follow --unit=idle-inhibitor") (deflisten idle_inhibitor "journalctl --output=cat --output-fields=JOB_TYPE --user --follow --unit=idle-inhibitor")
@@ -61,7 +61,7 @@
:onclick "systemctl is-active idle-inhibitor.service && systemctl stop idle-inhibitor.service || systemctl start idle-inhibitor.service" :onclick "systemctl is-active idle-inhibitor.service && systemctl stop idle-inhibitor.service || systemctl start idle-inhibitor.service"
(label :text "${idle_inhibitor == 'start' ? '󰈈' : '󰛐' }")))) (label :text "${idle_inhibitor == 'start' ? '󰈈' : '󰛐' }"))))
;; /-- Audio --> ;; ── Audio ───────────────────────────────────────────────────────────
(defvar micClass "micOff") (defvar micClass "micOff")
(defvar micIcon "󰍭") (defvar micIcon "󰍭")
@@ -85,7 +85,7 @@
:class micClass :class micClass
:text "${micIcon}"))) :text "${micIcon}")))
;; /-- Backlight --> ;; ── Backlight ───────────────────────────────────────────────────────
(defpoll backlight (defpoll backlight
:interval "1s" :interval "1s"
@@ -102,7 +102,7 @@
:class "text" :class "text"
:text "${backlight}%"))) :text "${backlight}%")))
;; /-- CPU --> ;; ── CPU ─────────────────────────────────────────────────────────────
(defpoll cpu (defpoll cpu
:interval "1s" :interval "1s"
@@ -119,7 +119,7 @@
:class "text" :class "text"
:text "${cpu}%"))) :text "${cpu}%")))
;; /-- Memory --> ;; ── Memory ──────────────────────────────────────────────────────────
(defpoll memory (defpoll memory
:interval "1s" :interval "1s"
@@ -136,7 +136,7 @@
:class "text" :class "text"
:text "${memory}%"))) :text "${memory}%")))
;; /-- Battery --> ;; ── Battery ─────────────────────────────────────────────────────────
(defvar batteryClass "speakerOff") (defvar batteryClass "speakerOff")
(defvar batteryIcon "") (defvar batteryIcon "")
@@ -155,7 +155,7 @@
:class "text" :class "text"
:text "${batteryVolume}%"))) :text "${batteryVolume}%")))
;; /-- Network --> ;; ── Network ─────────────────────────────────────────────────────────
(defvar networkDown "0") (defvar networkDown "0")
(defpoll networkUp (defpoll networkUp
@@ -179,7 +179,7 @@
:class "text" :class "text"
:text "${networkUp}"))) :text "${networkUp}")))
;; /-- Time --> ;; ── Time ────────────────────────────────────────────────────────────
(defpoll date (defpoll date
:interval "1s" :interval "1s"
@@ -196,7 +196,7 @@
:class "text" :class "text"
:text "${date}"))) :text "${date}")))
;; /-- River State --> ;; ── River State ─────────────────────────────────────────────────────
(defvar ws1 "ws-empty") (defvar ws1 "ws-empty")
(defvar ws2 "ws-empty") (defvar ws2 "ws-empty")

View File

@@ -1,6 +1,15 @@
bat=$(cat /sys/class/power_supply/BAT0/capacity) bat=$(cat /sys/class/power_supply/BAT0/capacity)
stat=$(cat /sys/class/power_supply/AC/online) stat=$(cat /sys/class/power_supply/AC/online)
if [[ $bat -le 20 ]]; then
if [[ ! -f /tmp/battery_warning_send ]]; then
dunstify -u "critical" "Battery warning!" "Battery is at ${bat}% - please attach charger!"
touch /tmp/battery_warning_send
fi
else
rm -f /tmp/battery_warning_send
fi
if [ ! -d "/sys/class/power_supply/BAT0" ]; then if [ ! -d "/sys/class/power_supply/BAT0" ]; then
bat="100" bat="100"
eww update batteryClass="batteryFull" eww update batteryClass="batteryFull"
@@ -8,6 +17,7 @@ if [ ! -d "/sys/class/power_supply/BAT0" ]; then
elif [[ $stat == 1 ]]; then elif [[ $stat == 1 ]]; then
eww update batteryClass="batteryCharging" eww update batteryClass="batteryCharging"
eww update batteryIcon="" eww update batteryIcon=""
eww update batterOver="true"
elif [[ $bat -le 10 ]]; then elif [[ $bat -le 10 ]]; then
eww update batteryClass="batteryEmpty" eww update batteryClass="batteryEmpty"
eww update batteryIcon="" eww update batteryIcon=""

View File

@@ -1,9 +1,13 @@
{ pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
wlr-randr wlr-randr
yad
slurp slurp
grim grim
wl-clipboard wl-clipboard
@@ -39,7 +43,7 @@
extraConfig = "rivertile -view-padding 0 -outer-padding 0 &"; extraConfig = "rivertile -view-padding 0 -outer-padding 0 &";
settings = { settings = {
spawn = [ spawn = [
"/home/elias/.config/helperscripts/startEww.sh" "/home/${config.home.username}/.config/helperscripts/startEww.sh"
# "nextcloud" # "nextcloud"
]; ];
spawn-tagmask = "${all_but_scratch_tag}"; spawn-tagmask = "${all_but_scratch_tag}";
@@ -66,23 +70,23 @@
normal = { normal = {
"Super+Shift Return" = "spawn alacritty"; "Super+Shift Return" = "spawn alacritty";
# Messages # Messages
"Control+Super W" = "spawn 'yad --text=\"Hello from Wayland!\" --button=OK'"; "Control+Super W" = "spawn 'printf \"Hello from Wayland!\" | dunstify -'";
# System # System
"Super P" = "spawn 'rofi -show drun'"; "Super P" = "spawn 'rofi -show drun'";
"Super+Shift C" = "close"; "Super+Shift C" = "close";
# Screenshots # Screenshots
"None Print" = "None Print" =
"spawn 'grim ~/Pictures/screenshot_$(date +%F_%H-%M-%S).png; yad --text=\"Screenshot - Whole Screen to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))\"'"; # Whole Screen to File "spawn 'grim ~/Pictures/screenhot_$(date +%F_%H-%M-%S).png;/home/${config.home.username}/.config/helperscripts/screenshot-whole-file.sh'"; # Whole Screen to File
"Super Print" = "Super Print" =
"spawn 'grim -g \"$(slurp)\" ~/Pictures/screenshot_$(date +%F_%H-%M-%S).png; yad --text=\"Screenshot - Selection to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))\"'"; # Selection to File "spawn 'grim -g \"$(slurp)\" ~/Pictures/screenshot_$(date +%F_%H-%M-%S).png;/home/${config.home.username}/.config/helperscripts/screenshot-selection-file.sh'"; # Selection to File
"Shift Print" = "Shift Print" =
"spawn 'grim -g \"$(riverctl windows --focused | awk '{print $3,$4,$5,$6}')\" ~/Pictures/active_window_$(date +%F_%H-%M-%S).png; yad --text=\"Screenshot - Active Window to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))\"'"; # Active Window to File "spawn 'grim -g \"$(riverctl windows --focused | awk '{print $3,$4,$5,$6}')\" ~/Pictures/active_window_$(date +%F_%H-%M-%S).png;/home/${config.home.username}/.config/helperscripts/screenshot-active-window.sh'"; # Active Window to File
"Control Print" = "Control Print" =
"spawn 'grim -g \"$(slurp)\" - | wl-copy --type image/png; yad --text=\"Screenshot - Whole Screen to Clipboard\"'"; # Whole Screen to Clipboard "spawn 'grim -g \"$(slurp)\" - | wl-copy --type image/png;/home/${config.home.username}/.config/helperscripts/screenshot-whole-clipboard.sh'"; # Whole Screen to Clipboard
"Control+Super Print" = "Control+Super Print" =
"spawn 'grim -g \"$(slurp)\" - | wl-copy --type image/png; yad --text=\"Screenshot - Selection to Clipboard\"'"; # Selection to Clipboard "spawn 'grim -g \"$(slurp)\" - | wl-copy --type image/png;/home/${config.home.username}/.config/helperscripts/screenshot-selection-clipboard.sh'"; # Selection to Clipboard
"Control+Shift Print" = "Control+Shift Print" =
"spawn 'grim -g \"$(riverctl windows --focused | awk '{print $3,$4,$5,$6}')\" - | wl-copy --type image/png; yad --text=\"Screenshot - Active Window to Clipboard\"'"; # Active Window to Clipboard "spawn 'grim -g \"$(riverctl windows --focused | awk '{print $3,$4,$5,$6}')\" - | wl-copy --type image/png;/home/${config.home.username}/.config/helperscripts/screenshot-active-clipboard.sh'"; # Active Window to Clipboard
# Window Control # Window Control
"Super J" = "focus-view next"; "Super J" = "focus-view next";
"Super K" = "focus-view previous"; "Super K" = "focus-view previous";
@@ -132,7 +136,7 @@
# Program # Program
"Super C" = "spawn 'firefox'"; "Super C" = "spawn 'firefox'";
"Super Y" = "spawn 'signal-desktop'"; "Super Y" = "spawn 'signal-desktop'";
"Super X" = "spawn 'telegram-desktop'"; "Super X" = "spawn 'Telegram'";
"Super V" = "spawn 'thunderbird'"; "Super V" = "spawn 'thunderbird'";
} }
// genTagMappings (i: "Super ${i}") (i: "set-focused-tags ${tags i}") // genTagMappings (i: "Super ${i}") (i: "set-focused-tags ${tags i}")

View File

@@ -0,0 +1 @@
dunstify "Screenshot" "Active Window Screen to Clipboard"

View File

@@ -0,0 +1 @@
dunstify "Screenshot" "Active Window to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))"

View File

@@ -0,0 +1 @@
dunstify "Screenshot" "Selection to Clipboard"

View File

@@ -0,0 +1 @@
dunstify "Screenshot" "Selection to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))"

View File

@@ -0,0 +1 @@
dunstify "Screenshot" "Whole Screen to Clipboard"

View File

@@ -0,0 +1 @@
dunstify "Screenshot" "Whole Screen to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))"

View File

@@ -6,6 +6,6 @@
]; ];
xsession.initExtra = '' xsession.initExtra = ''
swww-daemon swww-daemon
swww img "/etc/nixos/home/programs/wallpaper/background_temp.jpeg" fill swww img "/etc/nixos/home/programs/swww/background_temp.jpeg" fill
''; '';
} }

View File

@@ -1,13 +1,19 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
imports = [ ./hardware-configuration-desktop.nix ./../configuration.nix ]; imports = [
./hardware-configuration-desktop.nix
./../configuration.nix
];
networking.hostName = "eliasDesktop"; networking.hostName = "eliasDesktop";
services.blueman.enable = true; services.blueman.enable = true;
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true; hardware.bluetooth.powerOnBoot = true;
# Hyprlock
security.pam.services.hyprlock = { };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
networkmanager-vpnc networkmanager-vpnc
networkmanagerapplet networkmanagerapplet

View File

@@ -17,6 +17,18 @@
}; };
}; };
# Hyprlock
security.pam.services = {
hyprlock = {
text = ''
auth sufficient pam_fprint.so
auth include login
'';
};
sudo.fprintAuth = true;
login.fprintAuth = true;
};
# ── Bluetooth ───────────────────────────────────────────────────────── # ── Bluetooth ─────────────────────────────────────────────────────────
services.blueman.enable = true; services.blueman.enable = true;
hardware.bluetooth = { hardware.bluetooth = {