From a33392537cbc2ca3ff93c7ecdefb64a4370044f4 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Mon, 31 Aug 2026 09:27:48 -0400 Subject: [PATCH] Update some more configs --- .gitignore | 4 +++ home/aselimov/firefox/firefox.nix | 14 ++++++++- home/aselimov/home.nix | 22 +++++++++++++ home/aselimov/niri/config.kdl | 11 +++---- home/aselimov/scripts/volume.sh | 51 +++++++++++++++++++++++++++++++ home/aselimov/waybar/config.jsonc | 22 +++++++++++-- 6 files changed, 114 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100755 home/aselimov/scripts/volume.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5348595 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +home/neovim/neovim/spell/en_us +home/neovim/neovim/spell/wordlist +home/neovim/neovim/spell/wordlist.utf-8.spl +home/aselimov/firefox/sanitize-exceptions.nix diff --git a/home/aselimov/firefox/firefox.nix b/home/aselimov/firefox/firefox.nix index 5096d46..1c9c2fb 100644 --- a/home/aselimov/firefox/firefox.nix +++ b/home/aselimov/firefox/firefox.nix @@ -1,8 +1,21 @@ {config, pkgs, ... }: +let + sanitizeExceptionsFile = ./sanitize-exceptions.nix; + sanitizeExceptions = + if builtins.pathExists sanitizeExceptionsFile + then import sanitizeExceptionsFile + else [ ]; +in { programs.firefox = { enable = true; + policies = { + SanitizeOnShutdown = { + Cookies = true; + Exceptions = sanitizeExceptions; + }; + }; profiles.default = { id = 0; isDefault = true; @@ -14,7 +27,6 @@ "sidebar.verticalTabs" = true; "sidebar.revamp" = true; }; - userChrome = builtins.readFile ./userChrome.css; }; }; diff --git a/home/aselimov/home.nix b/home/aselimov/home.nix index 3201004..fbc315c 100644 --- a/home/aselimov/home.nix +++ b/home/aselimov/home.nix @@ -63,6 +63,8 @@ in yt-dlp pass dino + wtype + libnotify ]; home.pointerCursor = { enable = true; @@ -122,4 +124,24 @@ in maxCacheTtl = 86400; }; + home.file."bin/passmenu" = { + executable= true; + text = '' + #!/bin/sh + + prefix="$HOME/.password-store" + + password_file="$( + find "$prefix" -type f -name '*.gpg' | + sed "s|^$prefix/||; s|\.gpg$||" | + fuzzel --dmenu + )" + + [ -n "$password_file" ] || exit + + pass show "$password_file" | head -n1 | wtype - + ''; + }; + + home.file."bin/volume.sh".source = ./scripts/volume.sh; } diff --git a/home/aselimov/niri/config.kdl b/home/aselimov/niri/config.kdl index 0817de8..cd44341 100644 --- a/home/aselimov/niri/config.kdl +++ b/home/aselimov/niri/config.kdl @@ -370,22 +370,19 @@ binds { // Most actions that you can bind here can also be invoked programmatically with // `niri msg action do-something`. - // Mod-Shift-/, which is usually the same as Mod-?, - // shows a list of important hotkeys. - Mod+Shift+Slash { show-hotkey-overlay; } - // Suggested binds for running programs: terminal, app launcher, screen locker. Mod+Shift+Return hotkey-overlay-title="Open a Terminal: ghostty" { spawn "ghostty"; } Mod+P hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; } + Mod+Shift+P { spawn "passmenu"; } Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } // 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. // "-l 1.0" limits the volume to 100%. - XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; } - 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 "/home/aselimov/bin/volume.sh up"; } + XF86AudioLowerVolume allow-when-locked=true { spawn-sh "/home/aselimov/bin/volume.sh down"; } + XF86AudioMute allow-when-locked=true { spawn-sh "/home/aselimov/bin/volume.sh mute"; } XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } // Example media keys mapping using playerctl. diff --git a/home/aselimov/scripts/volume.sh b/home/aselimov/scripts/volume.sh new file mode 100755 index 0000000..bb88b4b --- /dev/null +++ b/home/aselimov/scripts/volume.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +case "$1" in + up) + wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+ + ;; + down) + wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- + ;; + mute) + wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + ;; + *) + exit 1 + ;; +esac + +status="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" +volume="$(awk '{printf "%.0f", $2 * 100}' <<< "$status")" + +make_bar() { + local value="$1" + local width=36 + local filled=$(( value * width / 100 )) + local empty=$(( width - filled )) + local bar="" + + for ((i = 0; i < filled; i++)); do + bar+="█" + done + + for ((i = 0; i < empty; i++)); do + bar+="░" + done + + printf '%s' "$bar" +} + +if grep -q MUTED <<< "$status"; then + title="Muted" + bar="" +else + title="${volume}%" + bar="$(make_bar "$volume")" +fi + +notify-send \ + --app-name="Volume" \ + --hint="string:x-canonical-private-synchronous:volume" \ + "$title" \ + "$bar" diff --git a/home/aselimov/waybar/config.jsonc b/home/aselimov/waybar/config.jsonc index ba05fb9..cf5bb9e 100644 --- a/home/aselimov/waybar/config.jsonc +++ b/home/aselimov/waybar/config.jsonc @@ -13,7 +13,8 @@ "modules-right": [ "pulseaudio", "network", - "battery", + "battery#bat0", + "battery#bat1", "tray" ], "niri/workspaces": { @@ -43,7 +44,24 @@ "format-disconnected": "󰖪", "tooltip-format-wifi": "{essid}" }, - "battery": { + "battery#bat0": { + "bat": "BAT0", + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% 󰂄", + "format-icons": [ + "󰁺", + "󰁼", + "󰁾", + "󰂀", + "󰁹" + ], + "states": { + "warning": 25, + "critical": 10 + } + }, + "battery#bat1": { + "bat": "BAT1", "format": "{capacity}% {icon}", "format-charging": "{capacity}% 󰂄", "format-icons": [