summaryrefslogtreecommitdiff
path: root/accounts
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2025-12-05 10:14:10 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2025-12-05 10:14:10 +0100
commitaaf03d1860760f8fc4ae100d3db3b71ba1d99526 (patch)
tree7f9f2c350949b89fb74bf5f0084d9552820c9661 /accounts
parent5133b7ebfc13eda58bf54cf2c1ac5b73c2ccf237 (diff)
downloadnixos-aaf03d1860760f8fc4ae100d3db3b71ba1d99526.tar
nixos-aaf03d1860760f8fc4ae100d3db3b71ba1d99526.tar.gz
nixos-aaf03d1860760f8fc4ae100d3db3b71ba1d99526.tar.bz2
nixos-aaf03d1860760f8fc4ae100d3db3b71ba1d99526.tar.xz
nixos-aaf03d1860760f8fc4ae100d3db3b71ba1d99526.zip
...
Diffstat (limited to 'accounts')
-rw-r--r--accounts/gkleen@sif/default.nix2
-rw-r--r--accounts/gkleen@sif/niri.nix24
-rw-r--r--accounts/gkleen@sif/shell/quickshell/Bar.qml18
3 files changed, 31 insertions, 13 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index 5a4521a8..3c68645e 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -71,7 +71,7 @@ in {
71 home-manager.users.${userName} = { 71 home-manager.users.${userName} = {
72 imports = [ 72 imports = [
73 ./libvirt 73 ./libvirt
74 ./niri 74 ./niri.nix
75 ./shell 75 ./shell
76 ./synadm 76 ./synadm
77 flakeInputs.nix-index-database.homeModules.nix-index 77 flakeInputs.nix-index-database.homeModules.nix-index
diff --git a/accounts/gkleen@sif/niri.nix b/accounts/gkleen@sif/niri.nix
index d4b77d9c..fada053b 100644
--- a/accounts/gkleen@sif/niri.nix
+++ b/accounts/gkleen@sif/niri.nix
@@ -716,6 +716,11 @@ in {
716 (plain "binds" 716 (plain "binds"
717 (let 717 (let
718 bind = name: cfg: node name [(lib.removeAttrs cfg ["action"])] (lib.mapAttrsToList leaf (lib.removeAttrs cfg.action ["__functor"])); 718 bind = name: cfg: node name [(lib.removeAttrs cfg ["action"])] (lib.mapAttrsToList leaf (lib.removeAttrs cfg.action ["__functor"]));
719
720 move-column-to-workspace = kdl.magic-leaf "move-column-to-workspace";
721 screenshot = kdl.magic-leaf "screenshot";
722 screenshot-window = kdl.magic-leaf "screenshot-window";
723 screenshot-screen = kdl.magic-leaf "screenshot-screen";
719 in 724 in
720 normalize-nodes [ 725 normalize-nodes [
721 (lib.mapAttrsToList bind (with config.lib.niri.actions; { 726 (lib.mapAttrsToList bind (with config.lib.niri.actions; {
@@ -821,9 +826,9 @@ in {
821 wl-copy "$(cut -d ':' -f 1 <<<"$FUZZEL_RES" | tr -d '\n')" && wtype -k XF86Paste 826 wl-copy "$(cut -d ':' -f 1 <<<"$FUZZEL_RES" | tr -d '\n')" && wtype -k XF86Paste
822 ''; 827 '';
823 })); 828 }));
824 "Print".action = kdl.magic-leaf "screenshot"; 829 "Print".action = screenshot;
825 "Control+Print".action = kdl.magic-leaf "screenshot-window"; 830 "Control+Print".action = screenshot-window;
826 "Shift+Print".action = kdl.magic-leaf "screenshot-screen"; 831 "Shift+Print".action = screenshot-screen;
827 "Mod+B".action = with-select-window-action ".workspace_id == ($active_workspace | tonumber)" "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}"; 832 "Mod+B".action = with-select-window-action ".workspace_id == ($active_workspace | tonumber)" "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}";
828 "Mod+Shift+B".action = with-select-window-action "true" "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}"; 833 "Mod+Shift+B".action = with-select-window-action "true" "{\"Action\":{\"FocusWindow\":{\"id\": .id}}}";
829 834
@@ -862,19 +867,19 @@ in {
862 "Mod+Shift+Control+C".action = move-workspace-up; 867 "Mod+Shift+Control+C".action = move-workspace-up;
863 868
864 "Mod+ParenLeft".action = focus-workspace "comm"; 869 "Mod+ParenLeft".action = focus-workspace "comm";
865 "Mod+Shift+ParenLeft".action = kdl.magic-leaf "move-column-to-workspace" "comm"; 870 "Mod+Shift+ParenLeft".action = move-column-to-workspace "comm";
866 871
867 "Mod+ParenRight".action = focus-workspace "web"; 872 "Mod+ParenRight".action = focus-workspace "web";
868 "Mod+Shift+ParenRight".action = kdl.magic-leaf "move-column-to-workspace" "web"; 873 "Mod+Shift+ParenRight".action = move-column-to-workspace "web";
869 874
870 "Mod+BraceRight".action = focus-workspace "read"; 875 "Mod+BraceRight".action = focus-workspace "read";
871 "Mod+Shift+BraceRight".action = kdl.magic-leaf "move-column-to-workspace" "read"; 876 "Mod+Shift+BraceRight".action = move-column-to-workspace "read";
872 877
873 "Mod+BraceLeft".action = focus-workspace "mon"; 878 "Mod+BraceLeft".action = focus-workspace "mon";
874 "Mod+Shift+BraceLeft".action = kdl.magic-leaf "move-column-to-workspace" "mon"; 879 "Mod+Shift+BraceLeft".action = move-column-to-workspace "mon";
875 880
876 "Mod+Asterisk".action = focus-workspace "vid"; 881 "Mod+Asterisk".action = focus-workspace "vid";
877 "Mod+Shift+Asterisk".action = kdl.magic-leaf "move-column-to-workspace" "vid"; 882 "Mod+Shift+Asterisk".action = move-column-to-workspace "vid";
878 883
879 "Mod+Plus".action = with-unnamed-workspace-action ''{"Action":{"FocusWorkspace":{"reference":{"Id": .id}}}}''; 884 "Mod+Plus".action = with-unnamed-workspace-action ''{"Action":{"FocusWorkspace":{"reference":{"Id": .id}}}}'';
880 "Mod+Shift+Plus".action = with-unnamed-workspace-action ''{"Action":{"MoveColumnToWorkspace":{"reference":{"Id": .id}, "focus": true}}}''; 885 "Mod+Shift+Plus".action = with-unnamed-workspace-action ''{"Action":{"MoveColumnToWorkspace":{"reference":{"Id": .id}, "focus": true}}}'';
@@ -884,6 +889,7 @@ in {
884 889
885 "Mod+Shift+M".action = toggle-column-tabbed-display; 890 "Mod+Shift+M".action = toggle-column-tabbed-display;
886 891
892 "Mod+L".action = maximize-window-to-edges;
887 "Mod+R".action = switch-preset-column-width; 893 "Mod+R".action = switch-preset-column-width;
888 "Mod+Shift+R".action = maximize-column; 894 "Mod+Shift+R".action = maximize-column;
889 "Mod+Shift+Ctrl+R".action = switch-preset-window-height; 895 "Mod+Shift+Ctrl+R".action = switch-preset-window-height;
@@ -970,7 +976,7 @@ in {
970 "Mod+Shift+Semicolon".action = shell { Notifications = { DismissAll = {}; }; }; 976 "Mod+Shift+Semicolon".action = shell { Notifications = { DismissAll = {}; }; };
971 })) 977 }))
972 (map ({ name, selector, spawn, key, ...}: if key != null && selector != null && spawn != null then bind key { action = focus-or-spawn-action selector name spawn; } else null) cfg.scratchspaces) 978 (map ({ name, selector, spawn, key, ...}: if key != null && selector != null && spawn != null then bind key { action = focus-or-spawn-action selector name spawn; } else null) cfg.scratchspaces)
973 (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces) 979 (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = move-column-to-workspace name; } else null) cfg.scratchspaces)
974 ] 980 ]
975 )) 981 ))
976 ]; 982 ];
diff --git a/accounts/gkleen@sif/shell/quickshell/Bar.qml b/accounts/gkleen@sif/shell/quickshell/Bar.qml
index c0ff4dac..54ac2d3c 100644
--- a/accounts/gkleen@sif/shell/quickshell/Bar.qml
+++ b/accounts/gkleen@sif/shell/quickshell/Bar.qml
@@ -1,27 +1,39 @@
1import Quickshell 1import Quickshell
2import Quickshell.Wayland 2import Quickshell.Wayland
3import QtQuick 3import QtQuick
4import qs.Services
4 5
5PanelWindow { 6PanelWindow {
6 id: bar 7 id: bar
7 8
8 WlrLayershell.namespace: "bar" 9 WlrLayershell.namespace: "bar"
9 10
11 property bool haveMaximizedWindow: {
12 let currWindowId = Array.from(NiriService.workspaces).find(ws => {
13 return ws.output === bar.screen.name && ws.is_active;
14 })?.active_window_id;
15 let activeWindowTileSize = Array.from(NiriService.windows).find(win => win.id == currWindowId)?.layout?.tile_size;
16
17 if (!activeWindowTileSize)
18 return false;
19 return activeWindowTileSize[0] >= bar.screen.width && activeWindowTileSize[1] >= bar.screen.height - bar.height;
20 }
21
10 anchors { 22 anchors {
11 top: true 23 top: true
12 left: true 24 left: true
13 right: true 25 right: true
14 } 26 }
15 margins { 27 margins {
16 left: 26 + 8 28 left: bar.haveMaximizedWindow ? 0 : 26 + 8
17 right: 26 + 8 29 right: bar.haveMaximizedWindow ? 0 : 26 + 8
18 } 30 }
19 31
20 implicitHeight: 21 32 implicitHeight: 21
21 color: "transparent" 33 color: "transparent"
22 34
23 Rectangle { 35 Rectangle {
24 color: Qt.rgba(0, 0, 0, 0.75) 36 color: bar.haveMaximizedWindow ? "black" : Qt.rgba(0, 0, 0, 0.75)
25 anchors.fill: parent 37 anchors.fill: parent
26 // bottomLeftRadius: 8 38 // bottomLeftRadius: 8
27 // bottomRightRadius: 8 39 // bottomRightRadius: 8