diff --git a/flake.lock b/flake.lock index 8bacf94..ac9463d 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ ] }, "locked": { - "lastModified": 1723405438, - "narHash": "sha256-bpmC2m7OhlDvqgQZdZ2jBLyeIkq/Jld3X4bqRAxBSp8=", + "lastModified": 1722347739, + "narHash": "sha256-rAoh+K6KG+b1DwSWtqRVocdojnH6nGk6q07mNltoUSM=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "9312aa28271c91e5d67ecb9def527b2bbcff0e66", + "rev": "7c3565f9bedc7cb601cc0baa14792247e4dc1d5a", "type": "github" }, "original": { @@ -568,11 +568,11 @@ ] }, "locked": { - "lastModified": 1722623071, - "narHash": "sha256-sLADpVgebpCBFXkA1FlCXtvEPu1tdEsTfqK1hfeHySE=", + "lastModified": 1721330371, + "narHash": "sha256-aYlHTWylczLt6ERJyg6E66Y/XSCbVL7leVcRuJmVbpI=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "912d56025f03d41b1ad29510c423757b4379eb1c", + "rev": "4493a972b48f9c3014befbbf381ed5fff91a65dc", "type": "github" }, "original": { @@ -616,17 +616,16 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1723484486, - "narHash": "sha256-YRU0egH+7Wv2Ehln0Q7bjdVayJ8rQxrTmuf23oJ/bQ4=", - "ref": "refs/heads/main", - "rev": "c7b72790bd63172f04ee86784d4cb2a400532927", - "revCount": 5082, + "lastModified": 1723058230, + "narHash": "sha256-deu8zvgseDg2gQEnZiCda4TrbA6pleE9iItoZlsoMtE=", + "rev": "9a09eac79b85c846e3a865a9078a3f8ff65a9259", + "revCount": 5069, "submodules": true, "type": "git", "url": "https://code.hyprland.org/hyprwm/Hyprland.git" }, "original": { - "rev": "c7b72790bd63172f04ee86784d4cb2a400532927", + "rev": "9a09eac79b85c846e3a865a9078a3f8ff65a9259", "submodules": true, "type": "git", "url": "https://code.hyprland.org/hyprwm/Hyprland.git" @@ -757,16 +756,16 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1721822339, - "narHash": "sha256-dkhgyxPxmOI/ZHk/LZRQZAVjtk9kPx2RFQRnuEoXQ4s=", + "lastModified": 1722882121, + "narHash": "sha256-gr4mN6BYKqy9JDr/ygDlMGYvEYBCMTDDDVnGNp/EYuw=", "ref": "refs/heads/main", - "rev": "58e1a4a4997728be886a46d031514b3f09763c5d", - "revCount": 234, + "rev": "9393a3e94d837229714e28041427709756033f5a", + "revCount": 242, "type": "git", "url": "https://code.hyprland.org/hyprwm/hyprlock.git" }, "original": { - "rev": "58e1a4a4997728be886a46d031514b3f09763c5d", + "rev": "9393a3e94d837229714e28041427709756033f5a", "type": "git", "url": "https://code.hyprland.org/hyprwm/hyprlock.git" } @@ -783,11 +782,11 @@ ] }, "locked": { - "lastModified": 1722869141, - "narHash": "sha256-0KU4qhyMp441qfwbirNg3+wbm489KnEjXOz2I/RbeFs=", + "lastModified": 1722098849, + "narHash": "sha256-D3wIZlBNh7LuZ0NaoCpY/Pvu+xHxIVtSN+KkWZYvvVs=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "0252fd13e78e60fb0da512a212e56007515a49f7", + "rev": "5dcbbc1e3de40b2cecfd2007434d86e924468f1f", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d912795..d1d90b5 100644 --- a/flake.nix +++ b/flake.nix @@ -227,7 +227,7 @@ type = "git"; url = "https://code.hyprland.org/hyprwm/Hyprland.git"; submodules = true; - rev = "c7b72790bd63172f04ee86784d4cb2a400532927"; #v0.42.0 + rev = "9a09eac79b85c846e3a865a9078a3f8ff65a9259"; #v0.42.0 inputs.nixpkgs.follows = "nixpkgs"; }; hyprland-plugins = { @@ -239,7 +239,7 @@ hyprlock = { type = "git"; url = "https://code.hyprland.org/hyprwm/hyprlock.git"; - rev = "58e1a4a4997728be886a46d031514b3f09763c5d"; + rev = "9393a3e94d837229714e28041427709756033f5a"; inputs.nixpkgs.follows = "nixpkgs"; }; hyprgrass.url = "github:horriblename/hyprgrass/0bb3b822053c813ab6f695c9194089ccb5186cc3"; diff --git a/system/hardware/power.nix b/system/hardware/power.nix index 4c0b58c..d07772f 100644 --- a/system/hardware/power.nix +++ b/system/hardware/power.nix @@ -6,42 +6,23 @@ settings = { CPU_SCALING_GOVERNOR_ON_AC = "performance"; CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - CPU_ENERGY_PERF_POLICY_ON_BAT = "balance"; - CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance"; - CPU_DRIVER_OPMODE_ON_AC = "active"; - CPU_DRIVER_OPMODE_ON_BAT = "active"; - WIFI_PWR_ON_AC = "on"; - WIFI_PWR_ON_BAT = "on"; - RUNTIME_PM_ON_AC = "auto"; - RUNTIME_PM_ON_BAT = "auto"; + CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; - CPU_MIN_PERF_ON_AC = 10; - CPU_MAX_PERF_ON_AC = 90; - CPU_MIN_PERF_ON_BAT = 10; + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; CPU_MAX_PERF_ON_BAT = 50; CPU_BOOST_ON_AC = 1; CPU_BOOST_ON_BAT = 0; - CPU_HWP_DYN_BOOST_ON_AC = 1; - CPU_HWP_DYN_BOOST_ON_BAT = 0; START_CHARGE_THRESH_BAT0 = 75; STOP_CHARGE_THRESH_BAT0 = 80; - MEM_SLEEP_ON_AC = "deep"; - MEM_SLEEP_ON_BAT = "deep"; - PLATFORM_PROFILE_ON_AC = "performance"; - PLATFORM_PROFILE_ON_BAT = "low-power"; - - RADEON_DPM_STATE_ON_AC = "performance"; - RADEON_DPM_STATE_ON_BAT = "battery"; - RADEON_POWER_PROFILE_ON_AC = "high"; - RADEON_POWER_PROFILE_ON_BAT = "low"; - - INTEL_GPU_MIN_FREQ_ON_AC = 250; - INTEL_GPU_MIN_FREQ_ON_BAT = 250; + PLATFORM_PROFILE_ON_BAT = "balanced"; }; }; diff --git a/user/wm/hyprland/hyprland.nix b/user/wm/hyprland/hyprland.nix index 3629e96..12db04f 100644 --- a/user/wm/hyprland/hyprland.nix +++ b/user/wm/hyprland/hyprland.nix @@ -50,10 +50,12 @@ in exec-once = hyprprofile Default exec-once = emacs --daemon + exec-once = pypr exec-once = ydotoold #exec-once = STEAM_FRAME_FORCE_CLOSE=1 steam -silent exec-once = nm-applet exec-once = blueman-applet + exec-once = hypr-element-start exec-once = GOMAXPROCS=1 syncthing --no-browser exec-once = protonmail-bridge --noninteractive exec-once = waybar @@ -80,7 +82,6 @@ in animation = fade, 1, 10, default animation = workspaces, 1, 5, wind animation = windows, 1, 6, wind, slide - animation = specialWorkspace, 1, 6, default, slidefadevert -50% } general { @@ -179,7 +180,7 @@ in bindm=SUPER,mouse:272,movewindow bindm=SUPER,mouse:273,resizewindow bind=SUPER,T,togglefloating - bind=SUPER,G,exec,hyprctl dispatch focusworkspaceoncurrentmonitor 9 && pegasus-fe; + bind=SUPER,G,exec,hyprctl dispatch focusworkspaceoncurrentmonitor 9; pegasus-fe; bind=,code:148,exec,''+ userSettings.term + " "+''-e numbat bind=,code:107,exec,grim -g "$(slurp)" @@ -241,50 +242,23 @@ in bind=SUPERSHIFT,8,movetoworkspace,8 bind=SUPERSHIFT,9,movetoworkspace,9 - bind=SUPER,Z,exec,if hyprctl clients | grep scratch_term; then echo "scratch_term respawn not needed"; else alacritty --class scratch_term; fi - bind=SUPER,Z,togglespecialworkspace,scratch_term - bind=SUPER,F,exec,if hyprctl clients | grep scratch_ranger; then echo "scratch_ranger respawn not needed"; else kitty --class scratch_ranger -e ranger; fi - bind=SUPER,F,togglespecialworkspace,scratch_ranger - bind=SUPER,N,exec,if hyprctl clients | grep scratch_numbat; then echo "scratch_ranger respawn not needed"; else alacritty --class scratch_numbat -e numbat; fi - bind=SUPER,N,togglespecialworkspace,scratch_numbat - bind=SUPER,M,exec,if hyprctl clients | grep lollypop; then echo "scratch_ranger respawn not needed"; else lollypop; fi - bind=SUPER,M,togglespecialworkspace,scratch_music - bind=SUPER,B,exec,if hyprctl clients | grep scratch_btm; then echo "scratch_ranger respawn not needed"; else alacritty --class scratch_btm -e btm; fi - bind=SUPER,B,togglespecialworkspace,scratch_btm - bind=SUPER,D,exec,if hyprctl clients | grep Element; then echo "scratch_ranger respawn not needed"; else element-desktop; fi - bind=SUPER,D,togglespecialworkspace,scratch_element - bind=SUPER,code:172,exec,togglespecialworkspace,scratch_pavucontrol - bind=SUPER,code:172,exec,if hyprctl clients | grep pavucontrol; then echo "scratch_ranger respawn not needed"; else pavucontrol; fi - + bind=SUPER,Z,exec,pypr toggle term && hyprctl dispatch bringactivetotop + bind=SUPER,F,exec,pypr toggle ranger && hyprctl dispatch bringactivetotop + bind=SUPER,N,exec,pypr toggle numbat && hyprctl dispatch bringactivetotop + bind=SUPER,M,exec,pypr toggle music && hyprctl dispatch bringactivetotop + bind=SUPER,B,exec,pypr toggle btm && hyprctl dispatch bringactivetotop + bind=SUPER,D,exec,hypr-element + bind=SUPER,code:172,exec,pypr toggle pavucontrol && hyprctl dispatch bringactivetotop $scratchpadsize = size 80% 85% - $scratch_term = class:^(scratch_term)$ - windowrulev2 = float,$scratch_term - windowrulev2 = $scratchpadsize,$scratch_term - windowrulev2 = workspace special:scratch_term ,$scratch_term - windowrulev2 = center,$scratch_term - - $scratch_ranger = class:^(scratch_ranger)$ - windowrulev2 = float,$scratch_ranger - windowrulev2 = $scratchpadsize,$scratch_ranger - windowrulev2 = workspace special:scratch_ranger silent,$scratch_ranger - windowrulev2 = center,$scratch_ranger - - $scratch_numbat = class:^(scratch_numbat)$ - windowrulev2 = float,$scratch_numbat - windowrulev2 = $scratchpadsize,$scratch_numbat - windowrulev2 = workspace special:scratch_numbat silent,$scratch_numbat - windowrulev2 = center,$scratch_numbat - - $scratch_btm = class:^(scratch_btm)$ - windowrulev2 = float,$scratch_btm - windowrulev2 = $scratchpadsize,$scratch_btm - windowrulev2 = workspace special:scratch_btm silent,$scratch_btm - windowrulev2 = center,$scratch_btm + $scratchpad = class:^(scratchpad)$ + windowrulev2 = float,$scratchpad + windowrulev2 = $scratchpadsize,$scratchpad + windowrulev2 = workspace special silent,$scratchpad + windowrulev2 = center,$scratchpad windowrulev2 = float,class:^(Element)$ windowrulev2 = size 85% 90%,class:^(Element)$ - windowrulev2 = workspace special:scratch_element silent,class:^(Element)$ windowrulev2 = center,class:^(Element)$ windowrulev2 = float,class:^(lollypop)$ @@ -296,7 +270,7 @@ in windowrulev2 = size 70% 75%,$savetodisk windowrulev2 = center,$savetodisk - $pavucontrol = class:^(org.pulseaudio.pavucontrol)$ + $pavucontrol = class:^(pavucontrol)$ windowrulev2 = float,$pavucontrol windowrulev2 = size 86% 40%,$pavucontrol windowrulev2 = move 50% 6%,$pavucontrol @@ -337,8 +311,8 @@ in layerrule = animation fade,~nwggrid blurls = ~nwggrid - bind=SUPER,equal, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | grep float | awk '{print $2 + 0.5}')" - bind=SUPER,minus, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | grep float | awk '{print $2 - 0.5}')" + bind=SUPER,code:21,exec,pypr zoom + bind=SUPER,code:21,exec,hyprctl reload bind=SUPER,I,exec,networkmanager_dmenu bind=SUPER,P,exec,keepmenu @@ -427,6 +401,14 @@ in noDisplay = true; icon = "/home/"+userSettings.username+"/.local/share/pixmaps/hyprland-logo-stylix.svg"; }) + (pyprland.overrideAttrs (oldAttrs: { + src = fetchFromGitHub { + owner = "hyprland-community"; + repo = "pyprland"; + rev = "refs/tags/2.4.0"; + hash = "sha256-jK6ap/beiqAtZXVNqPB3zV8R2Kfc3LhqJBvFlWYIfb4="; + }; + })) (hyprnome.override (oldAttrs: { rustPlatform = oldAttrs.rustPlatform // { buildRustPackage = args: oldAttrs.rustPlatform.buildRustPackage (args // { @@ -492,6 +474,19 @@ in nwg-dock-hyprland -f -x -i 64 -nolauncher -a start -ml 8 -mr 8 -mb 8 fi '') + (pkgs.writeScriptBin "hypr-element-start" '' + #!/usr/bin/env sh + sleep 6 && element-desktop --hidden + '') + (pkgs.writeScriptBin "hypr-element" '' + #!/bin/sh + if hyprctl clients | grep "class: Element" > /dev/null + then + hyprctl dispatch closewindow Element + else + element-desktop + fi + '') (pkgs.writeScriptBin "sct" '' #!/bin/sh killall wlsunset &> /dev/null; @@ -604,19 +599,17 @@ in ignore_dbus_inhibit = false } - # FIXME memory leak fries computer inbetween dpms off and suspend - #listener { - # timeout = 150 # in seconds - # on-timeout = hyprctl dispatch dpms off - # on-resume = hyprctl dispatch dpms on - #} listener { - timeout = 165 # in seconds + timeout = 150 # in seconds + on-timeout = hyprctl dispatch dpms off + on-resume = hyprctl dispatch dpms on + } + listener { + timeout = 160 # in seconds on-timeout = loginctl lock-session } listener { - timeout = 180 # in seconds - #timeout = 5400 # in seconds + timeout = 5400 # in seconds on-timeout = systemctl suspend on-resume = hyprctl dispatch dpms on } @@ -708,6 +701,36 @@ in valign = center } ''; + home.file.".config/hypr/pyprland.toml".text = '' + [pyprland] + plugins = ["scratchpads", "magnify"] + + [scratchpads.term] + command = "alacritty --class scratchpad" + margin = 50 + + [scratchpads.ranger] + command = "kitty --class scratchpad -e ranger" + margin = 50 + + [scratchpads.numbat] + command = "alacritty --class scratchpad -e numbat" + margin = 50 + + [scratchpads.music] + command = "lollypop" + margin = 50 + + [scratchpads.btm] + command = "alacritty --class scratchpad -e btm" + margin = 50 + + [scratchpads.pavucontrol] + command = "pavucontrol" + margin = 50 + unfocus = "hide" + animation = "fromTop" + ''; services.swayosd.enable = true; services.swayosd.topMargin = 0.5; programs.waybar = { @@ -941,7 +964,7 @@ in "car" = ""; "default" = [ "" "" "" ]; }; - "on-click" = "hyprctl dispatch togglespecialworkspace scratch_pavucontrol; if hyprctl clients | grep pavucontrol; then echo 'scratch_ranger respawn not needed'; else pavucontrol; fi"; + "on-click" = "pypr toggle pavucontrol && hyprctl dispatch bringactivetotop"; }; "pulseaudio#text" = { "scroll-step" = 1; @@ -951,7 +974,7 @@ in "format-muted" = ""; "format-source" = "{volume}%"; "format-source-muted" = ""; - "on-click" = "hyprctl dispatch togglespecialworkspace scratch_pavucontrol; if hyprctl clients | grep pavucontrol; then echo 'scratch_ranger respawn not needed'; else pavucontrol; fi"; + "on-click" = "pypr toggle pavucontrol && hyprctl dispatch bringactivetotop"; }; "group/pulseaudio" = { "orientation" = "horizontal";