dotfiles

My PC Dotfiles & Website
commit 795bb94b65b6e3f23e1ddd50e393ff08d62989b8
parent 37cea61cc36e4a867e4df465a26b720d79a536e4
Author: maydayv7 <maydayv7@gmail.com>
Date:   Tue, 20 Feb 2024 18:32:04 +0530

feat(Hyprland): Add App Drawer

Also update firmware definition

Diffstat:

Mdevices/futura.nix | 2+-
Mdevices/vortex.nix | 1+
Mfiles/README.md | 1+
Mfiles/flake.nix | 3+++
Afiles/nwg/drawer.css | 26++++++++++++++++++++++++++
Mfiles/waybar/style.css | 5+++++
Mflake.lock | 8++++----
Mmodules/base/firmware.nix | 11-----------
Mmodules/gui/desktop/hyprland/README.md | 17+++++++++--------
Mmodules/gui/desktop/hyprland/apps/bar.nix | 10+++++++++-
Mmodules/gui/desktop/hyprland/apps/default.nix | 17+++++++++++++----
Mmodules/gui/desktop/hyprland/apps/rules.nix | 4+---
Mmodules/gui/desktop/hyprland/settings/keybindings.nix | 16++++++++--------
Apackages/nwg-drawer.nix | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
14 files changed, 135 insertions(+), 40 deletions(-)

diff --git a/devices/futura.nix b/devices/futura.nix @@ -13,7 +13,7 @@ cpu.cores = 4; filesystem = "simple"; support = ["laptop"]; - modules = ["common-cpu-intel" "common-pc" "common-pc-laptop"]; + modules = ["common-pc" "common-pc-laptop" "common-cpu-intel" "common-gpu-intel"]; }; gui.desktop = "xfce"; diff --git a/devices/vortex.nix b/devices/vortex.nix @@ -9,6 +9,7 @@ kernel = "xanmod_latest"; kernelModules = ["nvme" "thunderbolt"]; + imports = [{services.fwupd.enable = true;}]; hardware = { boot = "secure"; filesystem = "advanced"; diff --git a/files/README.md b/files/README.md @@ -13,6 +13,7 @@ The `files` directory is used to store all my plain-text program configuration f - [`images`](./images) - Personal Wallpapers and Profile Pictures - [`nano`](./nano) - `nano` Text Editor Global Configuration - [`neofetch`](./neofetch) - `neofetch` CLI Theming +- [`nwg`](./nwg) - [NWG Shell](https://nwg-piotr.github.io/nwg-shell/) Configuration - [`pantheon`](./pantheon) - Configuration Files for Pantheon Desktop - [`plank`](./plank) - `plank` Dock Theming - [`proprietary`](https://github.com/maydayv7/proprietary) - Custom Proprietary Files diff --git a/files/flake.nix b/files/flake.nix @@ -91,6 +91,9 @@ # Nano Text Editor nano = readFile ./nano/nanorc; + # NWG Shell + nwg.drawer = readFile ./nwg/drawer.css; + # Interactive Nix Shell repl = ./repl.nix; diff --git a/files/nwg/drawer.css b/files/nwg/drawer.css @@ -0,0 +1,26 @@ +/* nwg-drawer Styling */ + +window { + background-color: transparent; +} + +button, +image { + background: none; + border: none; +} + +button:hover { + background-color: rgba (255, 255, 255, 0.1); +} + +#pinned-box { + padding-bottom: 5px; + border-bottom: 1px dotted gray; +} + +#files-box { + padding: 5px; + border: 1px dotted gray; + border-radius: 10px; +} diff --git a/files/waybar/style.css b/files/waybar/style.css @@ -56,6 +56,10 @@ window#waybar { color: @base0A; } +#custom-power { + color: @base08; +} + #mpris { color: @base00; background-color: @base05; @@ -84,6 +88,7 @@ window#waybar { #clock, #custom-dunst, #custom-logo, +#custom-power, #custom-weather, #keyboard-state, #mpris, diff --git a/flake.lock b/flake.lock @@ -506,11 +506,11 @@ }, "hardware": { "locked": { - "lastModified": 1706182238, - "narHash": "sha256-Ti7CerGydU7xyrP/ow85lHsOpf+XMx98kQnPoQCSi1g=", - "owner": "nixos", + "lastModified": 1708431491, + "narHash": "sha256-X5S/aZMyKYynpFNquXoSmaLt483skMuo2Y6W3o4OZWM=", + "owner": "maydayv7", "repo": "nixos-hardware", - "rev": "f84eaffc35d1a655e84749228cde19922fcf55f1", + "rev": "8d8c40d27af343a14db027fc66cc6113b2945907", "type": "github" }, "original": { diff --git a/modules/base/firmware.nix b/modules/base/firmware.nix @@ -1,7 +1,6 @@ { lib, inputs, - pkgs, ... }: { imports = [inputs.gaming.nixosModules.pipewireLowLatency]; @@ -11,20 +10,10 @@ # Drivers hardware = { opengl.enable = true; - cpu.intel.updateMicrocode = true; enableRedistributableFirmware = true; pulseaudio.enable = lib.mkForce false; }; - # Driver Packages - services.fwupd.enable = true; - hardware.opengl.extraPackages = with pkgs; [ - intel-media-driver - libvdpau-va-gl - vaapiIntel - vaapiVdpau - ]; - # Audio sound = { enable = true; diff --git a/modules/gui/desktop/hyprland/README.md b/modules/gui/desktop/hyprland/README.md @@ -36,16 +36,16 @@ | <kbd>ALT up</kbd> | hycov:movefocus | u | Switch to up window in overview | | <kbd>ALT down</kbd> | hycov:movefocus | d | Switch to down window in overview | | <kbd>$mod SHIFT slash</kbd> | exec | xdg-open ./README.md | Show this page | -| <kbd>$mod period</kbd> | workspace | m-1 | Move to previous workspace | -| <kbd>$mod comma</kbd> | workspace | m+1 | Move to next workspace | +| <kbd>$mod comma</kbd> | workspace | m-1 | Move to previous workspace | +| <kbd>$mod period</kbd> | workspace | m+1 | Move to next workspace | | <kbd>$mod SHIFT grave</kbd> | movetoworkspace | special | Move window to special workspace | | <kbd>$mod grave</kbd> | togglespecialworkspace | eDP-1 | Toggle special workspace on default display | -| <kbd>$mod SHIFT period</kbd> | movetoworkspace | m-1 | Move window to previous workspace | -| <kbd>$mod SHIFT comma</kbd> | movetoworkspace | m+1 | Move window to next workspace | -| <kbd>$mod ALT period</kbd> | focusmonitor | l | Move focus to left monitor | -| <kbd>$mod ALT comma</kbd> | focusmonitor | r | Move focus to right monitor | -| <kbd>$mod SHIFT ALT period</kbd> | movecurrentworkspacetomonitor | l | Move workspace to left monitor | -| <kbd>$mod SHIFT ALT comma</kbd> | movecurrentworkspacetomonitor | r | Move workspace to right monitor | +| <kbd>$mod SHIFT comma</kbd> | movetoworkspace | m-1 | Move window to previous workspace | +| <kbd>$mod SHIFT period</kbd> | movetoworkspace | m+1 | Move window to next workspace | +| <kbd>$mod ALT comma</kbd> | focusmonitor | l | Move focus to left monitor | +| <kbd>$mod ALT period</kbd> | focusmonitor | r | Move focus to right monitor | +| <kbd>$mod SHIFT ALT comma</kbd> | movecurrentworkspacetomonitor | l | Move workspace to left monitor | +| <kbd>$mod SHIFT ALT period</kbd> | movecurrentworkspacetomonitor | r | Move workspace to right monitor | | <kbd>$mod L</kbd> | exec | loginctl lock-session | Lock screen | | <kbd>Print</kbd> | exec | grimblast --notify copysave area | Take Screenshot of area | | <kbd>CTRL Print</kbd> | exec | grimblast --notify --cursor copysave output | Take Screenshot of window | @@ -54,6 +54,7 @@ | <kbd>$mod minus</kbd> | exec | hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor \| grep float \| awk '{print $2 - 1}')" | Zoom out | | <kbd>$mod 1</kbd> | workspace | num | Create workspace 'num' | | <kbd>$mod SHIFT 1</kbd> | movetoworkspace | num | Move window to workspace 'num' | +| <kbd>$mod A</kbd> | exec | nwg-drawer | Application Drawer | | <kbd>$mod D</kbd> | exec | nwg-displays | Monitor Configuration | | <kbd>$mod F</kbd> | exec | thunar | File Manager | | <kbd>$mod T</kbd> | exec | kitty | Terminal | diff --git a/modules/gui/desktop/hyprland/apps/bar.nix b/modules/gui/desktop/hyprland/apps/bar.nix @@ -76,12 +76,13 @@ in rec { "custom/weather" "clock" "custom/dunst" + "custom/power" ]; "custom/logo" = { format = ""; tooltip = false; - on-click = "wlogout -p layer-shell"; + on-click = "nwg-drawer"; }; user = { @@ -89,6 +90,7 @@ in rec { icon = true; height = 30; width = 30; + open-on-click = true; }; "hyprland/workspaces" = { @@ -278,6 +280,12 @@ in rec { ''; }}/bin/notify"; }; + + "custom/power" = { + format = ""; + tooltip = false; + on-click = "wlogout -p layer-shell"; + }; } ]; }; diff --git a/modules/gui/desktop/hyprland/apps/default.nix b/modules/gui/desktop/hyprland/apps/default.nix @@ -41,6 +41,7 @@ in { mission-center custom.nwg-clipman nwg-displays + custom.nwg-drawer unstable.overskride playerctl qalculate-gtk @@ -93,20 +94,25 @@ in { # Shortcuts wayland.windowManager.hyprland.settings.bind = [ + "$mod, A, exec, nwg-drawer" "$mod, D, exec, nwg-displays" "$mod, F, exec, thunar" + "$mod, N, exec, dunstctl history-pop" "$mod, T, exec, kitty" - "$mod, W, exec, firefox" "$mod, V, exec, nwg-clipman -nw" - "$mod, Return, exec, missioncenter" - "$mod, N, exec, dunstctl history-pop" + "$mod, W, exec, firefox" "$mod, slash, exec, ulauncher-toggle" + "$mod, Return, exec, missioncenter" ", XF86Calculator, exec, qalculate-gtk" "$mod, Escape, exec, wlogout -p layer-shell" ]; - # Clipboard + # Autostart wayland.windowManager.hyprland.settings.exec-once = [ + # Application Drawer + "nwg-drawer -r" + + # Clipboard "wl-paste --type text --watch cliphist store" "wl-paste --type image --watch cliphist store" ]; @@ -232,6 +238,9 @@ in { # Configuration Files home.file = { + # Application Drawer + ".config/nwg-drawer/drawer.css".text = nwg.drawer; + # Wallpaper ".config/hypr/hyprpaper.conf".text = '' preload = ${wallpaper} diff --git a/modules/gui/desktop/hyprland/apps/rules.nix b/modules/gui/desktop/hyprland/apps/rules.nix @@ -2,10 +2,8 @@ _: { wayland.windowManager.hyprland.settings = { ## Layer Rules layerrule = [ - "blur, waybar" + "blur, ^(waybar)$" "blur, ^(gtk-layer-shell)$" - "xray 1, ^(gtk-layer-shell)$" - "ignorealpha 0.2, ^(gtk-layer-shell)$" ]; ## Window Rules diff --git a/modules/gui/desktop/hyprland/settings/keybindings.nix b/modules/gui/desktop/hyprland/settings/keybindings.nix @@ -57,24 +57,24 @@ in { "ALT CTRL, Tab, bringactivetotop," # Cycle Workspaces - "$mod, period, workspace, m-1" - "$mod, comma, workspace, m+1" + "$mod, comma, workspace, m-1" + "$mod, period, workspace, m+1" # Special Workspace "$mod SHIFT, grave, movetoworkspace, special" "$mod, grave, togglespecialworkspace, eDP-1" # Move Window to Workspace - "$mod SHIFT, period, movetoworkspace, m-1" - "$mod SHIFT, comma, movetoworkspace, m+1" + "$mod SHIFT, comma, movetoworkspace, m-1" + "$mod SHIFT, period, movetoworkspace, m+1" # Cycle Monitors - "$mod ALT, period, focusmonitor, l" - "$mod ALT, comma, focusmonitor, r" + "$mod ALT, comma, focusmonitor, l" + "$mod ALT, period, focusmonitor, r" # Send Focused Workspace to Monitor - "$mod SHIFT ALT, period, movecurrentworkspacetomonitor, l" - "$mod SHIFT ALT, comma, movecurrentworkspacetomonitor, r" + "$mod SHIFT ALT, comma, movecurrentworkspacetomonitor, l" + "$mod SHIFT ALT, period, movecurrentworkspacetomonitor, r" # Screen Lock "$mod, L, exec, loginctl lock-session" diff --git a/packages/nwg-drawer.nix b/packages/nwg-drawer.nix @@ -0,0 +1,54 @@ +{ + lib, + pkgs, + ... +}: +with pkgs; + unstable.buildGo122Module rec { + pname = "nwg-drawer"; + version = "0.4.7"; + + src = fetchFromGitHub { + owner = "nwg-piotr"; + repo = "nwg-drawer"; + rev = "v${version}"; + sha256 = "sha256-rBb2ArjllCBO2+9hx3f/c+uUQD1nCZzzfQGz1Wovy/0="; + }; + + vendorHash = "sha256-L8gdJd5cPfQrcSXLxFx6BAVWOXC8HRuk5fFQ7MsKpIc="; + + nativeBuildInputs = [ + gobject-introspection + pkg-config + wrapGAppsHook + ]; + + buildInputs = [ + cairo + gtk-layer-shell + gtk3 + ]; + + doCheck = false; # Too slow + preInstall = '' + mkdir -p $out/share/nwg-drawer + cp -r desktop-directories drawer.css $out/share/nwg-drawer + ''; + + preFixup = '' + # Make xdg-open overrideable at runtime + gappsWrapperArgs+=( + --suffix PATH : ${xdg-utils}/bin + --prefix XDG_DATA_DIRS : $out/share + ) + ''; + + meta = with lib; { + mainProgram = "nwg-drawer"; + description = "Application Drawer for Wayland compositors"; + homepage = "https://github.com/nwg-piotr/nwg-drawer"; + license = licenses.mit; + maintainers = ["maydayv7"]; + platforms = platforms.linux; + }; + }