fixup! Fix thor

This commit is contained in:
Filippo Berto 2024-10-21 20:06:58 +02:00
parent c103109233
commit a8ee39aaa3
Signed by: bertof
GPG key ID: 9DBF7E6A1D2CE9ED
6 changed files with 2 additions and 221 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
result result
result-*
.direnv .direnv
.pre-commit-config.yaml .pre-commit-config.yaml
.worktrees/ .worktrees/

View file

@ -97,7 +97,6 @@
../../modules/hm/biblio.nix ../../modules/hm/biblio.nix
# ../../modules/hm/bitwarden.nix # ../../modules/hm/bitwarden.nix
# ../../modules/hm/blender.nix # ../../modules/hm/blender.nix
# ../../modules/hm/bspwm.nix
../../modules/hm/cava.nix ../../modules/hm/cava.nix
# ../../modules/hm/dwarf-fortress.nix # ../../modules/hm/dwarf-fortress.nix
../../modules/hm/easyeffects.nix ../../modules/hm/easyeffects.nix

View file

@ -91,7 +91,6 @@
../../modules/hm/biblio.nix ../../modules/hm/biblio.nix
# ../../modules/hm/bitwarden.nix # ../../modules/hm/bitwarden.nix
../../modules/hm/blender_nvidia.nix ../../modules/hm/blender_nvidia.nix
# ../../modules/hm/bspwm.nix
../../modules/hm/cava.nix ../../modules/hm/cava.nix
# ../../modules/hm/dwarf-fortress.nix # ../../modules/hm/dwarf-fortress.nix
../../modules/hm/easyeffects.nix ../../modules/hm/easyeffects.nix
@ -130,7 +129,6 @@
# ../../modules/hm/screen_locker.nix # ../../modules/hm/screen_locker.nix
# ../../modules/hm/security.nix # ../../modules/hm/security.nix
# ../../modules/hm/spotifyd.nix # ../../modules/hm/spotifyd.nix
# ../../modules/hm/sxhkd.nix
../../modules/hm/syncthing.nix ../../modules/hm/syncthing.nix
# ../../modules/hm/thunar.nix # ../../modules/hm/thunar.nix
# ../../modules/hm/twmn.nix # ../../modules/hm/twmn.nix

View file

@ -1,84 +0,0 @@
{ pkgs, lib, ... }:
let
xsetroot = "${pkgs.xorg.xsetroot}/bin/xsetroot";
monitorPages = [
""
""
""
""
""
""
""
""
""
""
];
monitorPagesString = lib.strings.concatStringsSep " " monitorPages;
monitorSetupScript = pkgs.writeShellScript "monitorSetupScript" ''
for monitor in $(bspc query -M --names); do
bspc monitor $monitor -d ${monitorPagesString}
done
${pkgs.autorandr}/bin/autorandr -c || true
systemctl --user restart polybar # Restart polybar
systemctl --user restart kdeconnect-indicator # Restart polybar
'';
strPalette = pkgs.lib.nix-rice.palette.toRGBHex pkgs.rice.colorPalette;
in
{
imports = [
./picom.nix
./polybar.nix
./sxhkd.nix
./update_background.nix
./xidlehook.nix
./dunst.nix
];
home.packages = builtins.attrValues {
inherit (pkgs)
arandr
blueman
dmenu
keyboard-switch
;
};
xsession.windowManager.bspwm = {
enable = true;
settings = {
border_width = 1;
border_radius = 8;
window_gap = 2;
split_ratio = 0.5;
top_padding = 0;
bottom_padding = 0;
right_padding = 0;
left_padding = 0;
borderless_monocle = true;
gapless_monocle = false;
normal_border_color = strPalette.normal.blue;
focused_border_color = strPalette.bright.red;
};
# monitors = builtins.foldl' (acc: monitor: acc // { ${monitor} = monitorPages; }) { } monitors;
rules = {
"*" = {
follow = true;
};
"Zathura" = {
state = "tiled";
};
"Yad" = {
state = "floating";
};
};
startupPrograms = [
"${monitorSetupScript}" # Setup monitors
"${xsetroot} -solid black -cursor_name left_ptr" # Set cursor
"${pkgs.update-background}/bin/update-background" # Set background
];
};
services = {
network-manager-applet.enable = true;
blueman-applet.enable = true;
};
}

View file

@ -1,8 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
fonts.fontconfig = { fonts.fontconfig.enable = true;
enable = true;
};
home.packages = builtins.attrValues { home.packages = builtins.attrValues {
inherit (pkgs) inherit (pkgs)
dejavu_fonts dejavu_fonts

View file

@ -1,131 +0,0 @@
{ pkgs, lib, ... }:
{
imports = [
# ./alacritty.nix
./kitty.nix
# ./nautilus.nix
./nemo.nix
./terminator.nix
# ./thunar.nix
./yazi.nix
];
home.packages = builtins.attrValues {
inherit (pkgs)
bc# required by bsp-layout
bsp-layout
clipedit
lockscreen
terminator
;
};
services.sxhkd =
let
primaryTerminal = "kitty";
secondaryTerminal = "terminator";
fileManager =
let
ya = pkgs.writeShellScript "ya" ''
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
cd -- "$cwd"
fi
rm -f -- "$tmp"
'';
in
"kitty -e bash ${ya}";
secondaryFileManager = "nemo";
emojiChooser = "rofimoji --skin-tone light -a copy";
windowSwitcher = "rofi -show window";
arandr = "${pkgs.arandr}/bin/arandr";
passwordChoser = "rofi-rbw";
notify = "${pkgs.libnotify}/bin/notify-send";
pamixer = "${pkgs.pamixer}/bin/pamixer";
playerctl = "${pkgs.playerctl}/bin/playerctl";
xbacklight = "${pkgs.xorg.xbacklight}/bin/xbacklight";
resetBspwm = pkgs.writeShellScript "resetBspwm" ''
bspc wm -r
for p in {top,bottom,left,right}; do bspc config -m any ''${p}_padding 0; done # Reset padding
systemctl --user restart polybar # Restart polybar
${notify} "BSPWM restarted"
'';
moveAllNodesToPrimary = pkgs.writeShellScript "moveAllNodesToPrimary" ''
comm -23 <(bspc query -N | sort) <(bspc query -m primary -N | sort) | while read n; do bspc node $n -m primary; done
'';
notifyVolume = pkgs.writeShellScript "notifyVolume" ''
PATH=$PATH:"${
lib.makeBinPath [
pkgs.coreutils
pkgs.pamixer
]
}"
sink=`pamixer --get-default-sink | tail -n 1| sed -E 's/.+"(.+)"$/\1/'`
muted=`pamixer --get-mute`
volume=`pamixer --get-volume`
if [[ $muted == "true" ]]; then
${notify} -r 1 -h "int:value:0" "Muted" "$sink"
else
${notify} -r 1 -h "int:value:$volume" "Volume $volume%" "$sink"
fi
'';
notifyBrightness = pkgs.writeShellScript "notifyBrightness" ''
level=`printf "%.0f" $(${xbacklight} -get)`
${notify} -r 2 -h "int:value:$level" "Luminosità $level"
'';
powermenu = pkgs.writeShellScript "powermenu" ''
PATH=$PATH:"${
lib.makeBinPath [
pkgs.rofi
pkgs.rofi-power-menu
]
}"
rofi -show menu -modi "menu:rofi-power-menu --choices=shutdown/reboot/hibernate/logout"
'';
in
{
enable = true;
keybindings = {
"{,shift+}Print" = "${pkgs.gnome-screenshot}/bin/gnome-screenshot {-i,-a}";
"XF86Audio{LowerVolume,Mute,RaiseVolume}" = "${pamixer} {-d 2 -u,-t,-i 2 -u} && ${notifyVolume}";
"XF86Audio{Next,Play,Prev}" = "${playerctl} {next,play-pause,previous}";
"XF86MonBrightness{Up,Down}" = "${xbacklight} -{inc,dec} 10 && ${notifyBrightness}";
"XF86PowerOff" = toString powermenu;
"alt + Tab" = windowSwitcher;
"button10" = windowSwitcher;
"super + Escape" = "pkill -USR1 -x sxhkd";
"super + alt + e" = emojiChooser;
"super + alt + i" = passwordChoser;
"super + alt + m" = "lockscreen";
"super + alt + o" = "${moveAllNodesToPrimary}";
"super + alt + p" = "${arandr}";
"super + alt + r" = "${resetBspwm}";
"super + alt + shift + {h,j,k,l}" = "bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}";
"super + alt + {Right,Down,Left}" = "${playerctl} {next,play-pause,previous}";
"super + alt + {h,j,k,l}" = "bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}";
"super + b" = "${pkgs.update-background}/bin/update-background";
"super + bracket{left,right}" = "bspc desktop -f {prev,next}.local";
"super + ctrl + shift + space" = "bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel";
"super + ctrl + space" = "bspc node -p cancel";
"super + ctrl + {1-9}" = "bspc node -o 0.{1-9}";
"super + ctrl + {h,j,k,l}" = "bspc node -p {west,south,north,east}";
"super + e {_,+shift}" = "{${fileManager},${secondaryFileManager}}";
"super + g" = "bspc node -s biggest";
"super + m" = "bspc desktop -l next";
"super + n {_, + shift}" = "bsp-layout {next, previous}";
"super + shift + ctrl + d" = "rofi -show ssh";
"super + shift + p" = "clipedit";
"super + shift + {a,d}" = "bspc node @/ -C {forward,backward}";
"super + shift + {h,j,k,l}" = ''dir={west,south,north,east}; bspc node -s "$dir.local" --follow || bspc node -m "$dir" --follow'';
"super + {Left,Down,Up,Right}" = "bspc node -v {-20 0,0 20,0 -20,20 0}";
"super + {_,shift + } Return" = "{${primaryTerminal} , ${secondaryTerminal}}";
"super + {_,shift + } c" = "bspc node -f {next,prev}.local";
"super + {_,shift + } space" = "rofi -show {drun,run}";
"super + {_,shift + } w" = "bspc node -{c,k}";
"super + {_,shift + }{1-9,0}" = "bspc {desktop -f,node -d} 'focused:^{1-9,10}'";
"super + {h,j,k,l}" = "dir={west,south,north,east}; bspc node -f $dir || bspc monitor -f $dir";
"super + {o,i}" = "bspc wm -h off;bspc node {older,newer} -f;bspc wm -h on";
"super + {t,shift + t,s,f}" = "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}";
};
};
}