dotfiles

My PC Dotfiles & Website
commit f641bfca607195d8a9dff021a1a8094260df850d
parent 705d8a394a5892d052168c92693ac8a419cba0f4
Author: maydayv7 <maydayv7@gmail.com>
Date:   Tue, 30 Apr 2024 12:46:31 +0530

feat: Hyprland Shaders

Diffstat:

12 files changed, 96 insertions(+), 36 deletions(-)

diff --git a/README.md b/README.md @@ -101,6 +101,10 @@ github:maydayv7/dotfiles │ ├───default: app │ ├───install: app │ └───nixos: app +├───channels +│ └───x86_64-linux +│ ├───stable: package channel +│ └───unstable: package channel ├───checks │ └───x86_64-linux │ ├───Device-gnome: derivation 'nixos-rebuild' @@ -123,7 +127,7 @@ github:maydayv7/dotfiles │ └───x86_64-linux: package 'treefmt' ├───installMedia: device install media ├───legacyPackages -│ └───x86_64-linux: omitted (use '--legacy' to show) +│ └───x86_64-linux (References 'stable' channel) ├───lib: utility library functions ├───nixosConfigurations │ ├───futura: NixOS configuration @@ -508,6 +512,7 @@ You can navigate to the `README`s present in the various directories to know mor - Panel Improvements - Border Gradients - Revamp `hyprutils` Script + - Compositor Shaders - Use [`clipse`](https://github.com/savedra1/clipse) for Clipboard - Use amazing plugins - [Hycov](https://github.com/DreamMaoMao/hycov) diff --git a/files/hyprland/binds.pango b/files/hyprland/binds.pango @@ -1,24 +1,23 @@ -<span size="10.75pt"> -<b><big>Keyboard Shortcuts</big></b> <b><big>Mouse Actions</big></b> -<i>$mod -> SUPER</i> <i>L'/R' -> Left/Right Click</i> +<b><big>Keyboard Shortcuts</big></b> <b><big>Mouse Actions</big></b> +<i>$mod -> SUPER</i> <i>L'/R' -> Left/Right Click</i> -<tt>$mod Q</tt> Quit application <tt>$mod L'</tt> Move window -<tt>$mod P</tt> Pin window on all Workspaces <tt>$mod R'</tt> Window resize -<tt>$mod M</tt> Maximize window <tt>$mod CTRL L'</tt> Window resize -<tt>$mod SHIFT M</tt> Fullscreen window <tt>$mod SHIFT L'</tt> Move window into application group -<tt>ALT Q</tt> Minimize window -<tt>ALT SHIFT Q</tt> Activate previously minimized windows +<tt>$mod Q<i> or </i>ALT F4</tt> Quit application <tt>$mod L'</tt> Move window +<tt>ALT A</tt> Activate urgent/last window <tt>$mod R'</tt> Window resize +<tt>$mod [SHIFT] M</tt> Maximize [fullscreen] window <tt>$mod CTRL L'</tt> Window resize +<tt>ALT [SHIFT] Q</tt> Minimize [or bring back] window <tt>$mod SHIFT L'</tt> Move window into application group <tt>$mod <i>ARROW</i></tt> Switch focus to window in desired direction -<tt>$mod SHIFT <i>ARROW</i></tt> Swap current window with window in desired direction +<tt>$mod SHIFT <i>ARROW</i></tt> Swap current window with window in desired direction <tt>$mod Space</tt> Change window split direction -<tt>$mod SHIFT Space</tt> Toggle application grouping +<tt>$mod SHIFT Space</tt> Toggle application grouping +<tt>$mod ;<i> or </i>:</tt> Toggle window float for one/all window(s) +<tt>$mod C</tt> Center floating window <b><big>Submaps</big></b> +<tt>$mod P</tt> Pin floating window on all workspaces <i><tt>esc</tt> to reset</i> -<tt>$mod `</tt> Show workspace expose view -<tt>$mod [SHIFT] Tab</tt> Show workspace overview [for all monitors] +<tt>$mod `</tt> Show workspace expose view <b>Resize</b> <tt>$mod R</tt> +<tt>$mod [SHIFT] Tab</tt> Show workspace overview [for all monitors] <i>ARROW</i> Resize window in specified direction <tt>ALT [SHIFT] Tab</tt> Show application overview [for all workspaces] <tt>ALT <i>ARROW</i></tt> Switch to window in desired direction (in overview) <tt>ALT [SHIFT] Tab</tt> Cycle [backwards] through open applications -<tt>ALT CTRL Tab</tt> Activate urgent/last window <tt>ALT [SHIFT] `</tt> Cycle [backwards] through grouped applications <tt>$mod <i>NUM</i></tt> Create workspace '<i>NUM</i>' {1 to 9} @@ -26,17 +25,16 @@ <tt>$mod ,<i> or </i>.</tt> Move to previous/next non-empty workspace <tt>$mod 0</tt> Toggle special workspace to stash windows <tt>$mod SHIFT 0</tt> Move window to/from special workspace stash -<tt>$mod SHIFT ,<i> or </i>.</tt> Move window to previous/next workspace +<tt>$mod SHIFT ,<i> or </i>.</tt> Move window to previous/next workspace <tt>$mod ALT ,<i> or </i>.</tt> Move focus to left/right monitor <tt>$mod SHIFT ALT ,<i> or </i>.</tt> Move window to left/right monitor -<tt>Print</tt> Take Screenshot of area +<tt>Print</tt> Take Screenshot of area <tt>CTRL Print</tt> Take Screenshot of window <tt>SHIFT Print</tt> Take Screenshot of screen <tt>$mod =<i> or </i>-</tt> Zoom in/out -<tt>$mod ;<i> or </i>:</tt> Toggle window float for one/all window(s) -<tt>$mod C</tt> Center floating window <tt>$mod L<i> or </i>Esc</tt> Lock screen / System Logoff +<tt>$mod S</tt> Toggle Compositor Shader <tt>$mod ?</tt> Show this page <tt>$mod A</tt> Application Drawer @@ -50,4 +48,3 @@ <tt>$mod Enter</tt> Task Manager <tt>$mod N</tt> Show received notifications in order <tt>$mod /</tt> Application Launcher -</span> diff --git a/files/hyprland/pypr.toml b/files/hyprland/pypr.toml @@ -12,7 +12,7 @@ size = "75% 60%" [scratchpads.clip] animation = "fromBottom" -command = "kitty --class clipse clipse $PPID" +command = "kitty --class clipse sh -c 'clipse $PPID'" class = "clipse" lazy = true size = "75% 65%" diff --git a/modules/base/default.nix b/modules/base/default.nix @@ -56,7 +56,6 @@ in { # Essential Utilities environment.systemPackages = with pkgs; [ cryptsetup - gparted inxi killall man-pages diff --git a/modules/gui/desktop/hyprland/apps/default.nix b/modules/gui/desktop/hyprland/apps/default.nix @@ -38,6 +38,7 @@ in { font-manager geany gnome.file-roller + gnome.gnome-disk-utility hyprpicker lollypop mate.atril diff --git a/modules/gui/desktop/hyprland/apps/security.nix b/modules/gui/desktop/hyprland/apps/security.nix @@ -50,9 +50,9 @@ in { timeout = 330; command = "${pkgs.writeShellApplication { name = "suspend"; # Only suspend if no audio is playing - runtimeInputs = with pkgs; [pipewire ripgrep systemd]; + runtimeInputs = with pkgs; [pipewire gnugrep systemd]; text = '' - pw-cli i all | rg running + pw-cli i all | grep running if [ $? == 1 ]; then ${pkgs.systemd}/bin/systemctl suspend; fi ''; }}/bin/suspend"; diff --git a/modules/gui/desktop/hyprland/settings/default.nix b/modules/gui/desktop/hyprland/settings/default.nix @@ -47,7 +47,7 @@ in { binds = { workspace_center_on = 1; movefocus_cycles_fullscreen = true; - workspace_back_and_forth = false; + workspace_back_and_forth = true; }; gestures = { diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -20,8 +20,8 @@ "$mod, right, movefocus, r" "$mod, up, movefocus, u" "$mod, down, movefocus, d" - "ALT CTRL, Tab, focusurgentorlast" - "ALT CTRL, Tab, bringactivetotop," + "ALT, A, focusurgentorlast" + "ALT, A, bringactivetotop," # Window Swap "$mod SHIFT, left, swapwindow, l" @@ -134,12 +134,14 @@ submap = reset # Window Resize - bind = ALT, R, submap, resize + bind = $mod, R, submap, resize submap = resize binde = , right, resizeactive, 10 0 binde = , left, resizeactive, -10 0 binde = , up, resizeactive, 0 -10 binde = , down, resizeactive, 0 10 + bindm = , mouse:272, resizewindow + bindm = , mouse:273, movewindow bind = , escape, submap, reset submap = reset ''; diff --git a/modules/gui/desktop/hyprland/settings/plugins.nix b/modules/gui/desktop/hyprland/settings/plugins.nix @@ -8,8 +8,14 @@ ## Plugin Settings # Pyprland home = { - packages = [pkgs.unstable.pyprland]; - file.".config/hypr/pyprland.toml".text = files.hyprland.pypr; + packages = with pkgs; [hyprshade unstable.pyprland]; + file = { + ".config/hypr/pyprland.toml".text = files.hyprland.pypr; + ".config/hypr/shaders" = { + source = "${pkgs.custom.hyprland-shaders}/share/hypr/shaders"; + recursive = true; + }; + }; }; wayland.windowManager.hyprland = { @@ -74,6 +80,9 @@ # Expose "$mod, grave, hyprexpo:expo, toggle" + # Compositor Shaders + "$mod, S, exec, hyprutils toggle shader" + # Application Overview "ALT, Tab, hycov:toggleoverview" "ALT SHIFT, Tab, hycov:toggleoverview, forceall" diff --git a/packages/flake.nix b/packages/flake.nix @@ -66,7 +66,14 @@ in { unstable = import unstable { inherit system config; - overlays = overlays ++ [(_: _: {inherit (channels) stable;})]; + overlays = + overlays + ++ [ + (pkg: _: { + inherit (channels) stable; + unstable = pkg; + }) + ]; }; }; } diff --git a/packages/hyprland-shaders.nix b/packages/hyprland-shaders.nix @@ -0,0 +1,30 @@ +{ + lib, + pkgs, + ... +}: +with pkgs; + stdenv.mkDerivation { + pname = "hyprland-shaders"; + version = "v0.39"; + + src = fetchFromGitHub { + owner = "hyprland-community"; + repo = "awesome-hyprland"; + rev = "9978013d307fd205c6d61296bda3dfdb7e8282f1"; + sha256 = "sha256-giMv5+1WfEFc5jfwPSNxu6V+puWOyTfVpNVrd2aQvKE="; + }; + + dontBuild = true; + installPhase = '' + mkdir -p $out/share/hypr/shaders/ + find . -name \*.frag -exec cp {} $out/share/hypr/shaders/ \; + ''; + + meta = with lib; { + description = "Shaders for Hyprland"; + homepage = "https://github.com/hyprland-community/awesome-hyprland"; + license = licenses.cc0; + maintainers = ["maydayv7"]; + }; + } diff --git a/scripts/hyprutils.nix b/scripts/hyprutils.nix @@ -22,6 +22,7 @@ idle - Toggle Idle Daemon service media - Persist and toggle audio playing state monitor - Toggle specified Monitor + shader - Toggle Compositor Shader ''; in recursiveUpdate { @@ -35,15 +36,18 @@ in } (pkgs.writeShellApplication { name = "hyprutils"; runtimeInputs = with pkgs; [ - hyprworld.hyprland - coreutils dunst - gnugrep + gnome.zenity + hyprshade + hyprworld.hyprland + swayidle + alsa-utils brillo - playerctl + coreutils + gnugrep libnotify - swayidle + playerctl systemd wget ]; @@ -257,6 +261,12 @@ in hyprctl keyword monitor "$3, preferred, auto, 1" fi ;; + "shader") + hyprshade off + mapfile SHADERS < <(hyprshade ls) + SHADER=$(zenity --list --title="Compositor Shader Toggle" --column="Shaders" "''${SHADERS[@]}" | sed "s/^[ \t]*//") + hyprshade on "$SHADER" && hyprctl seterror "" + ;; "") error "Expected an Option" "Try 'hyprutils help' for more information" ;; *) error "Unexpected Option 'toggle $2'" "Try 'hyprutils help' for more information" ;; esac