summaryrefslogtreecommitdiff
path: root/home-manager/features/gui/desktops/niri
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/features/gui/desktops/niri')
-rwxr-xr-xhome-manager/features/gui/desktops/niri/default.nix2
-rwxr-xr-xhome-manager/features/gui/desktops/niri/parts/fuzzel.nix5
-rw-r--r--home-manager/features/gui/desktops/niri/parts/niri/keybinds.nix34
-rw-r--r--home-manager/features/gui/desktops/niri/parts/scrap-maker.nix22
-rw-r--r--home-manager/features/gui/desktops/niri/parts/swayosd.nix52
-rwxr-xr-xhome-manager/features/gui/desktops/niri/parts/waybar.nix28
6 files changed, 129 insertions, 14 deletions
diff --git a/home-manager/features/gui/desktops/niri/default.nix b/home-manager/features/gui/desktops/niri/default.nix
index 270be51..17b62c7 100755
--- a/home-manager/features/gui/desktops/niri/default.nix
+++ b/home-manager/features/gui/desktops/niri/default.nix
@@ -10,12 +10,14 @@ in {
features.gui.desktops.niri.parts = {
niri.enable = true;
waybar.enable = true;
+ swayosd.enable = true;
fuzzel.enable = true;
selectors.enable = true;
swww.enable = true;
mako.enable = true;
hyprlock.enable = false;
quickshell.enable = true;
+ scrap-maker.enable = true;
};
};
}
diff --git a/home-manager/features/gui/desktops/niri/parts/fuzzel.nix b/home-manager/features/gui/desktops/niri/parts/fuzzel.nix
index 1d44625..ea6253a 100755
--- a/home-manager/features/gui/desktops/niri/parts/fuzzel.nix
+++ b/home-manager/features/gui/desktops/niri/parts/fuzzel.nix
@@ -8,7 +8,10 @@ in {
enable = true;
settings = {
main = {
- width = 20;
+ width = 24;
+ horizontal-pad = 16;
+ vertical-pad = 16;
+ inner-pad = 8;
terminal = config.default-applications.terminal-emulator.runTuiCommand;
};
border = {
diff --git a/home-manager/features/gui/desktops/niri/parts/niri/keybinds.nix b/home-manager/features/gui/desktops/niri/parts/niri/keybinds.nix
index 91ccd30..7a370f3 100644
--- a/home-manager/features/gui/desktops/niri/parts/niri/keybinds.nix
+++ b/home-manager/features/gui/desktops/niri/parts/niri/keybinds.nix
@@ -16,6 +16,7 @@
"Mod+W".action.spawn = ["librewolf"];
"Mod+E".action.spawn = ["neovide"];
"Mod+Shift+E".action.spawn = ["neovide" "--" "-c" "Calendar"];
+ "Mod+N".action.spawn = ["scrap-maker"];
# Reboot to gaming OS
"Mod+G".action.spawn = ["${lib.getExe (pkgs.writers.writeNuBin "gameos" "pkexec ${pkgs.efibootmgr}/bin/efibootmgr --bootnext 0000; reboot")}"];
@@ -157,14 +158,35 @@
"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"];
+ # "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"];
+
+ # XF86 Keys with SwayOSD
+ "XF86AudioRaiseVolume".action.spawn = ["nu" "-c" "swayosd-client --monitor (niri msg -j focused-output | from json | get name) --output-volume=raise"];
+ "XF86AudioLowerVolume".action.spawn = ["nu" "-c" "swayosd-client --monitor (niri msg -j focused-output | from json | get name) --output-volume=lower"];
+ "XF86AudioMute".action.spawn = ["nu" "-c" "swayosd-client --monitor (niri msg -j focused-output | from json | get name) --output-volume=mute-toggle"];
+
+ "XF86MonBrightnessUp".action.spawn = ["nu" "-c" "swayosd-client --monitor (niri msg -j focused-output | from json | get name) --brightness=raise"];
+ "XF86MonBrightnessDown".action.spawn = ["nu" "-c" "swayosd-client --monitor (niri msg -j focused-output | from json | get name) --brightness=lower"];
+
+ "XF86LaunchA".action.spawn-sh = "${lib.getExe pkgs.wdisplays}";
+ "XF86LaunchB".action.spawn = ["fuzzel"];
- "XF86MonBrightnessUp".action.spawn = ["${lib.getExe pkgs.brightnessctl}" "s" "+5%"];
- "XF86MonBrightnessDown".action.spawn = ["${lib.getExe pkgs.brightnessctl}" "s" "5%-"];
+ "XF86Eject".action.spawn-sh = "eject -T"; # Just in case I have a disk reader
- "XF86LaunchB".action.spawn = ["fuzzel"];
+ "XF86AudioPrev".action.spawn = ["nu" "-c" "swayosd-client --monitor (niri msg -j focused-output | from json | get name) --playerctl=prev"];
+ "XF86AudioPlay".action.spawn = ["nu" "-c" "swayosd-client --monitor (niri msg -j focused-output | from json | get name) --playerctl=play-pause"];
+ "XF86AudioNext".action.spawn = ["nu" "-c" "swayosd-client --monitor (niri msg -j focused-output | from json | get name) --playerctl=next"];
+
+ "Caps_Lock".action.spawn = ["nu" "-c" "sleep 0.2 ; swayosd-client --monitor (niri msg -j focused-output | from json | get name) --caps-lock"];
+ "Num_Lock".action.spawn = ["nu" "-c" "sleep 0.2 ; swayosd-client --monitor (niri msg -j focused-output | from json | get name) --num-lock"];
+ "Scroll_Lock".action.spawn = ["nu" "-c" "sleep 0.2 ; swayosd-client --monitor (niri msg -j focused-output | from json | get name) --scroll-lock"];
};
};
}
diff --git a/home-manager/features/gui/desktops/niri/parts/scrap-maker.nix b/home-manager/features/gui/desktops/niri/parts/scrap-maker.nix
new file mode 100644
index 0000000..19cce56
--- /dev/null
+++ b/home-manager/features/gui/desktops/niri/parts/scrap-maker.nix
@@ -0,0 +1,22 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.features.gui.desktops.niri.parts.scrap-maker;
+
+ scrapDirectory = "~/Sync/vault/scraps";
+in {
+ options.features.gui.desktops.niri.parts.scrap-maker.enable = lib.mkEnableOption "scrap maker";
+ config = lib.mkIf cfg.enable {
+ home.packages = [
+ (pkgs.writers.writeNuBin "scrap-maker" ''
+ let scrap_text = fuzzel -d -l 0 -p "" -x 8 -y 8 -w 40
+ let scrap_name = date now | format date "%s"
+ let scrap_path = ("${scrapDirectory}" + "/" + $scrap_name + ".md") | path expand
+ $scrap_text | save $scrap_path
+ '')
+ ];
+ };
+}
diff --git a/home-manager/features/gui/desktops/niri/parts/swayosd.nix b/home-manager/features/gui/desktops/niri/parts/swayosd.nix
new file mode 100644
index 0000000..6cba218
--- /dev/null
+++ b/home-manager/features/gui/desktops/niri/parts/swayosd.nix
@@ -0,0 +1,52 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.features.gui.desktops.niri.parts.swayosd;
+ aes = config.aesthetics;
+
+ swayosd-patched = pkgs.swayosd.overrideAttrs (old: {
+ postInstall = ''
+ mkdir -p $out/share/dbus-1/services
+ mv $out/share/dbus-1/system-services/org.erikreider.swayosd.service \
+ $out/share/dbus-1/services/org.erikreider.swayosd.service
+ rm -r $out/share/dbus-1/system*
+ '';
+ });
+in {
+ options.features.gui.desktops.niri.parts.swayosd.enable = lib.mkEnableOption "swayosd";
+ config = lib.mkIf cfg.enable {
+ home.packages = [ pkgs.swayosd ];
+ dbus.packages = [ swayosd-patched ];
+ services.swayosd = {
+ enable = true;
+ topMargin = 0.5;
+ stylePath = with aes.scheme; (builtins.toFile "style.scss" ''
+ window#osd {
+ border-radius: 4px;
+ border-width: 3px;
+ border-style: solid;
+ border-color: #${base0C};
+ background-color: #${base00};
+ color: #${base05};
+ }
+ window#osd #container {
+ margin: 6px;
+ padding: 2px;
+ background: transparent;
+ }
+ window#osd trough {
+ margin-right: 10px;
+ }
+ window#osd image {
+ -gtk-icon-transform: scale(0.7);
+ }
+ * {
+ opacity: 1;
+ }
+ '');
+ };
+ };
+}
diff --git a/home-manager/features/gui/desktops/niri/parts/waybar.nix b/home-manager/features/gui/desktops/niri/parts/waybar.nix
index 7535b0c..06ad79e 100755
--- a/home-manager/features/gui/desktops/niri/parts/waybar.nix
+++ b/home-manager/features/gui/desktops/niri/parts/waybar.nix
@@ -12,14 +12,14 @@ in {
layer = "top";
position = "bottom";
height = 32;
- modules-left = [ "battery" "network" "backlight" "pulseaudio" ];
+ modules-left = [ "battery" "network" "backlight" "pulseaudio" "custom/syncthing" ];
modules-center = [ "niri/workspaces" ];
modules-right = [ "clock#date" "clock#time" ];
"clock#date" = {
format = " {:%A, %B %d}";
};
"clock#time" = {
- format = " {:%I:%M}";
+ format = " {:%I:%M}";
};
pulseaudio = {
format = " {volume}%";
@@ -61,6 +61,20 @@ in {
*/
};
};
+ "custom/syncthing" = {
+ exec = lib.getExe (pkgs.writers.writeNuBin "syncthing-waybar-module" /*nu*/ ''
+ let status = ${lib.getExe pkgs.stc-cli} events | from json | where type == "StateChanged" | reverse | get 0.data.to
+ let percent = ${lib.getExe pkgs.stc-cli} json_dump | from json | get folders | get syncPercentDone | math avg | into int
+ let icon = if ($status == "idle") { ""
+ } else if ($status == "scanning") { ""
+ } else if ($status == "syncing") { ""
+ } else { "" }
+ let percent_string = if ($percent == 100) { "Synced" } else { ($percent | into string) + "%" }
+ return ($icon + " " + $percent_string)
+ '');
+ on-click = "${lib.getExe pkgs.stc-cli} rescan all";
+ interval = 3;
+ };
};
};
style = let
@@ -78,7 +92,7 @@ in {
window#waybar {
background-color: transparent;
}
- #clock.time, #clock.date, #backlight, #pulseaudio, #battery, #network {
+ #clock.time, #clock.date, #custom-syncthing, #backlight, #pulseaudio, #battery, #network {
background-color: @background-color;
color: @text-color;
border-radius: ${border-radius}px;
@@ -86,9 +100,12 @@ in {
border-color: @border-color;
padding: 0px ${padding}px;
}
- #backlight, #pulseaudio, #battery, #network {
+ #backlight, #pulseaudio, #battery, #network, #custom-syncthing {
margin: 0px 0px ${padding} ${padding};
}
+ #clock.date, #clock.time {
+ margin: 0px ${padding} ${padding} 0px
+ }
#workspaces {
background-color: @background-color;
color: @background-color;
@@ -127,9 +144,6 @@ in {
opacity: 0.8;
transition: all 0.3s cubic-bezier(.25,.1,.25,1);
}
- #clock.date, #clock.time {
- margin: 0px ${padding} ${padding} 0px
- }
'';
};
};