summaryrefslogtreecommitdiff
path: root/home-modules/desktop
diff options
context:
space:
mode:
authorJakub Stachurski <j.stachurski@student.utwente.nl>2025-08-17 11:25:33 +0200
committerJakub Stachurski <j.stachurski@student.utwente.nl>2025-08-17 11:25:33 +0200
commit1be972048dd58218cd689ecb5cac562eb398b751 (patch)
tree203f19ee01ad5fe28f2868e8c1451f9538e4ab12 /home-modules/desktop
parent3cd59d4670711e34a50adea912c3b0894883e490 (diff)
refreshed config
Diffstat (limited to 'home-modules/desktop')
-rw-r--r--home-modules/desktop/default.nix4
-rw-r--r--home-modules/desktop/hyprland.nix306
-rw-r--r--home-modules/desktop/wallpaper.pngbin0 -> 644591 bytes
-rw-r--r--home-modules/desktop/wayland/default.nix3
-rw-r--r--home-modules/desktop/wayland/mako.ini25
-rw-r--r--home-modules/desktop/wayland/mako.nix12
-rw-r--r--home-modules/desktop/wayland/waybar.css230
-rw-r--r--home-modules/desktop/wayland/waybar.nix131
8 files changed, 711 insertions, 0 deletions
diff --git a/home-modules/desktop/default.nix b/home-modules/desktop/default.nix
new file mode 100644
index 0000000..d02f217
--- /dev/null
+++ b/home-modules/desktop/default.nix
@@ -0,0 +1,4 @@
+{pkgs, hostconfig, ...}: {
+ imports = [./wayland ./hyprland.nix];
+
+}
diff --git a/home-modules/desktop/hyprland.nix b/home-modules/desktop/hyprland.nix
new file mode 100644
index 0000000..e2ce7ab
--- /dev/null
+++ b/home-modules/desktop/hyprland.nix
@@ -0,0 +1,306 @@
+{lib, pkgs, config, hostconfig , ...}:
+with lib;
+{
+ config = mkIf hostconfig.addons.desktop.hyprland.enable {
+ home.packages = with pkgs; [
+ mako
+ wofi
+ hyprshot
+ networkmanagerapplet
+ xdg-desktop-portal-gnome
+ xdg-desktop-portal-hyprland
+ wl-clipboard
+ brightnessctl
+ lxqt.lxqt-policykit
+ ];
+
+ homeprogs.waybar.enable = true;
+ homeprogs.mako.enable = true;
+ # Environment variables for hyprland.
+ # This can be used to configure wayland/hyprland-specific things
+ home.file.".config/uwsm/env-hyprland".text = ''
+ export XDG_SESSION_TYPE=wayland
+ export GDK_BACKEND=wayland
+ export GTK_USE_PORTAL=1
+ export QT_QPA_PLATFORM=wayland;xcb
+ export QT_STYLE_OVERRIDE=kvantum
+ export QT_QPA_PLATFORM_THEME=kvantum
+ export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
+ export QT_AUTO_SCREEN_SCALE_FACTOR=1
+ export MOZ_ENABLE_WAYLAND=1
+ export -n GTK_IM_MODULE
+ '';
+
+ # Hyprland
+ wayland.windowManager.hyprland = {
+ systemd.enable = false;
+ enable = true;
+ xwayland.enable = true;
+ settings = {
+ exec-once = map (s: "uwsm app -- " + s) [
+ "kitty &"
+ "lxqt-policykit-agent &"
+ "waybar &"
+ "nm-applet &"
+ "blueman-tray &"
+ "blueman-applet &"
+ "hyprctl setcursor Catppuccin-Mocha-Dark-Cursors 24"
+ "kdeconnect-indicator &"
+ "fcitx5 -d"
+ ] ++ [
+ "systemctl --user start hypridle.service"
+ "systemctl --user start hyprpaper.service"
+ "systemctl --user start hyprpolkitagent.service"
+ "uwsm finalize QT_QPA_PLATFORM QT_PLUGIN_PATH"
+ ];
+ general = {
+ gaps_in = 3;
+ gaps_out = 8;
+ border_size = 1;
+
+ "col.active_border" = "rgba(ed45b8ee) rgba(611449ee) 45deg";
+ "col.inactive_border" = "rgba(595959aa)";
+
+ resize_on_border = true;
+ allow_tearing = true;
+ layout = "dwindle";
+ };
+
+ animations = {
+ enabled = true;
+ bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
+ animation = [
+ "windows, 1, 7, myBezier"
+ "windowsOut, 1, 7, default, popin 80%"
+ "border, 1, 10, default"
+ "borderangle, 1, 8, default"
+ "fade, 1, 7, default"
+ "workspaces, 1, 6, default"
+ ];
+ };
+
+ decoration = {
+ rounding = 10;
+
+ # Change transparency of focused and unfocused windows
+ active_opacity = "1.0";
+ inactive_opacity = "1.0";
+
+ # drop_shadow = true;
+ # shadow_range = 4;
+ # shadow_render_power = 3;
+ # "col.shadow" = "rgba(1a1a1aee)";
+
+ # https://wiki.hyprland.org/Configuring/Variables/#blur
+ blur = {
+ enabled = true;
+ size = 3;
+ passes = 1;
+
+ vibrancy = "0.1696";
+ };
+ };
+ dwindle = {
+ pseudotile = true;
+ preserve_split = true;
+ };
+
+ #master = {
+ # new_is_master = true;
+ #};
+ input = {
+ kb_layout = "pl";
+ kb_variant = "";
+ kb_model = "";
+ kb_options = "";
+ kb_rules = "";
+
+ follow_mouse = 1;
+
+ sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
+
+ touchpad = {
+ natural_scroll = true;
+ };
+ };
+ gestures = {
+ workspace_swipe = true;
+ };
+ misc = {
+ force_default_wallpaper = "-1"; # Set to 0 or 1 to disable the anime mascot wallpapers
+ disable_hyprland_logo = false; # If true disables the random hyprland logo / anime girl background. :(
+ };
+ monitor= [ ",preferred,auto,1" ];
+
+ # Mod key
+ "$mod" = "SUPER";
+
+ # Programs
+ "$terminal" = "kitty";
+ "$fileManager" = "thunar";
+ "$menu" = "wofi --show drun";
+ "$screenshot" = "hyprshot -m region -f screenshots/screenshot_$(date +'%y-%m-%d_%H-%M-%S').png";
+
+ bind = [
+ # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
+ "$mod, RETURN, exec, $terminal"
+ "$mod, Q, killactive,"
+ "$mod SHIFT, M, exec, uwsm stop"
+ "$mod, E, exec, uwsm app -- $fileManager"
+ "$mod, V, togglefloating,"
+ "$mod, R, exec, uwsm app -- $menu"
+ "$mod, P, pseudo"
+ "$mod, J, togglesplit"
+ "$mod, L, exec, uwsm app -- hyprlock"
+ ",Print, exec, uwsm app -- $screenshot "
+
+ # Move focus with mod + arrow keys
+ "$mod, left, movefocus, l"
+ "$mod, right, movefocus, r"
+ "$mod, up, movefocus, u"
+ "$mod, down, movefocus, d"
+
+ # Example special workspace (scratchpad)
+ "$mod, S, togglespecialworkspace, magic"
+ "$mod SHIFT, S, movetoworkspace, special:magic"
+
+ # Scroll through existing workspaces with mod + scroll
+ "$mod, mouse_down, workspace, e+1"
+ "$mod, mouse_up, workspace, e-1"
+ ] ++ (
+ # workspaces
+ builtins.concatLists (builtins.genList (
+ x: let
+ ws = let
+ c = (x + 1) / 10;
+ in
+ builtins.toString (x + 1 - (c * 10));
+ in [
+ # binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
+ "$mod, ${ws}, workspace, ${toString (x + 1)}"
+ "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
+
+ # Move workspace {1..10} to current monitor
+ "CTRL ALT $mod , ${ws}, focusworkspaceoncurrentmonitor, ${toString(x + 1)}"
+ ]
+ )
+ 10)
+ ) ++ (
+ # Monitor {0..4} --> Key {1..5}
+ builtins.concatLists (builtins.genList (
+ x: let
+ mon = builtins.toString(x);
+ key = builtins.toString(x + 1);
+ in [
+
+ # Move current workspace to a monitor {1..4}
+ "CTRL ALT SHIFT $mod, ${key}, movecurrentworkspacetomonitor, ${mon} "
+ ]
+ ) 4));
+
+ bindm = [
+ "$mod, mouse:272, movewindow"
+ "$mod, mouse:273, resizewindow"
+ ];
+
+ bindl = [
+ "$mod, O, exec, sleep 1 && hyprctl dispatch dpms toggle"
+ ] ++ (lib.optionals config.homeapps.presets.multimedia.enable [
+ # Playerctl binds if playerctl is enabled
+ " , XF86AudioNext, exec, playerctl next"
+ " , XF86AudioPause, exec, playerctl play-pause"
+ " , XF86AudioPlay, exec, playerctl play-pause"
+ " , XF86AudioPrev, exec, playerctl previous"
+ ]);
+
+ bindel = [
+ # Laptop multimedia keys for volume and LCD brightness
+ " ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
+ " ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
+ " ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
+ " ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
+ " ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+"
+ " ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%-"
+ ];
+
+
+ windowrulev2 = [
+ "suppressevent maximize, class:.*" # You'll probably like this.
+ ];
+
+ source = [
+ "~/.config/hypr/hypr_test.conf"
+ ];
+ };
+ };
+
+ services.hyprpaper = {
+ enable = true;
+ settings = {
+ ipc = "on";
+ splash = false;
+ splash_offset = 2.0;
+
+ preload = [ "${./wallpaper.png}" ];
+ wallpaper= [ ",${./wallpaper.png}" ];
+ };
+ };
+
+ programs.hyprlock = {
+ enable=true;
+ settings = {
+ general = {
+ disable_loading_bar = true;
+ grace = 0;
+ hide_cursor = true;
+ no_fade_in = false;
+ };
+
+ background = [
+ {
+ path = "screenshot";
+ blur_passes = 3;
+ blur_size = 16;
+ }
+ ];
+
+ input-field = [
+ {
+ size = "200, 50";
+ position = "0, -80";
+ monitor = "";
+ dots_center = true;
+ fade_on_empty = false;
+ font_color = "rgb(202, 211, 245)";
+ inner_color = "rgb(91, 96, 120)";
+ outer_color = "rgb(24, 25, 38)";
+ outline_thickness = 5;
+ placeholder_text = "<span foreground=\"##cad3f5\">Password...</span>";
+ shadow_passes = 2;
+ }
+ ];
+ };
+ };
+
+ services.hypridle.enable = true;
+ services.hypridle.settings = {
+ general = {
+ lock_cmd ="pidof hyprlock || hyprlock";
+ before_sleep_cmd="loginctl lock-session";
+ ignore_dbus_inhibit=false;
+ after_sleep_cmd="hyprctl_dispatch dpms on";
+ };
+ listener = [
+ {
+ timeout = 120;
+ on-timeout = "hyprlock";
+ }
+ {
+ timeout = 300;
+ on-timeout = "hyprctl dispatch dpms off";
+ on-resume = "hyprctl dispatch dpms on";
+ }
+ ];
+ };
+ };
+}
diff --git a/home-modules/desktop/wallpaper.png b/home-modules/desktop/wallpaper.png
new file mode 100644
index 0000000..42f8bea
--- /dev/null
+++ b/home-modules/desktop/wallpaper.png
Binary files differ
diff --git a/home-modules/desktop/wayland/default.nix b/home-modules/desktop/wayland/default.nix
new file mode 100644
index 0000000..9be2fe9
--- /dev/null
+++ b/home-modules/desktop/wayland/default.nix
@@ -0,0 +1,3 @@
+{pkgs, hostconfig, ...}: {
+ imports = [./waybar.nix ./mako.nix];
+}
diff --git a/home-modules/desktop/wayland/mako.ini b/home-modules/desktop/wayland/mako.ini
new file mode 100644
index 0000000..27b16c8
--- /dev/null
+++ b/home-modules/desktop/wayland/mako.ini
@@ -0,0 +1,25 @@
+max-visible=4
+max-history=8
+sort=-time
+
+font=Hermit 12
+
+background-color=#ED45B8AA
+text-color=#FFFFFFFF
+
+margin=10
+padding=5
+border-radius=5
+progress-color=source #FFFFFFFF
+#max-icon-size=64
+default-timeout=4000
+
+on-button-middle=exec makoctl menu -n "$id" wofi -dp "Select action: "
+
+[urgency=normal]
+border-color=#FFFFFFFF
+
+[urgency=high]
+border-color=#FF5544
+default-timeout=0
+
diff --git a/home-modules/desktop/wayland/mako.nix b/home-modules/desktop/wayland/mako.nix
new file mode 100644
index 0000000..15c7969
--- /dev/null
+++ b/home-modules/desktop/wayland/mako.nix
@@ -0,0 +1,12 @@
+{pkgs, config, hostconfig, lib,...}: {
+ options.homeprogs.mako.enable = lib.mkEnableOption "Enable Mako notification manager";
+ config = lib.mkIf config.homeprogs.mako.enable {
+ services.mako = {
+ enable = true;
+ };
+ xdg.configFile."mako/config".source = ./mako.ini;
+
+ };
+
+
+}
diff --git a/home-modules/desktop/wayland/waybar.css b/home-modules/desktop/wayland/waybar.css
new file mode 100644
index 0000000..3c90892
--- /dev/null
+++ b/home-modules/desktop/wayland/waybar.css
@@ -0,0 +1,230 @@
+* {
+ /* `otf-font-awesome` is required to be installed for icons */
+ font-family: Hermit, Minecraftia ,FontAwesome, Helvetica, Arial, sans-serif;
+ font-size: 13px;
+}
+
+window#waybar {
+ background-color: rgba(43, 48, 59, 0.5);
+ border-bottom: 3px solid rgba(100, 114, 125, 0.5);
+ color: #ffffff;
+ transition-property: background-color;
+ transition-duration: .5s;
+}
+
+window#waybar.hidden {
+ opacity: 0.2;
+}
+
+/*
+window#waybar.empty {
+ background-color: transparent;
+}
+window#waybar.solo {
+ background-color: #FFFFFF;
+}
+*/
+
+window#waybar.termite {
+ background-color: #3F3F3F;
+}
+
+window#waybar.chromium {
+ background-color: #000000;
+ border: none;
+}
+
+button {
+ /* Use box-shadow instead of border so the text isn't offset */
+ box-shadow: inset 0 -3px transparent;
+ /* Avoid rounded borders under each button name */
+ border: none;
+ border-radius: 0;
+}
+
+/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
+button:hover {
+ background: inherit;
+ box-shadow: inset 0 -3px #ed45b8;
+}
+
+#workspaces button {
+ padding: 0 5px;
+ background-color: transparent;
+ color: #ffffff;
+}
+
+#workspaces button:hover {
+ background: rgba(0, 0, 0, 0.2);
+}
+
+#workspaces button.focused {
+ background-color: #64727D;
+ box-shadow: inset 0 -3px #ffffff;
+}
+
+#workspaces button.urgent {
+ background-color: #eb4d4b;
+}
+
+#mode {
+ background-color: #64727D;
+ border-bottom: 3px solid #ffffff;
+}
+
+#clock,
+#battery,
+#cpu,
+#memory,
+#disk,
+#temperature,
+#backlight,
+#network,
+#pulseaudio,
+#wireplumber,
+#custom-media,
+#tray,
+#mode,
+#idle_inhibitor,
+#scratchpad,
+#mpd {
+ padding: 0 10px;
+ color: #ffffff;
+}
+
+#window,
+#workspaces {
+ margin: 0 4px;
+}
+
+/* If workspaces is the leftmost module, omit left margin */
+.modules-left > widget:first-child > #workspaces {
+ margin-left: 0;
+}
+
+/* If workspaces is the rightmost module, omit right margin */
+.modules-right > widget:last-child > #workspaces {
+ margin-right: 0;
+}
+
+#clock {
+ color: #000000;
+ background-color: #ffffff;
+}
+
+#battery {
+ color: #000000;
+ background-color: #ffffff;
+}
+
+#battery.charging, #battery.plugged {
+}
+
+@keyframes blink {
+ to {
+ color: #FFFFFF;
+ background-color: #000000 ;
+ }
+}
+
+#battery.critical:not(.charging) {
+ background-color: #f53c3c;
+ color: #ffffff;
+ animation-name: blink;
+ animation-duration: 0.5s;
+ animation-timing-function: linear;
+ animation-iteration-count: infinite;
+ animation-direction: alternate;
+}
+
+label:focus {
+ background-color: #000000;
+}
+
+#cpu {
+}
+
+#memory {
+}
+
+#disk {
+}
+
+#backlight {
+}
+
+#network {
+}
+
+#network.disconnected {
+}
+
+#wireplumber {
+ background-color: #fff0f5;
+ color: #000000;
+}
+
+#wireplumber.muted {
+ background-color: #f53c3c;
+}
+
+#temperature {
+}
+
+#temperature.critical {
+}
+
+#tray {
+ background-color: #ed45b8;
+}
+
+#tray > .passive {
+ -gtk-icon-effect: dim;
+}
+
+#tray > .needs-attention {
+ -gtk-icon-effect: highlight;
+ background-color: #eb4d4b;
+}
+
+#idle_inhibitor {
+}
+
+#idle_inhibitor.activated {
+}
+
+#mpd {
+}
+
+#mpd.disconnected {
+}
+
+#mpd.stopped {
+}
+
+#mpd.paused {
+}
+
+#language {
+ background: #ed45b8;
+ color: #740864;
+ padding: 0 5px;
+ margin: 0 5px;
+ min-width: 16px;
+}
+
+#keyboard-state {
+ background: #ed45b8;
+ color: #000000;
+ padding: 0 0px;
+ margin: 0 5px;
+ min-width: 16px;
+}
+
+#keyboard-state > label {
+ padding: 0 5px;
+}
+
+#keyboard-state > label.locked {
+ background: rgba(255, 0, 0, 0.2);
+}
diff --git a/home-modules/desktop/wayland/waybar.nix b/home-modules/desktop/wayland/waybar.nix
new file mode 100644
index 0000000..5f3c532
--- /dev/null
+++ b/home-modules/desktop/wayland/waybar.nix
@@ -0,0 +1,131 @@
+{pkgs, hostconfig, lib, config,...}: {
+ options.homeprogs.waybar.enable = lib.mkEnableOption "Enable waybar";
+
+ config = lib.mkIf config.homeprogs.waybar.enable {
+ programs.waybar = {
+ enable = true;
+ settings = [{
+ layer = "top";
+ position = "top";
+ height = 30;
+ spacing = 6;
+ modules-left = [
+ "hyprland/workspaces"
+ "hyprland/window"
+ ];
+
+ modules-center = [
+ "clock"
+ "hyprland/language"
+ "tray"
+ "battery"
+ ];
+
+ modules-right = [
+ "idle_inhibitor"
+ "wireplumber"
+ "network"
+ "cpu"
+ "memory"
+ "disk"
+ "temperature"
+ "backlight"
+ ];
+ wireplumber = {
+ scroll-step = 1; #%, can be a float
+ format = "{volume}% ";
+ format-muted = "Muted";
+ on-click = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
+ on-click-right = "pavucontrol";
+ };
+
+ network = {
+ # interface = "wlp2*"; # (Optional) To force the use of this interface
+ format-wifi = "({signalStrength}%) ";
+ format-ethernet = "{ifname} ";
+ tooltip-format = "{ifname} via {gwaddr} ";
+ format-linked = "{ifname} (No IP) ";
+ format-disconnected = "Disconnected ⚠";
+ format-alt= "{essid}: {ipaddr}/{cidr}";
+ };
+
+ "hyprland/workspaces" = {
+ all-outputs = false;
+ active-only = false;
+ format = "{name}";
+ format-icons = {
+ urgent = "";
+ focused = "";
+ default = "";
+ };
+ };
+
+ "hyprland/window" = {
+ max-length = 200;
+ separate-outputs = true;
+ };
+
+
+ keyboard-state = {
+ numlock = false;
+ format = "{name} {icon}";
+ format-icons = {
+ locked = "";
+ unlocked = "";
+ };
+ };
+ idle_inhibitor = {
+ format = "{icon}";
+ format-icons = {
+ activated = "";
+ deactivated = "";
+ };
+ };
+ tray = {
+ icon-size = 21;
+ spacing = 10;
+ };
+ clock = {
+ timezone = "Europe/Amsterdam";
+ tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
+ format-alt = "{:%Y-%m-%d}";
+ };
+ cpu = {
+ format = "{usage}% ";
+ tooltip = false;
+ };
+ memory = {
+ format = "{}% ";
+ };
+ temperature = {
+ thermal-zone = 1;
+ # hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input";
+ critical-threshold = 80;
+ # format-critical = "{temperatureC}°C {icon}";
+ format = "{temperatureC}°C {icon}";
+ format-icons = ["" "" ""];
+ };
+ "backlight" = {
+ # device = "acpi_video1";
+ format = "{percent}{icon}";
+ format-icons = ["" "" "" "" "" "" "" "" ""];
+ };
+ battery = {
+ states = {
+ # good = 95;
+ warning = 30;
+ critical = 15;
+ };
+ format = "{capacity}% {icon}";
+ format-charging = "{capacity}% ";
+ format-plugged = "{capacity}% ";
+ format-alt = "{time} {icon}";
+ # format-good = ""; // An empty format will hide the module
+ # format-full = "";
+ format-icons = ["" "" "" "" ""];
+ };
+ }];
+ style = ./waybar.css;
+ };
+ };
+}