diff --git a/home-manager/programs/hyprland/default.nix b/home-manager/programs/hyprland/default.nix index 275f5c1..dffea38 100644 --- a/home-manager/programs/hyprland/default.nix +++ b/home-manager/programs/hyprland/default.nix @@ -38,7 +38,7 @@ extraConfig = (if config.homeconfig.host == "laptop" then '' bind = CTRL SHIFT, XF86Launch2, exec, bash -c 'if [[ $(hyprctl monitors | grep 0x0 | sed -n -e "s/\t*1920x1080@//" -e "s/.[1234567890]* at 0x0//p") == 300 ]]; then pkexec --user root /nix/var/nix/profiles/system/bin/switch-to-configuration switch; else pkexec --user root /nix/var/nix/profiles/system/specialisation/docked/bin/switch-to-configuration switch; fi' - bind = CTRL, XF86Launch2, exec, if [[ $(hyprctl monitors | grep 0x0 | sed -n -e "s/\t*1920x1080@//" -e "s/.[1234567890]* at 0x0//p") == 300 ]]; then hyprctl keyword monitor eDP-1,1920x1080@60,0x0,1; else hyprctl keyword monitor eDP-1,1920x1080@300,0x0,1; fi + bind = ALT, Escape, exec, if [[ $(hyprctl monitors | grep 0x0 | sed -n -e "s/\t*1920x1080@//" -e "s/.[1234567890]* at 0x0//p") == 300 ]]; then hyprctl keyword monitor eDP-1,1920x1080@60,0x0,1; else hyprctl keyword monitor eDP-1,1920x1080@300,0x0,1; fi '' else if config.homeconfig.host == "homebox" then '' monitor=HDMI-A-2,1920x1080@60,0x0,1 monitor=HEADLESS-2,1920x1080@60,0x0,1 diff --git a/home-manager/users/nathan/dotfiles/hypr/main.conf b/home-manager/users/nathan/dotfiles/hypr/main.conf index 635bf98..c441ff7 100644 --- a/home-manager/users/nathan/dotfiles/hypr/main.conf +++ b/home-manager/users/nathan/dotfiles/hypr/main.conf @@ -20,10 +20,10 @@ source = ~/.cache/wal/colors-hypr.conf # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { - kb_layout = us + kb_layout = us,jp kb_variant = kb_model = - kb_options = + kb_options = grp:caps_toggle kb_rules = follow_mouse = 1 @@ -48,7 +48,7 @@ general { col.active_border = $color1 $color5 100deg col.inactive_border = $color0 - layout = dwindle + layout = master } decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more @@ -101,12 +101,19 @@ gestures { misc { disable_hyprland_logo = false disable_splash_rendering = true - force_default_wallpaper = 2 + force_default_wallpaper = 0 +} + +ecosystem { + no_update_news = true + no_donation_nag = true } # Binds $mainMod = ALT +bind = $mainMod SHIFT, H, exec, colorPrefix kitty -e "hyprctl binds | less" + bind = $mainMod SHIFT, E, exec, colorPrefix kitty bind = $mainMod, B, exec, firefox @@ -122,7 +129,7 @@ bind = $mainMod SHIFT, R, exec, colorPrefix kitty -e _homeRebuild bind = $mainMod, F, exec, thunar bind = $mainMod SHIFT, F, fullscreen -bind = $mainMod, semicolon, exec, colorPrefix kitty -e nvim ~ +bind = $mainMod SHIFT, semicolon, exec, colorPrefix kitty -e lf bind = $mainMod, Insert, exec, libreoffice @@ -134,9 +141,11 @@ bind = , Menu, exec, rofi -show drun bind = $mainMod, Menu, exec, hyprpanel -q; hyprpanel -bind = $mainMod, P, pseudo, # dwindle +#bind = $mainMod, P, pseudo, # dwindle +#bind = $mainMod, Z, togglesplit, # dwindle -bind = $mainMod, Z, togglesplit, # dwindle +bind = $mainMod, N, rollnext, # master +bind = $mainMod, P, rollprev, # master bind = $mainMod, M, exec, spotify @@ -166,10 +175,10 @@ bind = $mainMod, Return, exec, discord --enable-features=UseOzonePlatform --ozon bind = $mainMod CTRL, Return, exec, firefox https://discord.com/app # Move focus with mainMod + arrow keys -bind = $mainMod, H, movefocus, l -bind = $mainMod, L, movefocus, r -bind = $mainMod, J, movefocus, u -bind = $mainMod, K, movefocus, d +bind = $mainMod, W, movefocus, u +bind = $mainMod, A, movefocus, l +bind = $mainMod, S, movefocus, d +bind = $mainMod, D, movefocus, r # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 @@ -202,6 +211,24 @@ bind = $mainMod SHIFT, Home, movetoworkspace, 11 bind = $mainMod, right, workspace, e+1 bind = $mainMod, left, workspace, e-1 +bind = $mainMod, H, exec, hyprctl keyword animation workspaces,1,6,default +bind = $mainMod, H, workspace, e-1 +bind = $mainMod, J, exec, hyprctl keyword animation workspaces,1,6,default,slidevert +bind = $mainMod, J, workspace, e+1 +bind = $mainMod, K, exec, hyprctl keyword animation workspaces,1,6,default,slidevert +bind = $mainMod, K, workspace, e-1 +bind = $mainMod, L, exec, hyprctl keyword animation workspaces,1,6,default +bind = $mainMod, L, workspace, e+1 + +bind = $mainMod SHIFT, H, exec, hyprctl keyword animation workspaces,1,6,default +bind = $mainMod SHIFT, H, movetoworkspace, e-1 +bind = $mainMod SHIFT, J, exec, hyprctl keyword animation workspaces,1,6,default,slidevert +bind = $mainMod SHIFT, J, movetoworkspace, e+1 +bind = $mainMod SHIFT, K, exec, hyprctl keyword animation workspaces,1,6,default,slidevert +bind = $mainMod SHIFT, K, movetoworkspace, e-1 +bind = $mainMod SHIFT, L, exec, hyprctl keyword animation workspaces,1,6,default +bind = $mainMod SHIFT, L, movetoworkspace, e+1 + #switch network connections bind = CTRL SHIFT, Escape, exec, nmcli device down wlo1 bind = CTRL SHIFT, 0, exec, nmcli connection up Hotspot @@ -227,10 +254,11 @@ bind = CTRL ALT, Delete, exec, loginctl kill-session self # Move/resize windows with mainMod + LMB/RMB and dragging -bind = $mainMod SHIFT, J, movewindow, u -bind = $mainMod SHIFT, K, movewindow, d -bind = $mainMod SHIFT, H, movewindow, l -bind = $mainMod SHIFT, L, movewindow, r +bind = $mainMod SHIFT, W, movewindow, u +bind = $mainMod SHIFT, A, movewindow, l +bind = $mainMod SHIFT, S, movewindow, d +bind = $mainMod SHIFT, D, movewindow, r + bindm = $mainMod, mouse:272, movewindow bindm = $mainMod SHIFT, mouse:272, resizewindow @@ -251,7 +279,7 @@ windowrulev2 = float, $cal windowrulev2 = $scratchpadsize, $cal windowrulev2 = workspace special silent, $cal -bind = $mainMod, N, exec, colorPrefix pypr toggle lf +bind = $mainMod, semicolon, exec, colorPrefix pypr toggle lf bind = $mainMod, E, exec, colorPrefix pypr toggle kitty bind = $mainMod, C, exec, colorPrefix pypr toggle calendar diff --git a/home-manager/users/nathan/packages/scripts/default.nix b/home-manager/users/nathan/packages/scripts/default.nix index fcddd55..287c625 100644 --- a/home-manager/users/nathan/packages/scripts/default.nix +++ b/home-manager/users/nathan/packages/scripts/default.nix @@ -19,23 +19,31 @@ (pkgs.writeShellScriptBin "randWallpaper" '' - file=$(ls ${config.home.homeDirectory}/Pictures/Wallpaper/ | shuf -n 1) - setWallpaper ${config.home.homeDirectory}/Pictures/Wallpaper/$file + file=''$(ls ${config.home.homeDirectory}/Pictures/Wallpaper/ | shuf -n 1) + setWallpaper ${config.home.homeDirectory}/Pictures/Wallpaper/''$file '') (pkgs.writeShellScriptBin "setWallpaper" '' + if [[ ! -d /tmp/nathan ]]; then mkdir /tmp/nathan fi - if [[ ! -f /tmp/nathan/bg ]]; then - cp ${config.home.homeDirectory}/Pictures/Wallpaper/bluescape.jpg /tmp/nathan/bg - chmod 600 /tmp/nathan/bg + img=''$(realpath ''${''$1:-${config.home.homeDirectory}/Pictures/Wallpaper/''$(${pkgs.eza}/bin/eza ${config.home.homeDirectory}/Pictures/Wallpaper -X | rofi -dmenu))} + ext="''${''$(basename ''$img)\##*.}" + + if [[ ''$ext == "gif" || ''$ext == "mp4" ]]; then + ${pkgs.ffmpeg}/bin/ffmpeg -i ''$img -vframes 1 /tmp/nathan/tmp.jpg + ${pkgs.swww}/bin/swww img /tmp/nathan/tmp.jpg -t wipe + sleep 0.3 + hyprctl dispatch exec "${pkgs.mpvpaper}/bin/mpvpaper ALL ''$img -o loop" + else + + hyprctl dispatch exec ${pkgs.swww}/bin/swww img ''$img -t wipe fi - img=''$(realpath ''${1:-/tmp/nathan/bg}) - hyprctl dispatch exec ${pkgs.swww}/bin/swww img ''$img -t random + ${pkgs.hyprpanel}/bin/hyprpanel sw ''$img - changeColors ''$img ''$2 + changeColors ''$img '') (pkgs.writeShellScriptBin "changeColors" '' @@ -44,43 +52,40 @@ mkdir /tmp/nathan fi - if [[ ! -f /tmp/nathan/bg ]]; then - cp ${config.home.homeDirectory}/Pictures/Wallpaper/bluescape.jpg /tmp/nathan/bg - chmod 600 /tmp/nathan/bg + if [[ -f /tmp/nathan/colorscheme && -z ''$1 ]]; then + ${pkgs.pywal16}/bin/wal -f /tmp/nathan/colorscheme + else + img=''$(realpath ''$1) + alpha=''${2:-70} + + if [[ ''$alpha -lt 0 ]]; then + ''$alpha=0 + elif [[ ''$alpha -gt 100 ]]; then + ''$alpha=100 + fi fi - if [[ ! -f /tmp/nathan/bga ]]; then - echo 70 > /tmp/nathan/bga + if [[ -f "${config.home.homeDirectory}/.config/wal/colorschemes/''${''$(basename ''$img)}-''$alpha" ]]; then + ${pkgs.pywal16}/bin/wal -f "${config.home.homeDirectory}/.config/wal/colorschemes/''${''$(basename ''$img)}-''$alpha" + else + ${pkgs.pywal16}/bin/wal -i ''$img -a ''$alpha --cols16 -n -p "''${''$(basename ''$img)}-''$alpha" fi - alpha=''${2:-`cat /tmp/nathan/bga`} - - img=''$(realpath ''${1:-/tmp/nathan/bg}) + cp "${config.home.homeDirectory}/.config/wal/colorschemes/''${''$(basename ''$img)}-''$alpha" /tmp/nathan/colorscheme - if [[ $alpha -lt 0 ]]; then - $alpha=0 - fi - - if [[ $alpha -gt 100 ]]; then - $alpha=100 - fi - - ${pkgs.pywal16}/bin/wal -i $img -a $alpha --cols16 -n - - echo $alpha > /tmp/nathan/bga - cp $img /tmp/nathan/bg - - sleep 0.4 - - ${pkgs.pywalfox-native}/bin/pywalfox update & - - [[ $(pidof cava) != "" ]] && pkill -USR1 cava & - - for i in $(ls /run/user/1000 | grep nvim); do ${pkgs.neovim-remote}/bin/nvr -s --servername /run/user/1000/$i --remote-send 'colorscheme pywal'; done - - pkill -USR1 kitty + colorPrefix '') + (pkgs.writeShellScriptBin "colorPrefix" '' + exec -a "$0" "$@" & + sleep 0.4 + ${pkgs.pywalfox-native}/bin/pywalfox update & + pkill -USR1 kitty + pidof cava && pkill -USR1 cava + for i in ''$(ls /run/user/1000 | grep nvim); do + ${pkgs.neovim-remote}/bin/nvr -s --servername /run/user/1000/''$i --remote-send 'colorscheme pywal'; + done + '') (pkgs.writeShellScriptBin "onSystemStart" '' @@ -88,37 +93,24 @@ mkdir /tmp/nathan fi - if [[ ! -f /tmp/nathan/bg ]]; then - cp ${config.home.homeDirectory}/Pictures/Wallpaper/bluescape.jpg /tmp/nathan/bg - chmod 600 /tmp/nathan/bg - fi - - if [[ ! -f /tmp/nathan/bga ]]; then - echo 70 > /tmp/nathan/bga - fi - if [[ -f ${config.home.homeDirectory}/.local/share/calcurse/.calcurse.pid ]]; then rm ${config.home.homeDirectory}/.local/share/calcurse/.calcurse.pid fi - hyprctl dispatch exec ${pkgs.swww}/bin/swww-daemon - hyprctl dispatch exec "setWallpaper /tmp/nathan/bg" + hyprctl --batch "\ + dispatch exec ${pkgs.swww}/bin/swww-daemon\ + dispatch exec setWallpaper /tmp/nathan/bg\ - hyprctl dispatch exec ${pkgs.pyprland}/bin/pypr - hyprctl dispatch exec ${pkgs.netbird-ui}/bin/netbird-ui - hyprctl dispatch exec ${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent - hyprctl setcursor Bibata-Modern-Classic 16 + dispatch exec ${pkgs.pyprland}/bin/pypr\ + dispatch exec ${pkgs.netbird-ui}/bin/netbird-ui\ + dispatch exec ${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent\ + setcursor Bibata-Modern-Classic 16" sleep 3 hyprctl reload hyprctl dispatch exec ${pkgs.pyprland}/bin/pypr toggle calendar #tmux new-session -s hyprland '') - (pkgs.writeShellScriptBin "colorPrefix" '' - exec -a "$0" "$@" & - sleep 0.4 && changeColors & - '') - ] ++ (if config.homeconfig.standalone.enable then [ (pkgs.writeShellScriptBin "_homeRebuild" ''