dotfiles

My PC Dotfiles & Website
commit cb14266b193c1f033a2a9ebd5f2f802c98445cce
parent 88c511ffe09f6c61d7303098b2143460e5e277a9
Author: maydayv7 <maydayv7@gmail.com>
Date:   Sun,  6 Oct 2024 15:36:36 +0530

feat: GNOME Tiling

+ Use `tiling-shell` instead of `forge`
+ Enable Waydroid on `valkyrie`

Diffstat:

Mdevices/valkyrie/default.nix | 4++--
Mfiles/gnome/menu.json | 22+++-------------------
Mfiles/gnome/settings/default.nix | 5++++-
Mfiles/gnome/settings/extensions.nix | 102++++++++++++++++++++++++++++++-------------------------------------------------
Mfiles/gnome/shortcuts.json | 104+++++++++++++++++++++++++++++--------------------------------------------------
Dfiles/gnome/tiling.css | 132-------------------------------------------------------------------------------
Mmodules/gui/desktop/gnome/default.nix | 4----
Mmodules/gui/xorg.nix | 13++++++++-----
Apackages/gnome-tilingshell.nix | 38++++++++++++++++++++++++++++++++++++++
9 files changed, 132 insertions(+), 292 deletions(-)

diff --git a/devices/valkyrie/default.nix b/devices/valkyrie/default.nix @@ -7,7 +7,7 @@ timezone = "Asia/Kolkata"; locale = "IN"; - kernel = "lqx"; + kernel = "xanmod"; kernelModules = ["nvme" "thunderbolt"]; imports = [./drivers.nix]; @@ -16,7 +16,7 @@ filesystem = "advanced"; support = ["laptop" "mobile" "printer" "virtualisation"]; modules = ["asus-zephyrus-ga402x-nvidia"]; - vm.android.enable = false; + vm.android.enable = true; cpu = { cores = 8; mode = "performance"; diff --git a/files/gnome/menu.json b/files/gnome/menu.json @@ -28,7 +28,7 @@ "type": "switch", "title": "Android", "icon": "application-x-addon-symbolic", - "start": "waydroid session start", + "start": "sh -c 'nohup waydroid session start > /dev/null 2>&1&'", "stop": "waydroid session stop", "check": "sh -c 'waydroid status | grep RUNNING'", "interval_s": 10 @@ -50,24 +50,8 @@ }, { "type": "command", - "title": "Documentation", - "command": "xdg-open /run/current-system/sw/share/gnome-shell/extensions/guillotine@fopdoodle.net/README.md", - "instancing": "singleInstance", - "icon": "guillotine-symbolic", - "killOnDisable": false - }, - { - "type": "command", - "title": "Log", - "command": "kgx -e 'journalctl -f GNOME_SHELL_EXTENSION_UUID=guillotine@fopdoodle.net' ", - "instancing": "singleInstance", - "icon": "emblem-documents-symbolic", - "killOnDisable": false - }, - { - "type": "command", - "title": "Log gnome-shell", - "command": "kgx -e 'journalctl -f _COMM=gnome-shell' ", + "title": "Log Desktop", + "command": "kgx -e 'sudo journalctl /run/current-system/sw/bin/gnome-shell -f -o cat'", "instancing": "singleInstance", "icon": "emblem-documents-symbolic", "killOnDisable": false diff --git a/files/gnome/settings/default.nix b/files/gnome/settings/default.nix @@ -15,6 +15,7 @@ in { dconf.settings = { # Keyboard Shortcuts "org/gnome/desktop/wm/keybindings" = { + always-on-top = ["<Super>p"]; begin-move = []; begin-resize = []; close = ["<Super>q" "<Alt>F4"]; @@ -22,6 +23,7 @@ in { cycle-group-backward = []; maximize = ["<Super>Up"]; minimize = ["<Super>Down"]; + move-to-center = ["<Super>c"]; move-to-monitor-down = []; move-to-monitor-left = ["<Primary><Super>Left"]; move-to-monitor-right = ["<Primary><Super>Right"]; @@ -66,12 +68,13 @@ in { toggle-application-view = []; toggle-message-tray = []; toggle-overview = []; + toggle-quick-settings = []; }; "org/gnome/settings-daemon/plugins/media-keys" = { area-screenshot = ["Print"]; area-screenshot-clip = []; - control-center = ["<Super>s"]; + control-center = ["<Super><Shift>grave"]; email = ["<Super>e"]; home = ["<Super>f"]; magnifier = ["<Super>x"]; diff --git a/files/gnome/settings/extensions.nix b/files/gnome/settings/extensions.nix @@ -6,18 +6,19 @@ ... }: let inherit (builtins) filter hasAttr map; - inherit (lib) foldr hm mapAttrs' mkForce nameValuePair optionals recursiveUpdate; + inherit (lib) foldr hm mkForce optionals recursiveUpdate; + latest = pkgs.unstable.gnomeExtensions; # Shell Extensions - extensions = with pkgs.unstable.gnomeExtensions // pkgs.gnomeExtensions // hm.gvariant; ([ + extensions = with pkgs.gnomeExtensions // hm.gvariant; ([ {package = appindicator;} {package = control-monitor-brightness-and-volume-with-ddcutil;} {package = gamemode-indicator-in-system-settings;} {package = gsconnect;} {package = guillotine;} {package = hide-minimized;} - {package = invert-window-color;} - {package = media-progress;} + {package = latest.invert-window-color;} + {package = latest.media-progress;} {package = overview-hover;} {package = removable-drive-menu;} {package = unmess;} @@ -30,7 +31,7 @@ } ( if sys.services.supergfxd.enable - then {package = gpu-supergfxctl-switch;} + then {package = latest.gpu-supergfxctl-switch;} else {} ) { @@ -46,6 +47,7 @@ right-box-order = [ "emoji-copy@felipeftn" + "tilingshell@ferrarodomenico.com" "a11y" "aggregateMenu" "drive-menu" @@ -89,7 +91,7 @@ }; } { - package = emoji-copy; + package = latest.emoji-copy; settings = { active-keybind = true; always-show = false; @@ -106,6 +108,15 @@ }; } { + package = focus-changer; + settings = { + focus-down = ["<Super>s"]; + focus-left = ["<Super>a"]; + focus-right = ["<Super>d"]; + focus-up = ["<Super>w"]; + }; + } + { package = vitals; settings = { hot-sensors = ["_default_icon_"]; @@ -175,62 +186,6 @@ }; } { - package = forge; - settings = - { - auto-split-enabled = true; - focus-border-toggle = true; - stacked-tiling-mode-enabled = true; - tabbed-tiling-mode-enabled = true; - tiling-mode-enabled = false; - window-gap-hidden-on-single = false; - } - // mapAttrs' (name: value: - nameValuePair "keybindings/${name}" value) { - con-split-horizontal = []; - con-split-layout-toggle = []; - con-split-vertical = []; - con-stacked-layout-toggle = ["<Shift><Super>s"]; - con-tabbed-layout-toggle = ["<Shift><Super>t"]; - con-tabbed-showtab-decoration-toggle = []; - focus-border-toggle = []; - mod-mask-mouse-tile = "Super"; - prefs-open = []; - prefs-tiling-toggle = ["<Super>y"]; - window-focus-down = ["<Super>s"]; - window-focus-left = ["<Super>a"]; - window-focus-right = ["<Super>d"]; - window-focus-up = ["<Super>w"]; - window-gap-size-decrease = ["<Primary><Super>minus"]; - window-gap-size-increase = ["<Primary><Super>plus"]; - window-move-down = ["<Primary><Super>s"]; - window-move-left = ["<Primary><Super>a"]; - window-move-right = ["<Primary><Super>d"]; - window-move-up = ["<Primary><Super>w"]; - window-resize-bottom-decrease = ["<Alt><Primary><Super>Down"]; - window-resize-bottom-increase = ["<Alt><Super>Down"]; - window-resize-left-decrease = ["<Alt><Primary><Super>Left"]; - window-resize-left-increase = ["<Alt><Super>Left"]; - window-resize-right-decrease = ["<Alt><Primary><Super>Right"]; - window-resize-right-increase = ["<Alt><Super>Right"]; - window-resize-top-decrease = ["<Alt><Primary><Super>Up"]; - window-resize-top-increase = ["<Alt><Super>Up"]; - window-snap-center = ["<Super>c"]; - window-snap-one-third-left = []; - window-snap-one-third-right = []; - window-snap-two-third-left = []; - window-snap-two-third-right = []; - window-swap-down = ["<Shift><Super>s"]; - window-swap-last-active = []; - window-swap-left = ["<Shift><Super>a"]; - window-swap-right = ["<Shift><Super>d"]; - window-swap-up = ["<Shift><Super>w"]; - window-toggle-always-float = []; - window-toggle-float = ["<Shift><Super>F"]; - workspace-active-tile-toggle = ["<Shift><Super>y"]; - }; - } - { package = window-gestures; name = "windowgestures"; settings = { @@ -262,6 +217,27 @@ }; } { + package = pkgs.custom.gnome-tilingshell; + name = "tilingshell"; + settings = { + enable-blur-selected-tilepreview = false; + enable-blur-snap-assistant = false; + enable-snap-assist = false; + enable-tiling-system = true; + enable-window-border = true; + inner-gaps = mkUint32 12; + move-window-down = ["<Shift><Super>s"]; + move-window-left = ["<Shift><Super>a"]; + move-window-right = ["<Shift><Super>d"]; + move-window-up = ["<Shift><Super>w"]; + override-window-menu = true; + restore-window-original-size = true; + tiling-system-activation-key = ["0"]; + top-edge-maximize = true; + window-border-width = mkUint32 2; + }; + } + { package = vertical-workspaces; settings = { aaa-loading-profile = true; @@ -390,7 +366,7 @@ } ] ++ optionals sys.gui.fancy [ - {package = rounded-window-corners-reborn;} + {package = latest.rounded-window-corners-reborn;} {package = transparent-top-bar;} { package = panel-corners; diff --git a/files/gnome/shortcuts.json b/files/gnome/shortcuts.json @@ -3,22 +3,10 @@ "name": "Window Navigation", "shortcuts": [ { - "key": "Super", - "description": "Enter Overview" - }, - { - "key": "Super * 2", - "description": "Enter App Grid" - }, - { "key": "Alt + F4 / Super + Q", "description": "Close window" }, { - "key": "Super + Mouse Drag", - "description": "Move window" - }, - { "key": "F11", "description": "Make Full screen/Restore" }, @@ -31,6 +19,43 @@ "description": "Activate Window Menu" }, { + "key": "Super + W/A/S/D", + "description": "Focus window in specified direction" + }, + { + "key": "Super + Shift + W/A/S/D", + "description": "Move window to specified tile" + }, + { + "key": "Super + Mouse Drag", + "description": "Move window" + }, + { + "key": "Super + Ctrl + Mouse Drag", + "description": "Tile window (Use 'Alt' to span)" + }, + { + "key": "Super + C", + "description": "Move window to center" + }, + { + "key": "Super + P", + "description": "Pin window above all others" + } + ] + }, + { + "name": "Desktop Navigation", + "shortcuts": [ + { + "key": "Super", + "description": "Enter Overview" + }, + { + "key": "Super * 2", + "description": "Enter App Grid" + }, + { "key": "Alt + Tab", "description": "Switches between Application" }, @@ -111,59 +136,6 @@ ] }, { - "name": "Tiling Shortcuts", - "shortcuts": [ - { - "key": "Super + Y", - "description": "Toggle window Tiling" - }, - { - "key": "Super + Shift + Y", - "description": "Toggle automatic window tiling" - }, - { - "key": "Super + Shift + S", - "description": "Toggle stacked layout" - }, - { - "key": "Super + Shift + T", - "description": "Toggle tabbed layout" - }, - { - "key": "Super + W/A/S/D", - "description": "Focus specified window" - }, - { - "key": "Super + Ctrl + W/A/S/D", - "description": "Move window in specified direction" - }, - { - "key": "Super + Shift + W/A/S/D", - "description": "Swap window in specified direction" - }, - { - "key": "Super + C", - "description": "Snap window to center" - }, - { - "key": "Super + Shift + F", - "description": "Toggle window floating state" - }, - { - "key": "Alt + Space + Always on Top", - "description": "Pin window above all others" - }, - { - "key": "Super + Alt + ↑/←/↓/→", - "description": "Increase window size in specified direction" - }, - { - "key": "Super + Ctrl + Alt + ↑/←/↓/→", - "description": "Decrease window size in specified direction" - } - ] - }, - { "name": "Run and Close Applications", "shortcuts": [ { @@ -179,7 +151,7 @@ "description": "Shows Open apps" }, { - "key": "Super + S", + "key": "Super + ~", "description": "Open Settings" }, { diff --git a/files/gnome/tiling.css b/files/gnome/tiling.css @@ -1,132 +0,0 @@ -.tiled { - color: rgb(98, 160, 234); - opacity: 1; - border-width: 3px; -} - -.split { - color: rgb(248, 228, 92); - opacity: 1; - border-width: 3px; -} - -.stacked { - color: rgb(153, 193, 241); - opacity: 1; - border-width: 3px; -} - -.tabbed { - color: rgb(17, 199, 224); - opacity: 1; - border-width: 3px; -} - -.floated { - color: rgb(53, 132, 228); - opacity: 1; - border-width: 3px; -} - -.window-tiled-border { - border-width: 3px; - border-color: rgb(98, 160, 234); - border-style: solid; - border-radius: 14px; -} - -.window-split-border { - border-width: 3px; - border-color: rgb(248, 228, 92); - border-style: solid; - border-radius: 14px; -} - -.window-split-horizontal { - border-left-width: 0; - border-top-width: 0; - border-bottom-width: 0; -} - -.window-split-vertical { - border-left-width: 0; - border-top-width: 0; - border-right-width: 0; -} - -.window-stacked-border { - border-width: 3px; - border-color: rgb(153, 193, 241); - border-style: solid; - border-radius: 14px; -} - -.window-tabbed-border { - border-width: 3px; - border-color: rgb(17, 199, 224); - border-style: solid; - border-radius: 14px; -} - -.window-tabbed-bg { - border-radius: 8px; -} - -.window-tabbed-tab { - background-color: rgba(54, 47, 45, 1); - border-color: rgba(17, 199, 224, 0.6); - border-width: 1px; - border-radius: 8px; - color: white; - margin: 1px; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); -} - -.window-tabbed-tab-active { - background-color: rgba(17, 199, 224, 1); - color: black; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); -} - -.window-tabbed-tab-close { - padding: 3px; - margin: 4px; - border-radius: 16px; - width: 16px; - background-color: #e06666; -} - -.window-tabbed-tab-icon { - margin: 3px; -} - -.window-floated-border { - border-width: 3px; - border-color: rgb(53, 132, 228); - border-style: solid; - border-radius: 14px; -} - -.window-tilepreview-tiled { - border-width: 1px; - border-color: rgba(98, 160, 234, 0.3); - border-style: solid; - border-radius: 14px; - background-color: rgba(98, 160, 234, 0.2); -} - -.window-tilepreview-stacked { - border-width: 1px; - border-color: rgba(153, 193, 241, 0.3); - border-style: solid; - border-radius: 14px; - background-color: rgba(153, 193, 241, 0.2); -} - -.window-tilepreview-tabbed { - border-width: 1px; - border-color: rgba(18, 199, 224, 0.4); - border-style: solid; - border-radius: 14px; - background-color: rgba(17, 199, 224, 0.3); -} diff --git a/modules/gui/desktop/gnome/default.nix b/modules/gui/desktop/gnome/default.nix @@ -142,9 +142,6 @@ in { # Shell Theme ".local/share/themes/custom/gnome-shell/gnome-shell.css".text = gnome.shell; - - # Window Tiling Stylesheet - ".config/forge/stylesheet/forge/stylesheet.css".text = gnome.tiling; }; }; @@ -215,7 +212,6 @@ in { ".cache/gnome-builder" # Extensions - ".config/forge" ".cache/clipboard-indicator@tudmotu.com" ]; }) diff --git a/modules/gui/xorg.nix b/modules/gui/xorg.nix @@ -2,10 +2,12 @@ lib, files, ... -}: { - options.gui.xorg.enable = lib.mkOption { +}: let + inherit (lib) mkDefault mkForce mkOption types; +in { + options.gui.xorg.enable = mkOption { description = "Enable X11 Server Configuration"; - type = lib.types.bool; + type = types.bool; default = true; }; @@ -17,13 +19,14 @@ autorun = true; # Driver Settings - videoDrivers = lib.mkDefault ["modesetting"]; + videoDrivers = mkDefault ["modesetting"]; }; # System Specialisation specialisation.xorg.configuration = { system.nixos.tags = ["xorg"]; - gui.wayland.enable = lib.mkForce false; + gui.wayland.enable = mkForce false; + hardware.vm.android.enable = mkForce false; }; }; } diff --git a/packages/gnome-tilingshell.nix b/packages/gnome-tilingshell.nix @@ -0,0 +1,38 @@ +{ + lib, + pkgs, + ... +}: +with pkgs; let + name = "tilingshell"; + uuid = "${name}@ferrarodomenico.com"; +in + stdenv.mkDerivation rec { + pname = "gnome-${name}"; + version = "v30"; + + src = fetchzip { + stripRoot = false; + url = "https://extensions.gnome.org/extension-data/tilingshellferrarodomenico.com.${version}.shell-extension.zip"; + sha256 = "sha256-oU8KC6Q3QpycPVMcVcpMnA35YyNyLF6Xl3YbTiGKKHw="; + }; + + dontBuild = true; + installPhase = '' + mkdir -p $out/share/gnome-shell/extensions/${uuid}/ + cp -r . $out/share/gnome-shell/extensions/${uuid}/ + ''; + + passthru = { + extensionUuid = uuid; + extensionPortalSlug = name; + }; + + meta = with lib; { + description = "Extend GNOME Shell with advanced tiling window management"; + homepage = "https://extensions.gnome.org/extension/7065/tiling-shell/"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = ["maydayv7"]; + }; + }