Update some more configs
This commit is contained in:
parent
0a24ffcef1
commit
a33392537c
6 changed files with 114 additions and 10 deletions
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
51
home/aselimov/scripts/volume.sh
Executable file
51
home/aselimov/scripts/volume.sh
Executable file
|
|
@ -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"
|
||||
|
|
@ -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": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue