notifications
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
./calibre.nix
|
||||
./digikam.nix
|
||||
./dolphin.nix
|
||||
./dunst.nix
|
||||
./eww
|
||||
./git.nix
|
||||
./hyprlock.nix
|
||||
|
||||
49
home/programs/dunst.nix
Normal file
49
home/programs/dunst.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
;; /-- Bar -->
|
||||
;; ── Bar ─────────────────────────────────────────────────────────────
|
||||
|
||||
(defwindow bar []
|
||||
:geometry (geometry
|
||||
@@ -42,14 +42,14 @@
|
||||
)
|
||||
)
|
||||
|
||||
;; /-- Widget Separator -->
|
||||
;; ── Widget Separator ────────────────────────────────────────────────
|
||||
|
||||
(defwidget widSep []
|
||||
(label
|
||||
:class "text separator"
|
||||
:text "|"))
|
||||
|
||||
;; /-- Idle Inhibitor -->
|
||||
;; ── 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"
|
||||
(label :text "${idle_inhibitor == 'start' ? '' : '' }"))))
|
||||
|
||||
;; /-- Audio -->
|
||||
;; ── Audio ───────────────────────────────────────────────────────────
|
||||
|
||||
(defvar micClass "micOff")
|
||||
(defvar micIcon "")
|
||||
@@ -85,7 +85,7 @@
|
||||
:class micClass
|
||||
:text "${micIcon}")))
|
||||
|
||||
;; /-- Backlight -->
|
||||
;; ── Backlight ───────────────────────────────────────────────────────
|
||||
|
||||
(defpoll backlight
|
||||
:interval "1s"
|
||||
@@ -102,7 +102,7 @@
|
||||
:class "text"
|
||||
:text "${backlight}%")))
|
||||
|
||||
;; /-- CPU -->
|
||||
;; ── CPU ─────────────────────────────────────────────────────────────
|
||||
|
||||
(defpoll cpu
|
||||
:interval "1s"
|
||||
@@ -119,7 +119,7 @@
|
||||
:class "text"
|
||||
:text "${cpu}%")))
|
||||
|
||||
;; /-- Memory -->
|
||||
;; ── Memory ──────────────────────────────────────────────────────────
|
||||
|
||||
(defpoll memory
|
||||
:interval "1s"
|
||||
@@ -136,7 +136,7 @@
|
||||
:class "text"
|
||||
:text "${memory}%")))
|
||||
|
||||
;; /-- Battery -->
|
||||
;; ── Battery ─────────────────────────────────────────────────────────
|
||||
|
||||
(defvar batteryClass "speakerOff")
|
||||
(defvar batteryIcon "")
|
||||
@@ -155,7 +155,7 @@
|
||||
:class "text"
|
||||
:text "${batteryVolume}%")))
|
||||
|
||||
;; /-- Network -->
|
||||
;; ── Network ─────────────────────────────────────────────────────────
|
||||
|
||||
(defvar networkDown "0")
|
||||
(defpoll networkUp
|
||||
@@ -179,7 +179,7 @@
|
||||
:class "text"
|
||||
:text "${networkUp}")))
|
||||
|
||||
;; /-- Time -->
|
||||
;; ── Time ────────────────────────────────────────────────────────────
|
||||
|
||||
(defpoll date
|
||||
:interval "1s"
|
||||
@@ -196,7 +196,7 @@
|
||||
:class "text"
|
||||
:text "${date}")))
|
||||
|
||||
;; /-- River State -->
|
||||
;; ── River State ─────────────────────────────────────────────────────
|
||||
|
||||
(defvar ws1 "ws-empty")
|
||||
(defvar ws2 "ws-empty")
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
bat=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
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
|
||||
bat="100"
|
||||
eww update batteryClass="batteryFull"
|
||||
@@ -8,6 +17,7 @@ if [ ! -d "/sys/class/power_supply/BAT0" ]; then
|
||||
elif [[ $stat == 1 ]]; then
|
||||
eww update batteryClass="batteryCharging"
|
||||
eww update batteryIcon=""
|
||||
eww update batterOver="true"
|
||||
elif [[ $bat -le 10 ]]; then
|
||||
eww update batteryClass="batteryEmpty"
|
||||
eww update batteryIcon=""
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
wlr-randr
|
||||
yad
|
||||
slurp
|
||||
grim
|
||||
wl-clipboard
|
||||
@@ -39,7 +43,7 @@
|
||||
extraConfig = "rivertile -view-padding 0 -outer-padding 0 &";
|
||||
settings = {
|
||||
spawn = [
|
||||
"/home/elias/.config/helperscripts/startEww.sh"
|
||||
"/home/${config.home.username}/.config/helperscripts/startEww.sh"
|
||||
# "nextcloud"
|
||||
];
|
||||
spawn-tagmask = "${all_but_scratch_tag}";
|
||||
@@ -66,23 +70,23 @@
|
||||
normal = {
|
||||
"Super+Shift Return" = "spawn alacritty";
|
||||
# Messages
|
||||
"Control+Super W" = "spawn 'yad --text=\"Hello from Wayland!\" --button=OK'";
|
||||
"Control+Super W" = "spawn 'printf \"Hello from Wayland!\" | dunstify -'";
|
||||
# System
|
||||
"Super P" = "spawn 'rofi -show drun'";
|
||||
"Super+Shift C" = "close";
|
||||
# Screenshots
|
||||
"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" =
|
||||
"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" =
|
||||
"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" =
|
||||
"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" =
|
||||
"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" =
|
||||
"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
|
||||
"Super J" = "focus-view next";
|
||||
"Super K" = "focus-view previous";
|
||||
@@ -132,7 +136,7 @@
|
||||
# Program
|
||||
"Super C" = "spawn 'firefox'";
|
||||
"Super Y" = "spawn 'signal-desktop'";
|
||||
"Super X" = "spawn 'telegram-desktop'";
|
||||
"Super X" = "spawn 'Telegram'";
|
||||
"Super V" = "spawn 'thunderbird'";
|
||||
}
|
||||
// genTagMappings (i: "Super ${i}") (i: "set-focused-tags ${tags i}")
|
||||
|
||||
1
home/programs/river/src/screenshot-active-clipboard.sh
Executable file
1
home/programs/river/src/screenshot-active-clipboard.sh
Executable file
@@ -0,0 +1 @@
|
||||
dunstify "Screenshot" "Active Window Screen to Clipboard"
|
||||
1
home/programs/river/src/screenshot-active-file.sh
Executable file
1
home/programs/river/src/screenshot-active-file.sh
Executable file
@@ -0,0 +1 @@
|
||||
dunstify "Screenshot" "Active Window to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))"
|
||||
1
home/programs/river/src/screenshot-selection-clipboard.sh
Executable file
1
home/programs/river/src/screenshot-selection-clipboard.sh
Executable file
@@ -0,0 +1 @@
|
||||
dunstify "Screenshot" "Selection to Clipboard"
|
||||
1
home/programs/river/src/screenshot-selection-file.sh
Executable file
1
home/programs/river/src/screenshot-selection-file.sh
Executable file
@@ -0,0 +1 @@
|
||||
dunstify "Screenshot" "Selection to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))"
|
||||
1
home/programs/river/src/screenshot-whole-clipboard.sh
Executable file
1
home/programs/river/src/screenshot-whole-clipboard.sh
Executable file
@@ -0,0 +1 @@
|
||||
dunstify "Screenshot" "Whole Screen to Clipboard"
|
||||
1
home/programs/river/src/screenshot-whole-file.sh
Executable file
1
home/programs/river/src/screenshot-whole-file.sh
Executable file
@@ -0,0 +1 @@
|
||||
dunstify "Screenshot" "Whole Screen to File (/home/$USER/Pictures/screenshot-$(date -u +%Y-%m-%d-%H:%M:%S))"
|
||||
@@ -6,6 +6,6 @@
|
||||
];
|
||||
xsession.initExtra = ''
|
||||
swww-daemon
|
||||
swww img "/etc/nixos/home/programs/wallpaper/background_temp.jpeg" fill
|
||||
swww img "/etc/nixos/home/programs/swww/background_temp.jpeg" fill
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user