summaryrefslogtreecommitdiff
path: root/home-manager/features/gui/desktops/niri/parts
diff options
context:
space:
mode:
authortriethyl <triethylammonium@pm.me>2025-10-15 08:39:09 -0400
committertriethyl <triethylammonium@pm.me>2025-10-15 08:39:09 -0400
commita9fc9cf8832c471854bb7fa61137a5272f1076b6 (patch)
treee640b844ea405943c6f4aca5bd40bc299ef37ecf /home-manager/features/gui/desktops/niri/parts
parentcc295c0d7e2c6ce80117322ea29f0f8219cd7a12 (diff)
niri: rearranged files and small changes
Diffstat (limited to 'home-manager/features/gui/desktops/niri/parts')
-rw-r--r--home-manager/features/gui/desktops/niri/parts/niri/default.nix110
-rw-r--r--home-manager/features/gui/desktops/niri/parts/niri/keybinds.nix168
-rw-r--r--home-manager/features/gui/desktops/niri/parts/quickshell/.envrc1
-rw-r--r--home-manager/features/gui/desktops/niri/parts/quickshell/default.nix15
-rw-r--r--home-manager/features/gui/desktops/niri/parts/quickshell/design.md20
-rw-r--r--home-manager/features/gui/desktops/niri/parts/quickshell/flake.lock64
-rw-r--r--home-manager/features/gui/desktops/niri/parts/quickshell/flake.nix29
-rw-r--r--home-manager/features/gui/desktops/niri/parts/quickshell/qml/Bar.qml48
-rw-r--r--home-manager/features/gui/desktops/niri/parts/quickshell/qml/shell.qml5
9 files changed, 366 insertions, 94 deletions
diff --git a/home-manager/features/gui/desktops/niri/parts/niri/default.nix b/home-manager/features/gui/desktops/niri/parts/niri/default.nix
new file mode 100644
index 0000000..e850b53
--- /dev/null
+++ b/home-manager/features/gui/desktops/niri/parts/niri/default.nix
@@ -0,0 +1,110 @@
+{
+ config,
+ pkgs,
+ lib,
+ inputs,
+ ...
+}: let
+ cfg = config.features.gui.desktops.niri.parts.niri;
+ aes = config.aesthetics;
+in {
+ imports = [ inputs.niri.homeModules.niri ];
+ options.features.gui.desktops.niri.parts.niri.enable = lib.mkEnableOption "niri";
+ config = lib.mkIf cfg.enable {
+ programs.niri = {
+ enable = true;
+ package = inputs.niri.packages.${pkgs.system}.niri-unstable;
+ settings = {
+ outputs = {
+ "Samsung Electric Company SAMSUNG 0x00000001" = {
+ enable = true;
+ scale = 1.5;
+ };
+ };
+ spawn-at-startup = [
+ # Status Bar
+ {command = ["waybar"];}
+
+ # Wallpaper Daemon
+ {command = ["swww-daemon"];}
+
+ # Allows x apps to be used in wayland.
+ {command = ["${lib.getExe pkgs.xwayland-satellite}"];}
+
+ # Logs the clipboard for use in utilities.
+ {command = ["${pkgs.wl-clipboard}/bin/wl-paste" "--watch" "${pkgs.cliphist}/bin/cliphist" "store"];}
+ ];
+ environment = {
+ DISPLAY = ":0"; # Important for Xwayland.
+ };
+ window-rules = [
+ {
+ geometry-corner-radius = let
+ radius = 4.0;
+ in {
+ top-left = radius;
+ top-right = radius;
+ bottom-left = radius;
+ bottom-right = radius;
+ };
+ clip-to-geometry = true;
+ default-column-width.proportion = 1. / 3.;
+ }
+ {
+ # Prevent Tor from being screen captured.
+ matches = [{app-id = "Tor Browser";}];
+ block-out-from = "screen-capture";
+ }
+ ];
+ switch-events = {
+ lid-close.action.spawn = ["hyprlock"];
+ };
+ prefer-no-csd = true;
+ overview = {
+ backdrop-color = "#${aes.scheme.base01}";
+ };
+ layout = {
+ gaps = 14;
+ insert-hint.enable = false;
+ shadow = {
+ enable = true;
+ softness = 10;
+ spread = 5;
+ offset = {
+ x = 0;
+ y = 0;
+ };
+ };
+ focus-ring = {
+ enable = true;
+ width = 3;
+ active.color = "#${aes.scheme.base09}";
+ };
+ border = {
+ enable = false;
+ width = 3;
+ inactive.color = "#${aes.scheme.base03}";
+ active.color = "#${aes.scheme.base08}";
+ };
+ struts = {
+ # left = -1;
+ # right = -1;
+
+ left = 20;
+ right = 20;
+ top = 20;
+ bottom = 20;
+ };
+ always-center-single-column = false;
+ empty-workspace-above-first = true;
+ };
+ hotkey-overlay.skip-at-startup = true;
+ input = {
+ touchpad = {
+ click-method = "clickfinger";
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/home-manager/features/gui/desktops/niri/parts/niri/keybinds.nix b/home-manager/features/gui/desktops/niri/parts/niri/keybinds.nix
new file mode 100644
index 0000000..28cb4c2
--- /dev/null
+++ b/home-manager/features/gui/desktops/niri/parts/niri/keybinds.nix
@@ -0,0 +1,168 @@
+{
+ config,
+ pkgs,
+ lib,
+ ...
+}: {
+ config = lib.mkIf config.features.gui.desktops.niri.parts.niri.enable {
+ programs.niri.settings.binds = let
+ left = "h";
+ down = "j";
+ up = "k";
+ right = "l";
+ in {
+ # App Launching Keys
+ "Mod+Q".action.spawn = ["foot"];
+ "Mod+W".action.spawn = ["librewolf"];
+ "Mod+E".action.spawn = ["neovide"];
+ "Mod+Shift+E".action.spawn = ["neovide" "--" "-c" "Calendar"];
+
+ # Reboot to gaming OS
+ "Mod+G".action.spawn = ["${lib.getExe (pkgs.writers.writeNuBin "gameos" "pkexec ${pkgs.efibootmgr}/bin/efibootmgr --bootnext 0000; reboot")}"];
+
+ # Clear Notifications
+ "Mod+B".action.spawn = ["makoctl" "dismiss" "-a"];
+
+ # Selectors
+ "Mod+R".action.spawn = ["fuzzel"];
+ "Mod+T".action.spawn = ["tool-selector"];
+ "Mod+Y".action.spawn = ["clipboard-selector"];
+ "Mod+U".action.spawn = ["wallpaper-selector" "--all-outputs"];
+ "Mod+Shift+U".action.spawn = ["wallpaper-selector"];
+ "Mod+Control+U".action.spawn = ["wallpaper-selector" "--randomize" "--all-outputs"];
+ "Mod+Control+Shift+U".action.spawn = ["wallpaper-selector" "--randomize"];
+
+ # Screenshot Keys
+ "Mod+P".action.screenshot = [];
+ "Shift+Mod+P".action.screenshot-screen = [];
+ "Control+Mod+P".action.screenshot-window = [];
+
+ # Power Keys
+ "Mod+comma".action.spawn = ["${lib.getExe (pkgs.writers.writeNuBin "nirilock" "systemctl suspend ; hyprlock")}"];
+
+ # Horizontal Tiling Keys
+ "Mod+A".action.maximize-column = [];
+ "Mod+S".action.switch-preset-column-width = [];
+
+ # Vertical Tiling Keys
+ "Mod+Shift+A".action.reset-window-height = [];
+ "Mod+Shift+S".action.switch-preset-window-height = [];
+ "Mod+D".action.consume-or-expel-window-right = [];
+
+ # Floating Window Management Keys
+ "Mod+Z".action.switch-focus-between-floating-and-tiling = [];
+ "Mod+X".action.toggle-window-floating = [];
+
+ # Other Window Management Keys
+ "Mod+C".action.close-window = [];
+ "Mod+V".action.fullscreen-window = [];
+
+ # Overlay Keys
+ "Mod+F".action.toggle-overview = [];
+
+ # +---------------------+
+ # | Arrow Movement Keys |
+ # +---------------------+
+
+ # Window Focus Keys
+ "Mod+Left".action.focus-column-left = [];
+ "Mod+Right".action.focus-column-right = [];
+ "Mod+Up".action.focus-window-up = [];
+ "Mod+Down".action.focus-window-down = [];
+
+ # Monitor Focus Keys
+ "Mod+Shift+Left".action.focus-monitor-left = [];
+ "Mod+Shift+Right".action.focus-monitor-right = [];
+
+ # Workspace Focus Keys
+ "Mod+Shift+Up".action.focus-workspace-up = [];
+ "Mod+Shift+Down".action.focus-workspace-down = [];
+
+ # Window Motion Keys
+ "Mod+Control+Left".action.move-column-left = [];
+ "Mod+Control+Right".action.move-column-right = [];
+ "Mod+Control+Up".action.move-window-up = [];
+ "Mod+Control+Down".action.move-window-down = [];
+
+ # Window - Monitor Motion Keys
+ "Mod+Control+Shift+Left".action.move-column-to-monitor-left = [];
+ "Mod+Control+Shift+Right".action.move-column-to-monitor-right = [];
+
+ # Window - Workspace Motion Keys
+ "Mod+Control+Shift+Up".action.move-window-to-workspace-up = [];
+ "Mod+Control+Shift+Down".action.move-window-to-workspace-down = [];
+
+ # Workspace Motion Keys
+ "Mod+Alt+Shift+Up".action.move-workspace-up = [];
+ "Mod+Alt+Shift+Down".action.move-workspace-down = [];
+
+ # Workspace - Monitor Motion Keys
+ "Mod+Alt+Shift+Left".action.move-workspace-to-monitor-left = [];
+ "Mod+Alt+Shift+Right".action.move-workspace-to-monitor-right = [];
+
+ # +-------------------+
+ # | Vim Movement Keys |
+ # +-------------------+
+
+ # Window Focus Keys
+ "Mod+${left}".action.focus-column-left = [];
+ "Mod+${right}".action.focus-column-right = [];
+ "Mod+${up}".action.focus-window-up = [];
+ "Mod+${down}".action.focus-window-down = [];
+
+ # Monitor Focus Keys
+ "Mod+Shift+${left}".action.focus-monitor-left = [];
+ "Mod+Shift+${right}".action.focus-monitor-right = [];
+
+ # Workspace Focus Keys
+ "Mod+Shift+${up}".action.focus-workspace-up = [];
+ "Mod+Shift+${down}".action.focus-workspace-down = [];
+
+ # Monitor Motion Keys
+ "Mod+Control+Shift+${left}".action.move-column-to-monitor-left = [];
+ "Mod+Control+Shift+${right}".action.move-column-to-monitor-right = [];
+
+ # Workspace Motion Keys
+ "Mod+Control+Shift+${up}".action.move-window-to-workspace-up = [];
+ "Mod+Control+Shift+${down}".action.move-window-to-workspace-down = [];
+
+ # Window Motion Keys
+ "Mod+Control+${left}".action.move-column-left = [];
+ "Mod+Control+${right}".action.move-column-right = [];
+ "Mod+Control+${up}".action.move-window-up = [];
+ "Mod+Control+${down}".action.move-window-down = [];
+
+ # Workspace Motion Keys
+ "Mod+Alt+Shift+${up}".action.move-workspace-up = [];
+ "Mod+Alt+Shift+${down}".action.move-workspace-down = [];
+
+ # Workspace - Monitor Motion Keys
+ "Mod+Alt+Shift+${left}".action.move-workspace-to-monitor-left = [];
+ "Mod+Alt+Shift+${right}".action.move-workspace-to-monitor-right = [];
+
+ # +-------------------+
+
+ # Numbered Workspace Movement Keys
+ "Mod+1".action.focus-workspace = 1;
+ "Mod+2".action.focus-workspace = 2;
+ "Mod+3".action.focus-workspace = 3;
+ "Mod+4".action.focus-workspace = 4;
+ "Mod+5".action.focus-workspace = 5;
+ "Mod+6".action.focus-workspace = 6;
+ "Mod+7".action.focus-workspace = 7;
+ "Mod+8".action.focus-workspace = 8;
+ "Mod+9".action.focus-workspace = 9;
+ "Mod+0".action.focus-workspace = 0;
+
+ # XF86 Keys
+ "XF86AudioRaiseVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+"];
+ "XF86AudioLowerVolume".action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"];
+ "XF86AudioMute".action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"];
+
+ "XF86MonBrightnessUp".action.spawn = ["${lib.getExe pkgs.brightnessctl}" "s" "+5%"];
+ "XF86MonBrightnessDown".action.spawn = ["${lib.getExe pkgs.brightnessctl}" "s" "5%-"];
+
+ "XF86LaunchB".action.spawn = ["fuzzel"];
+ };
+ };
+}
diff --git a/home-manager/features/gui/desktops/niri/parts/quickshell/.envrc b/home-manager/features/gui/desktops/niri/parts/quickshell/.envrc
deleted file mode 100644
index 3550a30..0000000
--- a/home-manager/features/gui/desktops/niri/parts/quickshell/.envrc
+++ /dev/null
@@ -1 +0,0 @@
-use flake
diff --git a/home-manager/features/gui/desktops/niri/parts/quickshell/default.nix b/home-manager/features/gui/desktops/niri/parts/quickshell/default.nix
new file mode 100644
index 0000000..0fd94d9
--- /dev/null
+++ b/home-manager/features/gui/desktops/niri/parts/quickshell/default.nix
@@ -0,0 +1,15 @@
+{
+ config,
+ pkgs,
+ lib,
+ ...
+}: let
+ cfg = config.features.gui.desktops.niri.parts.quickshell;
+in {
+ options.features.gui.desktops.niri.parts.quickshell.enable = lib.mkEnableOption "quickshell";
+ config = lib.mkIf cfg.enable {
+ programs.quickshell = {
+ enable = true;
+ };
+ };
+}
diff --git a/home-manager/features/gui/desktops/niri/parts/quickshell/design.md b/home-manager/features/gui/desktops/niri/parts/quickshell/design.md
new file mode 100644
index 0000000..79f8ee8
--- /dev/null
+++ b/home-manager/features/gui/desktops/niri/parts/quickshell/design.md
@@ -0,0 +1,20 @@
+# Quickshell Design
+
+## Bar
+
+Left Components:
+
+- Battery Percentage
+- Bluetooth Battery Percentage
+- Volume
+- Brightness
+
+Center Components:
+
+- Workspaces
+
+Right Components:
+
+- Date
+- Time
+
diff --git a/home-manager/features/gui/desktops/niri/parts/quickshell/flake.lock b/home-manager/features/gui/desktops/niri/parts/quickshell/flake.lock
deleted file mode 100644
index 29f5851..0000000
--- a/home-manager/features/gui/desktops/niri/parts/quickshell/flake.lock
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "nodes": {
- "flake-utils": {
- "inputs": {
- "systems": [
- "systems"
- ]
- },
- "locked": {
- "lastModified": 1731533236,
- "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
- "owner": "numtide",
- "repo": "flake-utils",
- "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
- "type": "github"
- },
- "original": {
- "owner": "numtide",
- "repo": "flake-utils",
- "type": "github"
- }
- },
- "nixpkgs": {
- "locked": {
- "lastModified": 1751498133,
- "narHash": "sha256-QWJ+NQbMU+NcU2xiyo7SNox1fAuwksGlQhpzBl76g1I=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "d55716bb59b91ae9d1ced4b1ccdea7a442ecbfdb",
- "type": "github"
- },
- "original": {
- "owner": "NixOS",
- "ref": "nixpkgs-unstable",
- "repo": "nixpkgs",
- "type": "github"
- }
- },
- "root": {
- "inputs": {
- "flake-utils": "flake-utils",
- "nixpkgs": "nixpkgs",
- "systems": "systems"
- }
- },
- "systems": {
- "locked": {
- "lastModified": 1681028828,
- "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
- "owner": "nix-systems",
- "repo": "default",
- "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
- "type": "github"
- },
- "original": {
- "owner": "nix-systems",
- "repo": "default",
- "type": "github"
- }
- }
- },
- "root": "root",
- "version": 7
-}
diff --git a/home-manager/features/gui/desktops/niri/parts/quickshell/flake.nix b/home-manager/features/gui/desktops/niri/parts/quickshell/flake.nix
deleted file mode 100644
index 2122f1f..0000000
--- a/home-manager/features/gui/desktops/niri/parts/quickshell/flake.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- description = "Project flake";
-
- inputs = {
- nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
- systems.url = "github:nix-systems/default";
- flake-utils = {
- url = "github:numtide/flake-utils";
- inputs.systems.follows = "systems";
- };
- };
-
- outputs = {
- nixpkgs,
- flake-utils,
- ...
- }:
- flake-utils.lib.eachDefaultSystem (
- system: let
- pkgs = nixpkgs.legacyPackages.${system};
- in {
- devShells.default = pkgs.mkShell {
- packages = with pkgs; [
- quickshell
- ];
- };
- }
- );
-}
diff --git a/home-manager/features/gui/desktops/niri/parts/quickshell/qml/Bar.qml b/home-manager/features/gui/desktops/niri/parts/quickshell/qml/Bar.qml
new file mode 100644
index 0000000..8254890
--- /dev/null
+++ b/home-manager/features/gui/desktops/niri/parts/quickshell/qml/Bar.qml
@@ -0,0 +1,48 @@
+import Quickshell // for PanelWindow
+import Quickshell.Io // for Process
+import QtQuick // for Text
+
+Scope {
+ id: root
+ property string time
+
+ Variants {
+ model: Quickshell.screens
+
+ PanelWindow {
+ required property var modelData
+
+ screen: modelData
+
+ anchors {
+ bottom: true
+ left: true
+ right: true
+ }
+
+ implicitHeight: 30
+
+ Text {
+ anchors.centerIn: parent
+ text: root.time
+ }
+ }
+ }
+
+ Process {
+ id: dateProc
+ command: ["date"]
+ running: true
+
+ stdout: StdioCollector {
+ onStreamFinished: root.time = this.text
+ }
+ }
+
+ Timer {
+ interval: 1000
+ running: true
+ repeat: true
+ onTriggered: dateProc.running = true
+ }
+}
diff --git a/home-manager/features/gui/desktops/niri/parts/quickshell/qml/shell.qml b/home-manager/features/gui/desktops/niri/parts/quickshell/qml/shell.qml
new file mode 100644
index 0000000..9d093ad
--- /dev/null
+++ b/home-manager/features/gui/desktops/niri/parts/quickshell/qml/shell.qml
@@ -0,0 +1,5 @@
+import Quickshell
+
+Scope {
+ Bar {}
+}