aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'modules/desktop')
-rw-r--r--modules/desktop/default.nix4
-rw-r--r--modules/desktop/hyprland/default.nix27
-rw-r--r--modules/desktop/hyprland/hyprpaper.nix25
-rw-r--r--modules/desktop/waybar/bar/default.nix4
-rw-r--r--modules/desktop/waybar/bar/main.nix20
-rw-r--r--modules/desktop/waybar/default.nix21
-rw-r--r--modules/desktop/waybar/module/battery.nix20
-rw-r--r--modules/desktop/waybar/module/cpu.nix6
-rw-r--r--modules/desktop/waybar/module/date.nix6
-rw-r--r--modules/desktop/waybar/module/default.nix19
-rw-r--r--modules/desktop/waybar/module/memory.nix6
-rw-r--r--modules/desktop/waybar/module/network.nix16
-rw-r--r--modules/desktop/waybar/module/time.nix6
-rw-r--r--modules/desktop/waybar/module/volume.nix14
-rw-r--r--modules/desktop/waybar/module/vpn.nix11
-rw-r--r--modules/desktop/waybar/module/window.nix5
-rw-r--r--modules/desktop/waybar/module/workspaces.nix6
-rw-r--r--modules/desktop/waybar/style.nix29
-rw-r--r--modules/desktop/xdg/default.nix24
19 files changed, 236 insertions, 33 deletions
diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix
index a2fdfc8..759b979 100644
--- a/modules/desktop/default.nix
+++ b/modules/desktop/default.nix
@@ -1,4 +1,4 @@
-# Desktop - Desktop environment configuration (i3/Hyprland, GTK, polybar)
+# Desktop - Desktop environment configuration (Hyprland, GTK, waybar)
{
lib,
config,
@@ -7,9 +7,9 @@
{
imports = [
./gtk
- ./polybar
./xdg
./hyprland
+ ./waybar
];
options.desktop = {
diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix
index bd80157..9f52232 100644
--- a/modules/desktop/hyprland/default.nix
+++ b/modules/desktop/hyprland/default.nix
@@ -9,14 +9,11 @@ let
in
{
imports = [
+ ./hyprpaper.nix
./keybindings.nix
];
- options.desktop.hyprland = {
- enable = lib.mkEnableOption "Hyprland Wayland compositor";
- };
-
- config = lib.mkIf config.desktop.hyprland.enable {
+ config = lib.mkIf config.desktop.enable {
wayland.windowManager.hyprland = {
enable = true;
configType = "lua";
@@ -35,10 +32,10 @@ in
border_size = 1;
col = {
active_border = {
- colors = [ (toHyprColor base07) ];
+ colors = [ (toHyprColor base03) ];
angle = 45;
};
- inactive_border = toHyprColor base03;
+ inactive_border = toHyprColor base00;
};
layout = "dwindle";
};
@@ -52,6 +49,10 @@ in
kb_layout = "us";
};
+ cursor = {
+ enable_hyprcursor = true;
+ };
+
dwindle = {
preserve_split = true;
};
@@ -109,12 +110,14 @@ in
};
};
- services.hyprpaper = lib.mkIf config.media.feh.enable {
+ home.pointerCursor = {
enable = true;
- settings = {
- preload = [ "${../../../assets/sapling.png}" ];
- wallpaper = [ ",${../../../assets/sapling.png}" ];
- };
+ package = pkgs.rose-pine-hyprcursor;
+ name = "rose-pine-hyprcursor";
+ size = 24;
+ hyprcursor.enable = true;
+ gtk.enable = false;
+ x11.enable = false;
};
home.packages = with pkgs; [
diff --git a/modules/desktop/hyprland/hyprpaper.nix b/modules/desktop/hyprland/hyprpaper.nix
new file mode 100644
index 0000000..5b8eab3
--- /dev/null
+++ b/modules/desktop/hyprland/hyprpaper.nix
@@ -0,0 +1,25 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+{
+ config = lib.mkIf config.desktop.enable {
+ services.hyprpaper = {
+ enable = true;
+ package = pkgs.hyprpaper;
+ settings = {
+ ipc = "on";
+ splash = false;
+ preload = [ "${../../../assets/sapling.png}" ];
+ wallpaper = [
+ {
+ monitor = "";
+ path = "${../../../assets/sapling.png}";
+ }
+ ];
+ };
+ };
+ };
+}
diff --git a/modules/desktop/waybar/bar/default.nix b/modules/desktop/waybar/bar/default.nix
new file mode 100644
index 0000000..dee84e4
--- /dev/null
+++ b/modules/desktop/waybar/bar/default.nix
@@ -0,0 +1,4 @@
+{ config }:
+{
+ mainBar = import ./main.nix { inherit config; };
+}
diff --git a/modules/desktop/waybar/bar/main.nix b/modules/desktop/waybar/bar/main.nix
new file mode 100644
index 0000000..fbbfd87
--- /dev/null
+++ b/modules/desktop/waybar/bar/main.nix
@@ -0,0 +1,20 @@
+{ config }:
+with config.scheme.withHashtag;
+{
+ layer = "top";
+ position = "top";
+ height = 30;
+
+ modules-left = [ "hyprland/workspaces" ];
+ modules-center = [ "hyprland/window" ];
+ modules-right = [
+ "pulseaudio"
+ "battery"
+ "custom/vpn"
+ "network"
+ "clock#time"
+ "memory"
+ "cpu"
+ "clock#date"
+ ];
+}
diff --git a/modules/desktop/waybar/default.nix b/modules/desktop/waybar/default.nix
new file mode 100644
index 0000000..67d0f63
--- /dev/null
+++ b/modules/desktop/waybar/default.nix
@@ -0,0 +1,21 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+{
+ config = lib.mkIf config.desktop.enable {
+ programs.waybar = {
+ enable = true;
+ systemd.enable = true;
+
+ settings = lib.mkMerge [
+ (import ./bar { inherit config; })
+ (import ./module { inherit config lib pkgs; })
+ ];
+
+ style = import ./style.nix { inherit config; };
+ };
+ };
+}
diff --git a/modules/desktop/waybar/module/battery.nix b/modules/desktop/waybar/module/battery.nix
new file mode 100644
index 0000000..bf3527c
--- /dev/null
+++ b/modules/desktop/waybar/module/battery.nix
@@ -0,0 +1,20 @@
+{ config }:
+with config.scheme.withHashtag;
+{
+ format = "{icon} {capacity}%";
+ format-charging = "󰂄 {capacity}%";
+ format-plugged = "󰁹 {capacity}%";
+ format-alt = "{time} {icon}";
+ format-icons = [
+ "󰁺"
+ "󰁻"
+ "󰁼"
+ "󰁽"
+ "󰁾"
+ "󰁿"
+ "󰂀"
+ "󰂁"
+ "󰂂"
+ "󰁹"
+ ];
+}
diff --git a/modules/desktop/waybar/module/cpu.nix b/modules/desktop/waybar/module/cpu.nix
new file mode 100644
index 0000000..06f5af6
--- /dev/null
+++ b/modules/desktop/waybar/module/cpu.nix
@@ -0,0 +1,6 @@
+{ config }:
+with config.scheme.withHashtag;
+{
+ format = " {usage}%";
+ interval = 2;
+}
diff --git a/modules/desktop/waybar/module/date.nix b/modules/desktop/waybar/module/date.nix
new file mode 100644
index 0000000..efdccc4
--- /dev/null
+++ b/modules/desktop/waybar/module/date.nix
@@ -0,0 +1,6 @@
+{ config }:
+with config.scheme.withHashtag;
+{
+ format = " {:%d/%m/%Y}";
+ interval = 60;
+}
diff --git a/modules/desktop/waybar/module/default.nix b/modules/desktop/waybar/module/default.nix
new file mode 100644
index 0000000..2fa6ef8
--- /dev/null
+++ b/modules/desktop/waybar/module/default.nix
@@ -0,0 +1,19 @@
+{
+ config,
+ lib,
+ pkgs,
+}:
+{
+ mainBar = {
+ "hyprland/workspaces" = import ./workspaces.nix { inherit config; };
+ "hyprland/window" = import ./window.nix { inherit config; };
+ "pulseaudio" = import ./volume.nix { inherit config; };
+ "battery" = import ./battery.nix { inherit config; };
+ "custom/vpn" = import ./vpn.nix { inherit config lib pkgs; };
+ "network" = import ./network.nix { inherit config; };
+ "clock#time" = import ./time.nix { inherit config; };
+ "memory" = import ./memory.nix { inherit config; };
+ "cpu" = import ./cpu.nix { inherit config; };
+ "clock#date" = import ./date.nix { inherit config; };
+ };
+}
diff --git a/modules/desktop/waybar/module/memory.nix b/modules/desktop/waybar/module/memory.nix
new file mode 100644
index 0000000..b9a45a4
--- /dev/null
+++ b/modules/desktop/waybar/module/memory.nix
@@ -0,0 +1,6 @@
+{ config }:
+with config.scheme.withHashtag;
+{
+ format = " {usedGb} GB";
+ interval = 2;
+}
diff --git a/modules/desktop/waybar/module/network.nix b/modules/desktop/waybar/module/network.nix
new file mode 100644
index 0000000..e1036ed
--- /dev/null
+++ b/modules/desktop/waybar/module/network.nix
@@ -0,0 +1,16 @@
+{ config }:
+with config.scheme.withHashtag;
+{
+ format-wifi = "{icon} {signalStrength}%";
+ format-ethernet = " {ipaddr}";
+ format-disconnected = "";
+ tooltip-format = "{ifname}";
+ tooltip-format-wifi = "{essid} ({signalStrength}%)";
+ tooltip-format-ethernet = "Wired: {ipaddr}";
+ tooltip-format-disconnected = "Disconnected";
+ format-icons = [
+ "󰢼"
+ "󰢽"
+ "󰢾"
+ ];
+}
diff --git a/modules/desktop/waybar/module/time.nix b/modules/desktop/waybar/module/time.nix
new file mode 100644
index 0000000..e097c9c
--- /dev/null
+++ b/modules/desktop/waybar/module/time.nix
@@ -0,0 +1,6 @@
+{ config }:
+with config.scheme.withHashtag;
+{
+ format = " {:%I:%M %p}";
+ interval = 30;
+}
diff --git a/modules/desktop/waybar/module/volume.nix b/modules/desktop/waybar/module/volume.nix
new file mode 100644
index 0000000..ee3f2f3
--- /dev/null
+++ b/modules/desktop/waybar/module/volume.nix
@@ -0,0 +1,14 @@
+{ config }:
+with config.scheme.withHashtag;
+{
+ format = "{icon} {volume}%";
+ format-muted = "󰻨";
+ format-icons = [
+ ""
+ ""
+ ""
+ ];
+ on-click = "pamixer -t";
+ on-scroll-up = "pamixer -i 5";
+ on-scroll-down = "pamixer -d 5";
+}
diff --git a/modules/desktop/waybar/module/vpn.nix b/modules/desktop/waybar/module/vpn.nix
new file mode 100644
index 0000000..04366e1
--- /dev/null
+++ b/modules/desktop/waybar/module/vpn.nix
@@ -0,0 +1,11 @@
+{
+ config,
+ lib,
+ pkgs,
+}:
+with config.scheme.withHashtag;
+{
+ exec = "${pkgs.runtimeShell} -c '${lib.getExe' pkgs.iproute2 "ip"} a | ${lib.getExe pkgs.gnugrep} -q tun0 && printf \" VPN\"'";
+ interval = 5;
+ format = "{}";
+}
diff --git a/modules/desktop/waybar/module/window.nix b/modules/desktop/waybar/module/window.nix
new file mode 100644
index 0000000..c4e54c3
--- /dev/null
+++ b/modules/desktop/waybar/module/window.nix
@@ -0,0 +1,5 @@
+{ config }:
+with config.scheme.withHashtag;
+{
+ max-length = 20;
+}
diff --git a/modules/desktop/waybar/module/workspaces.nix b/modules/desktop/waybar/module/workspaces.nix
new file mode 100644
index 0000000..bb5a6ee
--- /dev/null
+++ b/modules/desktop/waybar/module/workspaces.nix
@@ -0,0 +1,6 @@
+{ config }:
+with config.scheme.withHashtag;
+{
+ format = "{name}";
+ on-click = "hyprctl dispatch workspace {name}";
+}
diff --git a/modules/desktop/waybar/style.nix b/modules/desktop/waybar/style.nix
new file mode 100644
index 0000000..319b94f
--- /dev/null
+++ b/modules/desktop/waybar/style.nix
@@ -0,0 +1,29 @@
+{ config }:
+with config.scheme.withHashtag;
+''
+ * {
+ border: none;
+ border-radius: 0;
+ font-family: "${config.fonts.normal}";
+ font-size: ${toString config.fonts.size}px;
+ min-height: 0;
+ }
+
+ window#waybar {
+ background: ${base00};
+ color: ${base05};
+ }
+
+ #workspaces button {
+ padding: 0 4px;
+ color: ${base05};
+ }
+
+ #workspaces button.focused {
+ border-bottom: 3px solid ${base0D};
+ }
+
+ #workspaces button.urgent {
+ border-bottom: 3px solid ${base08};
+ }
+''
diff --git a/modules/desktop/xdg/default.nix b/modules/desktop/xdg/default.nix
index 5edaf03..400d91d 100644
--- a/modules/desktop/xdg/default.nix
+++ b/modules/desktop/xdg/default.nix
@@ -5,36 +5,22 @@
pkgs,
...
}:
-let
- # Hyprland ships its own portal for screensharing/screencasting
- portalPkgs =
- with pkgs;
- [
- xdg-desktop-portal-termfilechooser
- ]
- ++ lib.optionals config.desktop.hyprland.enable [
- xdg-desktop-portal-hyprland
- ]
- ++ lib.optionals (!config.desktop.hyprland.enable) [
- xdg-desktop-portal-gtk
- ];
-
- defaultPortal = if config.desktop.hyprland.enable then "hyprland" else "gtk";
-in
{
config = lib.mkIf config.desktop.enable {
xdg.portal = {
enable = true;
- extraPortals = portalPkgs;
+ extraPortals = with pkgs; [
+ xdg-desktop-portal-termfilechooser
+ xdg-desktop-portal-hyprland
+ ];
config.common = {
"org.freedesktop.impl.portal.FileChooser" = [ "termfilechooser" ];
- default = [ defaultPortal ];
+ default = [ "hyprland" ];
};
xdgOpenUsePortal = true;
};
home.sessionVariables = {
- GTK_USE_PORTAL = "1";
TERMCMD = lib.mkIf config.terminal.kitty.enable "${lib.getExe config.terminal.kitty.package} --class file-explorer --title 'Yazi'";
};
};