diff --git a/modules/user/hyprland.nix b/modules/user/hyprland.nix index 2ef3705..271b9f6 100644 --- a/modules/user/hyprland.nix +++ b/modules/user/hyprland.nix @@ -1,17 +1,7 @@ -{ pkgs, lib, config, swww_flags, inputs, host ? null }: +{ pkgs, lib, config, inputs, host ? null }: let hyprLua = import ./hyprland/lua.nix { inherit lib; }; direction = { left = "l"; right = "r"; up = "u"; down = "d"; }; - wallpaper_changer = pkgs.writers.writePython3Bin "wallpaper_changer" { - libraries = [ pkgs.python3Packages.requests ]; - flakeIgnore = [ "E501" "E111" "E701" "E241" "E731" ]; - } /*py*/ '' - from random import choice - from os import system, listdir - folder = "${config.home.homeDirectory}/wallpapers" - filename = choice(listdir(folder)) - system(f"${lib.getExe pkgs.awww} img {folder}/{filename} ${swww_flags}") - ''; workspaceBinds = lib.concatMap (workspace: let key = if workspace == 10 then "0" else toString workspace; workspaceValue = toString workspace; in [ @@ -22,7 +12,6 @@ in { imports = lib.optional (host != null && builtins.pathExists ../../host/${host.name}/modules/hyprland.nix) ../../host/${host.name}/modules/hyprland.nix; home.packages = with pkgs; [ - wallpaper_changer ghostty pamixer wofi @@ -87,7 +76,6 @@ in { "wl-clip-persist --clipboard both" "clipse -listen" "${lib.getExe' pkgs.udiskie "udiskie"}" - "${lib.getExe wallpaper_changer}" ]) ]; bind = [ (hyprLua.bind "SUPER + V" (hyprLua.exec "ghostty --title=clipse -e clipse")) @@ -97,7 +85,6 @@ in { (hyprLua.bind "SUPER + E" (hyprLua.exec "ghostty -e sh -c yazi")) (hyprLua.bind "SUPER + F" "hl.dsp.window.float({ action = \"toggle\" })") (hyprLua.bind "SUPER + J" "hl.dsp.layout(\"togglesplit\")") - (hyprLua.bind "SUPER + W" (hyprLua.exec "${lib.getExe wallpaper_changer}")) (hyprLua.bind "SUPER + LEFT" "hl.dsp.focus({ direction = \"${direction.left}\" })") (hyprLua.bind "SUPER + RIGHT" "hl.dsp.focus({ direction = \"${direction.right}\" })") (hyprLua.bind "SUPER + UP" "hl.dsp.focus({ direction = \"${direction.up}\" })") diff --git a/modules/user/zsh.nix b/modules/user/zsh.nix index 09df9eb..3f43edd 100644 --- a/modules/user/zsh.nix +++ b/modules/user/zsh.nix @@ -89,13 +89,7 @@ rebuildFlake = "sudo nixos-rebuild switch --flake /home/kirill/.config/f --impure"; openFlake = "vim /home/kirill/.config/f/flake.nix"; swichWalls = "wallpaper_changer"; - screenshot_f="grimblast save screen ~/screenshot_$(date +\%Y-\%m-\%d_\%H-\%M-\%S).png"; - screenshot="grimblast save area ~/screenshot_$(date +\%Y-\%m-\%d_\%H-\%M-\%S).png"; - screenshot_c = "grimblast copy area"; - loginPostgresql = "sudo -u postgres psql"; - startShell = "nix-shell . --run zsh"; - VPN = "sudo openvpn --config /home/kirill/VPN/184.22.37.202_udp_1727.ovpn"; - play2Go = "ssh -i ~/.ssh/id_rsa_play2go.pub root@93.123.84.45"; + shell = "nix-shell . --run zsh"; testZapret = "sudo zapret-test-strategies"; }; @@ -103,6 +97,10 @@ eval "$(zoxide init zsh)" source "$(fzf-share)/key-bindings.zsh" source "$(fzf-share)/completion.zsh" + + run() { + nix run "nixpkgs#$1" + } ''; envExtra = '' diff --git a/user/kirill/modules/hyprland.nix b/user/kirill/modules/hyprland.nix index ce267c9..764fc2b 100644 --- a/user/kirill/modules/hyprland.nix +++ b/user/kirill/modules/hyprland.nix @@ -1,5 +1,16 @@ { pkgs, lib, config, inputs, host, ... }: -{ +let + wallpaper_changer = pkgs.writers.writePython3Bin "wallpaper_changer" { + libraries = [ pkgs.python3Packages.requests ]; + flakeIgnore = [ "E501" "E111" "E701" "E241" "E731" ]; + } /*py*/ '' + from random import choice + from os import system, listdir + folder = "${config.home.homeDirectory}/wallpapers" + filename = choice(listdir(folder)) + system(f"${lib.getExe pkgs.awww} img {folder}/{filename} --transition-type center") + ''; +in { imports = [( import ../../../modules/user/hyprland.nix { inherit lib; @@ -7,10 +18,11 @@ inherit config; inherit inputs; inherit host; - swww_flags = "--transition-type center"; } )]; + home.packages = [ wallpaper_changer ]; + wayland.windowManager.hyprland = let colors = config.lib.stylix.colors; hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; }; @@ -89,7 +101,12 @@ } ]; + on = [ + (hyprLua.onStart [ "${lib.getExe wallpaper_changer}" ]) + ]; + bind = [ + (hyprLua.bind "SUPER + W" (hyprLua.exec "${lib.getExe wallpaper_changer}")) (hyprLua.bind "SUPER + SHIFT + S" (hyprLua.exec "${lib.getExe pkgs.grimblast} --notify --freeze copy area")) (hyprLua.bind "F11" (hyprLua.exec "ghostty -e sh -c hyprlock")) ];