(desktop) Gen 473: Broke desktop default.nix down into modules, removed conditionals from users.nix, moved host-dependent logic into corresponding host folders, enabled keyd on laptop
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
|
||||
shellAliases = {
|
||||
grep = "grep --color=auto";
|
||||
yazi = "y";
|
||||
vi = "nvim";
|
||||
mv = "mv -v";
|
||||
cp = "cp -vr";
|
||||
@@ -69,6 +70,15 @@
|
||||
scheck && runbg aplay ${self}/media/sound/ls.wav
|
||||
}
|
||||
|
||||
y() {
|
||||
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
builtin cd -- "$cwd"
|
||||
fi
|
||||
rm -f -- "$tmp"
|
||||
}
|
||||
|
||||
cd() {
|
||||
export SOUNDS_ENABLED=0
|
||||
eza -1 --group-directories-first --icons "$@"
|
||||
|
||||
@@ -141,8 +141,8 @@
|
||||
"super, c, killactive,"
|
||||
"super, e, exec, [float;size 45% 70%;move 10 50] kitty btop"
|
||||
"super, n, exec, [float;size 50% 35%;move 10 50] pavucontrol"
|
||||
"super, p, exec, [float;size 31% 30%;move onscreen cursor 0 0] kitty passhelper"
|
||||
"super, p, exec, aplay ~/media/sound/soundtest.wav"
|
||||
"super, p, exec, [float;size 25% 30%;move onscreen cursor 0 0] [ ! -f /tmp/passhelperfile ] && kitty passhelper"
|
||||
"super, 0, exec, aplay ~/media/sound/soundtest.wav"
|
||||
"super shift, q, exit,"
|
||||
"super, m, exec, fuzzel"
|
||||
"super, r, exec, neovide"
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
{ host, nur, self, inputs, username, config, ... }:
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (import ./programs/btop.nix) ]
|
||||
++ [ (import ./programs/yazi.nix) ]
|
||||
++ [ (import ./programs/kitty.nix) ]
|
||||
++ [ (import ./programs/fuzzel.nix) ]
|
||||
++ [ (import ./programs/eza.nix) ]
|
||||
++ [ (import ./programs/cava.nix) ]
|
||||
++ [ (import ./programs/bat.nix) ]
|
||||
++ [ (import ./programs/git.nix) ]
|
||||
++ [ (import ./environment/gtk.nix) ]
|
||||
++ [ (import ./environment/spicetify.nix) ]
|
||||
++ [ (import ./environment/starship.nix) ]
|
||||
++ [ (import ./environment/laptop_userpkgs.nix) ]
|
||||
++ [ (import ./environment/zshell.nix) ]
|
||||
++ [ (import ./firefox/firefox.nix) ]
|
||||
++ [ (import ./hyprland) ]
|
||||
++ [ (import ./scripts ) ]
|
||||
++ [ (import ./swaync/swaync.nix) ]
|
||||
++ [ (import ./waybar) ];
|
||||
}
|
||||
@@ -3,9 +3,17 @@
|
||||
pkgs.writeShellScriptBin "passhelper" (''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
pass_string=$(find $HOME/.password-store -type f | sed 's|.*/.password-store/||; s|\.gpg$||' | rg -v ".gpg-id$" | fzf)
|
||||
# prevent multiple instances, conditional check happens in the hyprland bind
|
||||
touch /tmp/passhelperfile
|
||||
trap "[ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile" EXIT SIGHUP SIGINT
|
||||
|
||||
# get passwords from password store, remove .password store/ prefix and .gpg suffix, exlude .gpg-id file, open results in fzf
|
||||
pass_string=$(find $HOME/.password-store -type f | sed 's|.*/.password-store/||; s|\.gpg$||' | rg -v ".gpg-id$" | fzf --border --border-label="$(whoami)'s keyring")
|
||||
|
||||
[ $? = 0 ] || { [ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile; exit 1; }
|
||||
|
||||
pass -c "$pass_string"
|
||||
sleep 1.5
|
||||
/run/current-system/sw/bin/rm /tmp/passhelperfile
|
||||
exit 0
|
||||
'')
|
||||
|
||||
Reference in New Issue
Block a user