dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 8cae025e754971c206536d99fcc687ec570c619f parent b0745fcb45f4277d960585334563dad600511ed8 Author: maydayv7 <maydayv7@gmail.com> Date: Sun, 17 Aug 2025 22:23:58 +0530 refactor: Shared configuration for Hyprland and Niri And some QOL improvements for Niri
Diffstat:
| M | files/niri/theme/waybar.css | | | 7 | ++----- |
| D | modules/gui/desktop/common/apps/browser.nix | | | 24 | ------------------------ |
| D | modules/gui/desktop/common/apps/files.nix | | | 130 | ------------------------------------------------------------------------------- |
| D | modules/gui/desktop/common/apps/login.nix | | | 32 | -------------------------------- |
| D | modules/gui/desktop/common/apps/media.nix | | | 47 | ----------------------------------------------- |
| D | modules/gui/desktop/common/apps/misc.nix | | | 84 | ------------------------------------------------------------------------------- |
| D | modules/gui/desktop/common/apps/notify.nix | | | 88 | ------------------------------------------------------------------------------- |
| D | modules/gui/desktop/common/apps/panel.nix | | | 18 | ------------------ |
| D | modules/gui/desktop/common/apps/security.nix | | | 110 | ------------------------------------------------------------------------------- |
| D | modules/gui/desktop/common/apps/style.nix | | | 31 | ------------------------------- |
| D | modules/gui/desktop/common/apps/terminal.nix | | | 41 | ----------------------------------------- |
| D | modules/gui/desktop/common/apps/text.nix | | | 58 | ---------------------------------------------------------- |
| D | modules/gui/desktop/common/apps/utilities.nix | | | 94 | ------------------------------------------------------------------------------- |
| D | modules/gui/desktop/common/theme.nix | | | 32 | -------------------------------- |
| M | modules/gui/desktop/hyprland/apps/panel.nix | | | 289 | +++++-------------------------------------------------------------------------- |
| M | modules/gui/desktop/hyprland/default.nix | | | 11 | ++++------- |
| M | modules/gui/desktop/niri/apps/panel.nix | | | 282 | ++++++------------------------------------------------------------------------- |
| M | modules/gui/desktop/niri/apps/utilities.nix | | | 15 | +++++++++++++++ |
| M | modules/gui/desktop/niri/default.nix | | | 18 | ++++++------------ |
| M | modules/gui/desktop/niri/settings/apps.nix | | | 87 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------- |
| M | modules/gui/desktop/niri/settings/keybinds.nix | | | 63 | +++++++++++++++++++++++++++++++++++++++++++++++++-------------- |
| A | modules/gui/desktop/shared/_default.nix | | | 5 | +++++ |
| A | modules/gui/desktop/shared/browser.nix | | | 30 | ++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/files.nix | | | 133 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/login.nix | | | 35 | +++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/media.nix | | | 51 | +++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/misc.nix | | | 87 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/notify.nix | | | 90 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/panel.nix | | | 315 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/security.nix | | | 112 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/style.nix | | | 38 | ++++++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/terminal.nix | | | 47 | +++++++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/text.nix | | | 63 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/theme.nix | | | 40 | ++++++++++++++++++++++++++++++++++++++++ |
| A | modules/gui/desktop/shared/utilities.nix | | | 96 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | modules/hardware/filesystem.nix | | | 2 | +- |
36 files changed, 1328 insertions(+), 1377 deletions(-)
diff --git a/files/niri/theme/waybar.css b/files/niri/theme/waybar.css @@ -19,10 +19,7 @@ tooltip { color: #ffffff; } -#user * { - padding: 0 0.5em; -} -#user { +#custom-user { background-color: @base0F; color: @base00; } @@ -169,13 +166,13 @@ window#waybar.empty #window { #custom-dunst, #custom-logo, #custom-power, +#custom-user, #custom-weather, #idle_inhibitor, #keyboard-state, #mpris, #network, #power-profiles-daemon, -#user, #wireplumber { padding: 3px; margin: 2px; diff --git a/modules/gui/desktop/common/apps/browser.nix b/modules/gui/desktop/common/apps/browser.nix @@ -1,24 +0,0 @@ -{ - theme, - ... -}: -{ - ## Browser Configuration - apps.list = [ "firefox" ]; - user.homeConfig = { - home.file.".mozilla/firefox/default/chrome/userChrome.css".text = '' - #TabsToolbar { - -moz-window-dragging: no-drag; - } - ''; - - # Theme - programs.firefox.policies.ExtensionSettings = { - name = with theme; "${name}-${variant}-${accent}"; - value = { - installation_mode = "normal_installed"; - install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/{d49033ac-8969-488c-afb0-5cdb73957f41}/latest.xpi"; - }; - }; - }; -} diff --git a/modules/gui/desktop/common/apps/files.nix b/modules/gui/desktop/common/apps/files.nix @@ -1,130 +0,0 @@ -{ - config, - lib, - util, - pkgs, - files, - ... -}: -let - inherit (lib) - hm - getExe - getExe' - replaceStrings - ; - - inherit (config.gui) icons; - terminal = "kitty"; - nemo = pkgs.nemo-with-extensions; -in -{ - ## File Manager Configuration - services.dbus.packages = [ nemo ]; - environment.systemPackages = [ - nemo - ] - ++ (with pkgs; [ - cinnamon-desktop - bulky - file-roller - lxqt.pcmanfm-qt - ]); - - user = { - persist.directories = [ - ".config/nemo" - ".local/share/nemo" - ".config/pcmanfm-qt" - ]; - - homeConfig = { - xdg.mimeApps.defaultApplications = util.build.mime { - archive = [ "org.gnome.FileRoller.desktop" ]; - directory = [ "nemo.desktop" ]; - }; - - # Settings - dconf.settings = { - "org/gtk/gtk4/settings/file-chooser".sort-directories-first = true; - "org/nemo/search".search-reverse-sort = false; - "org/nemo/desktop".show-desktop-icons = false; - "org/nemo/plugins".disabled-actions = [ "change-background.nemo_action" ]; - "org/nemo/icon-view".captions = [ - "size" - "type" - "date_modified" - ]; - - "org/nemo/preferences" = { - click-policy = "double"; - date-format = "informal"; - inherit-folder-viewer = true; - quick-renames-with-pause-in-between = true; - show-advanced-permissions = true; - show-new-folder-icon-toolbar = false; - show-show-thumbnails-toolbar = true; - tooltips-in-icon-view = true; - tooltips-in-list-view = false; - tooltips-show-access-date = true; - tooltips-show-birth-date = true; - tooltips-show-file-type = true; - tooltips-show-mod-date = true; - }; - - "org/nemo/preferences/menu-config" = { - background-menu-open-in-terminal = false; - selection-menu-open-in-terminal = false; - }; - }; - - home = { - # Bulk Renamer - activation.nemo-rename = hm.dag.entryAfter [ "writeBoundary" ] '' - if [[ -v DBUS_SESSION_BUS_ADDRESS ]] - then - export DCONF_DBUS_RUN_SESSION="" - else - export DCONF_DBUS_RUN_SESSION="${getExe' pkgs.dbus "dbus-run-session"} --dbus-daemon=${getExe' pkgs.dbus "dbus-daemon"}" - fi - - run $DCONF_DBUS_RUN_SESSION ${getExe pkgs.dconf} write /org/nemo/preferences/bulk-rename-tool "b'bulky'" - unset DCONF_DBUS_RUN_SESSION - ''; - - file = { - # Open in Terminal - ".local/share/nemo/actions/terminal.nemo_action".text = '' - [Nemo Action] - Name=Open in Terminal - Comment=Opens ${terminal} in the selected folder - Exec=${terminal} --working-directory=%F - Icon-Name=${terminal} - Selection=any - Extensions=dir; - EscapeSpaces=true - ''; - - # Desktop Icons - ".config/pcmanfm-qt/default/settings.conf".text = - replaceStrings - [ - "@icon" - "@font" - "@terminal" - "@wallpaper" - "@archiver" - ] - [ - icons.name - config.stylix.fonts.sansSerif.name - terminal - (builtins.toString files.images.transparent) - "file-roller" - ] - files.pcmanfm; - }; - }; - }; - }; -} diff --git a/modules/gui/desktop/common/apps/login.nix b/modules/gui/desktop/common/apps/login.nix @@ -1,32 +0,0 @@ -{ - lib, - pkgs, - theme ? import ./theme.nix pkgs, - ... -}: -let - inherit (lib) mkForce; -in -{ - ## Login Configuration ## - stylix.targets.regreet.enable = true; - environment.persist.directories = [ "/var/lib/regreet" ]; - programs.regreet = { - enable = true; - package = pkgs.greetd.regreet; - settings.commands = { - reboot = [ - "systemctl" - "reboot" - ]; - poweroff = [ - "systemctl" - "poweroff" - ]; - }; - - extraCss = mkForce ""; - theme = mkForce theme.gtk; - iconTheme = mkForce theme.icons; - }; -} diff --git a/modules/gui/desktop/common/apps/media.nix b/modules/gui/desktop/common/apps/media.nix @@ -1,47 +0,0 @@ -{ - util, - pkgs, - ... -}: -{ - ## Media Configuration - environment.systemPackages = with pkgs; [ - celluloid - lollypop - papers - playerctl - shotwell - transmission_4-gtk - ]; - - user = { - # Persisted Files - persist.directories = [ - ".config/mpv" - ".config/shotwell" - ".local/share/lollypop" - ".local/share/shotwell" - ".cache/shotwell" - ]; - - homeConfig = { - # Default Applications - xdg.mimeApps.defaultApplications = util.build.mime { - audio = [ "org.gnome.Lollypop.desktop" ]; - document = [ "org.gnome.Papers.desktop" ]; - image = [ "org.gnome.Shotwell-Viewer.desktop" ]; - magnet = [ "transmission-gtk.desktop" ]; - pdf = [ "org.gnome.Papers.desktop" ]; - video = [ "io.github.celluloid_player.Celluloid.desktop" ]; - }; - - # Media Player - services.playerctld.enable = true; - programs.mpv = { - enable = true; - defaultProfiles = [ "gpu-hq" ]; - scripts = [ pkgs.mpvScripts.mpris ]; - }; - }; - }; -} diff --git a/modules/gui/desktop/common/apps/misc.nix b/modules/gui/desktop/common/apps/misc.nix @@ -1,84 +0,0 @@ -{ - config, - lib, - inputs, - pkgs, - theme, - ... -}: -let - inherit (lib) mkIf; - inherit (builtins) concatStringsSep elem map; - exists = app: elem app config.apps.list; -in -{ - ## 3rd Party Apps Configuration - apps = with theme; { - # Logseq Notes - logseq.style = "url('https://logseq.${name}.com/ctp-${variant}.css')"; - - # YouTube Music - ytmusic.style = "@import url('https://youtubemusic.${name}.com/src/${variant}.css');"; - }; - - user.homeConfig = { - # Theme - imports = [ inputs.catppuccin.homeModules.catppuccin ]; - catppuccin = with theme; { - inherit accent; - flavor = variant; - - thunderbird.enable = true; - vesktop.enable = true; - vscode.enable = true; - }; - - # Code Editor - programs.vscode.profiles.default = mkIf (exists "vscode") { - extensions = [ pkgs.vscode-extensions.catppuccin.catppuccin-vsc-icons ]; - userSettings = { - "workbench.iconTheme" = with theme; "${name}-${variant}"; - "terminal.external.linuxExec" = "kitty"; - }; - }; - - # KDE Apps - home.file.".config/kdeglobals".text = - with config.lib.stylix.colors; - '' - [Colors:Selection] - BackgroundNormal=${base0D-rgb-r},${base0D-rgb-g},${base0D-rgb-b} - BackgroundAlternate=${base0D-rgb-r},${base0D-rgb-g},${base0D-rgb-b} - ForegroundNormal=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} - ForegroundActive=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} - ForegroundInactive=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} - ForegroundLink=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} - ForegroundVisited=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} - '' - + (concatStringsSep "\n" ( - map - (name: '' - [Colors:${name}] - BackgroundNormal=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} - BackgroundAlternate=${base01-rgb-r},${base01-rgb-g},${base01-rgb-b} - DecorationFocus=${base0D-rgb-r},${base0D-rgb-g},${base0D-rgb-b} - DecorationHover=${base0D-rgb-r},${base0D-rgb-g},${base0D-rgb-b} - ForegroundNormal=${base05-rgb-r},${base05-rgb-g},${base05-rgb-b} - ForegroundActive=${base05-rgb-r},${base05-rgb-g},${base05-rgb-b} - ForegroundInactive =${base05-rgb-r},${base05-rgb-g},${base05-rgb-b} - ForegroundLink=${base05-rgb-r},${base05-rgb-g},${base05-rgb-b} - ForegroundVisited=${base05-rgb-r},${base05-rgb-g},${base05-rgb-b} - ForegroundNegative=${base08-rgb-r},${base08-rgb-g},${base08-rgb-b} - ForegroundNeutral=${base0D-rgb-r},${base0D-rgb-g},${base0D-rgb-b} - ForegroundPositive=${base0B-rgb-r},${base0B-rgb-g},${base0B-rgb-b} - '') - [ - "View" - "Window" - "Button" - "Tooltip" - "Complementary" - ] - )); - }; -} diff --git a/modules/gui/desktop/common/apps/notify.nix b/modules/gui/desktop/common/apps/notify.nix @@ -1,88 +0,0 @@ -{ - config, - lib, - theme, - ... -}: -let - inherit (lib) mkForce; - inherit (theme) icons; - inherit (config.lib.stylix) colors; -in -{ - ## Notifications Configuration - # Phone Connect - user.persist.directories = [ ".config/kdeconnect" ]; - programs.kdeconnect.enable = true; - user.homeConfig = { - services.kdeconnect = { - enable = true; - indicator = true; - }; - - # Notifications Daemon - stylix.targets.dunst.enable = true; - services.dunst = - let - system = { - fullscreen = "show"; - highlight = "#${colors.base07}"; - history_ignore = "yes"; - override_pause_level = 70; - }; - in - { - enable = true; - iconTheme = icons; - settings = { - global = { - alignment = "center"; - corner_radius = 10; - follow = "mouse"; - format = "<b>%s</b>\\n%b"; - frame_width = 1; - horizontal_padding = 8; - icon_corner_radius = 10; - icon_position = "left"; - icon_theme = icons.name; - indicate_hidden = "yes"; - markup = "yes"; - max_icon_size = 64; - mouse_left_click = "do_action"; - mouse_middle_click = "close_all"; - mouse_right_click = "close_current"; - offset = "10x5"; - padding = 8; - progress_bar_corner_radius = 10; - separator_height = 1; - show_indicators = false; - shrink = "no"; - transparency = 10; - word_wrap = "yes"; - }; - - urgency_low.frame_color = mkForce "#${colors.base0E}"; - urgency_normal.frame_color = mkForce "#${colors.base0D}"; - fullscreen_delay.fullscreen = "delay"; - utility = { - appname = "utility"; - } - // system; - upower = { - appname = "poweralertd"; - new_icon = "/run/current-system/sw/share/icons/${icons.name}/24x24/apps/preferences-system-power.svg"; - } - // system; - - hyprland = { - appname = "grimblast"; - } - // system; - niri = { - appname = "niri"; - } - // system; - }; - }; - }; -} diff --git a/modules/gui/desktop/common/apps/panel.nix b/modules/gui/desktop/common/apps/panel.nix @@ -1,18 +0,0 @@ -{ pkgs, ... }: -{ - ## Panel Configuration - user.homeConfig = { - stylix.targets.waybar = { - enable = true; - font = "sansSerif"; - addCss = false; - }; - - home.packages = [ pkgs.wttrbar ]; - programs.waybar = { - enable = true; - systemd.enable = true; - package = pkgs.unstable.waybar; - }; - }; -} diff --git a/modules/gui/desktop/common/apps/security.nix b/modules/gui/desktop/common/apps/security.nix @@ -1,110 +0,0 @@ -{ - config, - lib, - util, - pkgs, - files, - ... -}: -let - inherit (lib) getExe getExe'; - locker = pkgs.swaylock-effects; -in -{ - ## Security Configuration - # User Authentication - security = { - soteria.enable = true; - pam.services.swaylock.text = "auth include login"; - }; - - user.homeConfig = { - # Locker - stylix.targets.swaylock = { - enable = true; - useImage = true; - }; - - programs.swaylock = { - enable = true; - package = locker; - settings = { - clock = true; - indicator = true; - font = config.stylix.fonts.sansSerif.name; - effect-vignette = "0.3:1"; - }; - }; - - # Idle Daemon - services.swayidle = - let - pause = "${getExe pkgs.playerctl} pause -a;"; - lock = - pre: flag: - "sh -c 'if ! ${getExe' pkgs.procps "pgrep"} -x swaylock; then ${pre} ${getExe locker} -f ${flag}; fi'"; - in - { - enable = true; - extraArgs = [ "-w" ]; - events = [ - { - event = "before-sleep"; - command = lock pause ""; - } - { - event = "lock"; - command = lock pause "--fade-in 0.2 --grace 15 --grace-no-mouse"; - } - ]; - }; - - # Logout - programs.wlogout = { - enable = true; - style = util.build.theme { - inherit (config.lib.stylix) colors; - file = files.wlogout; - }; - - layout = [ - { - label = "lock"; - action = "loginctl lock-session"; - text = ""; - keybind = "l"; - } - { - label = "logout"; - action = "loginctl terminate-user $USER"; - text = "↶"; - keybind = "e"; - } - { - label = "shutdown"; - action = "systemctl poweroff"; - text = "⏻"; - keybind = "s"; - } - { - label = "reboot"; - action = "systemctl reboot"; - text = "↺"; - keybind = "r"; - } - { - label = "suspend"; - action = "systemctl suspend"; - text = ""; - keybind = "u"; - } - { - label = "hibernate"; - action = "systemctl hibernate"; - text = ""; - keybind = "h"; - } - ]; - }; - }; -} diff --git a/modules/gui/desktop/common/apps/style.nix b/modules/gui/desktop/common/apps/style.nix @@ -1,31 +0,0 @@ -{ - pkgs, - files, - theme, - ... -}: -{ - ## Desktop Integration - stylix.base16Scheme = files.colors.catppuccin; - environment.systemPackages = [ pkgs.custom.cursors ]; - gui = with theme; { - inherit (theme) icons; - - gtk = { - enable = true; - theme = gtk; - }; - - qt = { - enable = true; - theme = qt; - style = "kvantum"; - }; - }; - - # GTK Apps - user.homeConfig.dconf.settings."org/gnome/desktop/wm/preferences" = { - action-double-click-titlebar = "none"; - button-layout = "appmenu"; - }; -} diff --git a/modules/gui/desktop/common/apps/terminal.nix b/modules/gui/desktop/common/apps/terminal.nix @@ -1,41 +0,0 @@ -{ - pkgs, - theme, - ... -}: -{ - ## Terminal Configuration - user.homeConfig = { - programs.kitty = { - enable = true; - themeFile = with theme; "${name-alt}-${variant-alt}"; - keybindings = { - "ctrl+c" = "copy_or_interrupt"; - "kitty_mod+f" = - "launch --allow-remote-control kitty +kitten search/search.py @active-kitty-window-id"; - }; - - settings = { - kitty_mod = "ctrl+shift"; - confirm_os_window_close = 2; - copy_on_select = "clipboard"; - placement_strategy = "center"; - scrollback_lines = 10000; - enable_audio_bell = "no"; - visual_bell_duration = "0.1"; - - cursor_shape = "beam"; - cursor_shape_unfocused = "underline"; - tab_bar_style = "powerline"; - tab_powerline_style = "round"; - window_padding_width = 10; - }; - }; - - home.file.".config/kitty/search".source = pkgs.custom.kitty-search; - stylix.targets.kitty = { - enable = true; - variant256Colors = true; - }; - }; -} diff --git a/modules/gui/desktop/common/apps/text.nix b/modules/gui/desktop/common/apps/text.nix @@ -1,58 +0,0 @@ -{ - config, - pkgs, - util, - files, - theme, - ... -}: -{ - ## Text Configuration - environment.systemPackages = [ pkgs.geany ]; - user = { - persist.directories = [ - ".config/clipse" - ".config/geany" - ]; - - homeConfig = { - # Text Editor - xdg.mimeApps.defaultApplications = util.build.mime { - markdown = [ "geany.desktop" ]; - text = [ "geany.desktop" ]; - }; - - home.file = with files.geany; { - ".config/geany/geany.conf".text = settings; - ".config/geany/keybindings.conf".text = keybindings; - ".config/geany/colorschemes/theme.conf".source = - with theme; - "${pkgs.custom.geany-catppuccin}/share/geany/colorschemes/${name}-${variant}.conf"; - }; - - # Clipboard Manager - services.clipse = { - enable = true; - allowDuplicates = false; - historySize = 150; - imageDisplay.type = "kitty"; - theme = with config.lib.stylix.colors; { - useCustomTheme = true; - DimmedDesc = "#${base07}"; - DimmedTitle = "#${base07}"; - FilteredMatch = "#${base08}"; - NormalTitle = "#${base08}"; - NormalDesc = "#${base0B}"; - SelectedDesc = "#${base0D}"; - SelectedTitle = "#${base0D}"; - SelectedBorder = "#${base0D}"; - SelectedDescBorder = "#${base0D}"; - TitleFore = "#${base05}"; - Titleback = "#${base01}"; - StatusMsg = "#${base0E}"; - PinIndicatorColor = "#${base0F}"; - }; - }; - }; - }; -} diff --git a/modules/gui/desktop/common/apps/utilities.nix b/modules/gui/desktop/common/apps/utilities.nix @@ -1,94 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - inherit (lib) getExe; - inherit (config.lib.stylix) colors; -in -{ - environment.systemPackages = with pkgs; [ - # Apps - clipse - font-manager - gnome-clocks - gnome-disk-utility - hyprpicker - nwg-drawer - overskride - qalculate-gtk - remmina - resources - smile - - # Utilities - custom.sysutils - pavucontrol - wev - wlclock - wl-clipboard - wl-screenrec - wlr-randr - - # Network Settings - (gnome-control-center.overrideAttrs (old: { - postInstall = old.postInstall + '' - dir=$out/share/applications - for panel in $dir/* - do - [ "$panel" = "$dir/gnome-network-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-wifi-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-wwan-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-sharing-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-wacom-panel.desktop" ] && continue - rm "$panel" - done - ''; - })) - ]; - - ## Essential Utilities - # Power - services = { - power-profiles-daemon.enable = true; - upower.enable = true; - }; - - # Backlight - hardware.brillo.enable = true; - user.groups = [ - "input" - "video" - ]; - - user = { - homeConfig = { - systemd.user.services.wlclock = - let - target = [ "graphical-session.target" ]; - in - { - Install.WantedBy = target; - Unit = { - Description = "Desktop Clock"; - After = target; - }; - Service.ExecStart = - with colors; - "${getExe pkgs.wlclock} --layer bottom --exclusive-zone true --position top-right --margin 10 --size 300 --corner-radius 10 --border-size 2 --hand-width 7 --marking-width 3 --background-colour #${base00}4d --clock-colour #${base0D} --border-colour #${base00}"; - }; - - # Network Settings - xdg.desktopEntries."org.gnome.Settings" = { - name = "Network Settings"; - comment = "Gnome Control Center"; - icon = "org.gnome.Settings"; - exec = "env XDG_CURRENT_DESKTOP=gnome gnome-control-center"; - categories = [ "X-Preferences" ]; - terminal = false; - }; - }; - }; -} diff --git a/modules/gui/desktop/common/theme.nix b/modules/gui/desktop/common/theme.nix @@ -1,32 +0,0 @@ -pkgs: rec { - # Theming - name = "catppuccin"; - name-alt = "Catppuccin"; - - accent = "blue"; - variant = "macchiato"; - variant-alt = "Macchiato"; - - gtk = { - name = "${name}-${variant}-${accent}-standard"; - package = pkgs.catppuccin-gtk.override { - accents = [ accent ]; - inherit variant; - }; - }; - - qt = { - name = "${name}-${variant}-${accent}"; - package = pkgs.catppuccin-kvantum.override { - inherit accent variant; - }; - }; - - icons = { - name = "Papirus-Dark"; - package = pkgs.catppuccin-papirus-folders.override { - inherit accent; - flavor = variant; - }; - }; -} diff --git a/modules/gui/desktop/hyprland/apps/panel.nix b/modules/gui/desktop/hyprland/apps/panel.nix @@ -1,25 +1,22 @@ { config, - pkgs, + lib, files, - theme, ... }: let + inherit (lib) mkMerge; + inherit (config.shared) panel; inherit (config.gui) display; in { ## Panel Configuration user.homeConfig.programs.waybar = { style = files.hyprland.waybar; - - # Panel settings = let shared = { - layer = "top"; position = "top"; - height = 30; spacing = 3; margin-top = 2; @@ -27,12 +24,6 @@ in margin-bottom = 1; margin-left = 5; - "custom/logo" = { - format = ""; - tooltip = false; - on-click = "nwg-drawer"; - }; - "group/users" = { orientation = "horizontal"; modules = [ @@ -42,20 +33,6 @@ in drawer.transition-left-to-right = true; }; - user = { - format = "{user}"; - icon = true; - height = 30; - width = 30; - open-on-click = true; - }; - - "custom/power" = { - format = "⏻"; - tooltip = false; - on-click = "wlogout -p layer-shell"; - }; - "hyprland/workspaces" = { all-outputs = false; show-special = true; @@ -99,7 +76,7 @@ in icon-size = 20; all-outputs = false; active-first = false; - icon-theme = theme.icons.name; + icon-theme = config.shared.theme.icons.name; markup = true; tooltip-format = "Name: <big><b>{name}</b></big> <i>{short_state}</i>\nTitle: <b>{title}</b>"; on-click = "activate"; @@ -118,111 +95,12 @@ in "group/menu" = { orientation = "horizontal"; - modules = [ - "custom/hide" - "keyboard-state" - "tray" - ]; - drawer = { - click-to-reveal = true; - transition-left-to-right = true; - }; - }; - - "custom/hide" = { - format = ""; - tooltip = false; - }; - - tray.icon-size = 14; - keyboard-state = { - numlock = true; - capslock = true; - format = { - numlock = " N {icon}"; - capslock = " {icon}"; - }; - format-icons = { - locked = ""; - unlocked = ""; - }; - }; - - bluetooth = { - format = ""; - format-disabled = ""; - format-connected = " {num_connections}"; - tooltip-format = " {status}"; - tooltip-format-connected = "{device_enumerate}"; - tooltip-format-enumerate-connected = " {device_alias} {device_battery_percentage}%"; - on-click = "overskride"; + drawer.transition-left-to-right = true; }; - network = - let - tooltip = "Strength: <b>{signaldBm}dBm ({signalStrength}%)</b>\nFrequency: <b>{frequency}MHz</b>\nInterface: <b>{ifname}</b>\nIP: <b>{ipaddr}/{cidr}</b>\nGateway: <b>{gwaddr}</b>\nNetmask: <b>{netmask}</b>"; - in - { - format = "{ifname}"; - format-disconnected = ""; - format-wifi = "{icon}"; - format-ethernet = ""; - format-icons = [ - "" - "" - "" - "" - "" - ]; - format-linked = " {ifname}"; - tooltip-format-wifi = "Network: <big><b>{essid}</b></big>\n${tooltip}"; - tooltip-format-ethernet = "Network: <big><b>Wired</b></big>\n${tooltip}"; - tooltip-format-disconnected = " Disconnected"; - on-click = "sh -c 'env XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi'"; - }; - "group/media" = { orientation = "horizontal"; - modules = [ - "wireplumber" - "mpris" - ]; - drawer = { - transition-left-to-right = false; - transition-duration = 1000; - }; - }; - - wireplumber = { - max-volume = 150; - scroll-step = 1; - reverse-scrolling = 1; - format = "{icon}"; - tooltip-format = "Volume: {volume}%\nDevice: {node_name}"; - format-icons = [ - "" - "" - "" - ]; - format-muted = ""; - on-click = "pavucontrol"; - }; - - mpris = { - dynamic-len = 20; - dynamic-order = [ - "title" - "artist" - "length" - ]; - dynamic-separator = " - "; - format = " {player}"; - format-paused = " <i>{player}</i>"; - format-stopped = ""; - tooltip-format-stopped = "Not Playing"; - on-click = "sysutils media toggle"; - on-click-right = "sysutils media next"; - on-click-middle = "sysutils media previous"; + drawer.transition-left-to-right = false; }; "group/display" = { @@ -234,24 +112,7 @@ in drawer.transition-left-to-right = false; }; - backlight = { - format = "{icon}"; - tooltip-format = "Backlight: {percent}%"; - format-icons = [ - "" - "" - "" - "" - "" - "" - "" - "" - "" - ]; - on-scroll-up = "sysutils brightness down"; - on-scroll-down = "sysutils brightness up"; - on-click = "nwg-displays"; - }; + backlight.on-click = "nwg-displays"; "custom/temperature" = { format = ""; @@ -263,141 +124,19 @@ in "group/power" = { orientation = "horizontal"; - modules = [ - "battery" - "power-profiles-daemon" - ]; drawer.transition-left-to-right = false; }; battery = { - interval = 5; align = 0; - rotate = 0; - format = "{icon}"; - tooltip-format = "Battery: {capacity}%"; - format-charging = ""; - format-icons = [ - "" - "" - "" - "" - "" - ]; on-click-right = "hyprutils toggle fancy"; - states = { - good = 80; - warning = 20; - critical = 10; - }; - }; - - power-profiles-daemon = { - format = "{icon}"; - tooltip = true; - tooltip-format = "Power Profile: {profile}"; - format-icons = { - default = ""; - performance = ""; - balanced = ""; - power-saver = ""; - }; - }; - - "custom/weather" = { - format = "{}°"; - return-type = "json"; - exec = "wttrbar --date-format %d/%m --nerd"; - tooltip = true; - interval = 600; - signal = 7; - on-click = "pkill -RTMIN+7 waybar"; - }; - - clock = { - interval = 1; - format = " {:%H:%M:%S} "; - format-alt = " {:%I:%M %A, %d %B %Y} "; - tooltip-format = "<tt><small>{calendar}</small></tt>"; - calendar = { - mode = "year"; - mode-mon-col = 3; - weeks-pos = "left"; - on-scroll = 1; - format = with config.lib.stylix.colors; { - months = "<span color='#${base06}'><b>{}</b></span>"; - days = "<span color='#${base05}'><b>{}</b></span>"; - weeks = "<span color='#${base0C}'><b>W{}</b></span>"; - weekdays = "<span color='#${base0A}'><b>{}</b></span>"; - today = "<span color='#${base08}'><b><u>{}</u></b></span>"; - }; - }; - - actions = { - on-click-right = "mode"; - on-click-forward = "tz_up"; - on-click-backward = "tz_down"; - on-scroll-up = "shift_down"; - on-scroll-down = "shift_up"; - }; }; "group/notify" = { orientation = "horizontal"; - modules = [ - "custom/dunst" - "idle_inhibitor" - ]; drawer.transition-left-to-right = false; }; - "custom/dunst" = - let - run = - text: - "${ - pkgs.writeShellApplication { - name = "notify"; - inherit text; - runtimeInputs = with pkgs; [ - coreutils - dunst - ]; - } - }/bin/notify"; - in - { - tooltip = false; - on-click = "dunstctl history-pop"; - restart-interval = 1; - on-click-right = run '' - if dunstctl is-paused | grep -q "false" - then - dunstctl set-pause-level 50 - else - dunstctl set-pause-level 0 - fi - ''; - exec = run '' - COUNT=$(dunstctl count waiting) - ENABLED="" - DISABLED="" - if [ "$COUNT" != 0 ]; then DISABLED=" $COUNT"; fi - if dunstctl is-paused | grep -q "false"; then echo "$ENABLED"; else echo "$DISABLED"; fi - ''; - }; - - idle_inhibitor = { - format = "{icon}"; - on-click = "sysutils toggle service swayidle"; - tooltip-format-activated = "Idle Inhibitor: On"; - tooltip-format-deactivated = "Idle Inhibitor: Off"; - format-icons = { - activated = ""; - deactivated = ""; - }; - }; - modules-left = [ "custom/logo" "group/users" @@ -413,9 +152,10 @@ in }; in [ - ( + (mkMerge [ + panel shared - // { + { output = display; modules-right = [ "group/menu" @@ -429,10 +169,11 @@ in "group/notify" ]; } - ) - ( + ]) + (mkMerge [ + panel shared - // { + { output = "!" + display; modules-right = [ "group/menu" @@ -445,7 +186,7 @@ in "group/notify" ]; } - ) + ]) ]; }; } diff --git a/modules/gui/desktop/hyprland/default.nix b/modules/gui/desktop/hyprland/default.nix @@ -14,18 +14,14 @@ let mkMerge replaceStrings ; - - inherit (util.map.modules) list; - inherit (config.gui) desktop; in { ## Hyprland Configuration ## - config = mkIf (desktop == "hyprland") ( + imports = [ ../shared/_default.nix ]; + config = mkIf (config.gui.desktop == "hyprland") ( mkMerge ( # App Configuration - (builtins.map (path: import path (args // { theme = import ../common/theme.nix pkgs; })) ( - list ../common/apps ++ list ./apps - )) + (builtins.map (path: import path args) (util.map.modules.list ./apps)) ++ [ ## Environment Setup rec { @@ -59,6 +55,7 @@ in xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; # Settings + shared.enable = true; user = { persist.directories = [ ".config/hypr" ]; homeConfig.imports = [ ./settings ]; diff --git a/modules/gui/desktop/niri/apps/panel.nix b/modules/gui/desktop/niri/apps/panel.nix @@ -1,58 +1,38 @@ { config, - pkgs, + lib, files, ... }: let + inherit (lib) mkMerge; + inherit (config.shared) panel; inherit (config.gui) display; in { ## Panel Configuration user.homeConfig.programs.waybar = { style = files.niri.waybar; - - # Panel settings = let shared = { - layer = "top"; position = "left"; - - width = 30; + width = 40; spacing = 3; margin-top = 5; margin-right = 0; margin-bottom = 5; margin-left = 3; - "custom/logo" = { - format = ""; - tooltip = false; - on-click = "nwg-drawer"; - }; - "group/users" = { orientation = "vertical"; modules = [ - "user" + "custom/user" "custom/power" ]; drawer.transition-left-to-right = false; }; - user = { - format = "{user}"; - icon = false; - open-on-click = true; - }; - - "custom/power" = { - format = "⏻"; - tooltip = false; - on-click = "wlogout -p layer-shell"; - }; - "niri/workspaces" = { all-outputs = false; format = "<small>{value}</small>"; @@ -61,271 +41,49 @@ in "niri/window" = { format = ""; icon = true; - icon-size = 24; + icon-size = 20; separate-outputs = true; }; "group/menu" = { orientation = "vertical"; - modules = [ - "custom/hide" - "tray" - "keyboard-state" - ]; - drawer = { - click-to-reveal = true; - transition-left-to-right = false; - }; - }; - - "custom/hide" = { - format = ""; - tooltip = false; - }; - - tray.icon-size = 14; - keyboard-state = { - numlock = true; - capslock = true; - format = { - numlock = " N\n{icon}"; - capslock = "\n{icon}"; - }; - format-icons = { - locked = ""; - unlocked = ""; - }; + drawer.transition-left-to-right = false; }; - bluetooth = { - format = ""; - format-disabled = ""; - format-connected = " {num_connections}"; - tooltip-format = " {status}"; - tooltip-format-connected = "{device_enumerate}"; - tooltip-format-enumerate-connected = " {device_alias} {device_battery_percentage}%"; - on-click = "overskride"; + keyboard-state.format = { + numlock = " N\n{icon}"; + capslock = "\n{icon}"; }; - network = - let - tooltip = "Strength: <b>{signaldBm}dBm ({signalStrength}%)</b>\nFrequency: <b>{frequency}MHz</b>\nInterface: <b>{ifname}</b>\nIP: <b>{ipaddr}/{cidr}</b>\nGateway: <b>{gwaddr}</b>\nNetmask: <b>{netmask}</b>"; - in - { - format = "{ifname}"; - format-disconnected = ""; - format-wifi = "{icon}"; - format-ethernet = ""; - format-icons = [ - "" - "" - "" - "" - "" - ]; - format-linked = " {ifname}"; - tooltip-format-wifi = "Network: <big><b>{essid}</b></big>\n${tooltip}"; - tooltip-format-ethernet = "Network: <big><b>Wired</b></big>\n${tooltip}"; - tooltip-format-disconnected = " Disconnected"; - on-click = "sh -c 'env XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi'"; - }; - "group/media" = { orientation = "vertical"; - modules = [ - "wireplumber" - "mpris" - ]; - drawer = { - transition-left-to-right = true; - transition-duration = 1000; - }; - }; - - wireplumber = { - max-volume = 150; - scroll-step = 1; - reverse-scrolling = 1; - format = "{icon}"; - tooltip-format = "Volume: {volume}%\nDevice: {node_name}"; - format-icons = [ - "" - "" - "" - ]; - format-muted = ""; - on-click = "pavucontrol"; - }; - - mpris = { - dynamic-len = 20; - dynamic-order = [ - "title" - "artist" - "length" - ]; - dynamic-separator = " - "; - format = ""; - format-paused = ""; - format-stopped = ""; - tooltip-format-stopped = "Not Playing"; - on-click = "sysutils media toggle"; - on-click-right = "sysutils media next"; - on-click-middle = "sysutils media previous"; + drawer.transition-left-to-right = true; }; - backlight = { - format = "{icon}"; - tooltip-format = "Backlight: {percent}%"; - format-icons = [ - "" - "" - "" - "" - "" - "" - "" - "" - "" - ]; - on-scroll-up = "sysutils brightness down"; - on-scroll-down = "sysutils brightness up"; - }; + mpris.format = ""; "group/power" = { orientation = "vertical"; - modules = [ - "battery" - "power-profiles-daemon" - ]; drawer.transition-left-to-right = true; }; - battery = { - interval = 5; - format = "{icon}"; - tooltip-format = "Battery: {capacity}%"; - format-charging = ""; - format-icons = [ - "" - "" - "" - "" - "" - ]; - states = { - good = 80; - warning = 20; - critical = 10; - }; - }; - - power-profiles-daemon = { - format = "{icon}"; - tooltip = true; - tooltip-format = "Power Profile: {profile}"; - format-icons = { - default = ""; - performance = ""; - balanced = ""; - power-saver = ""; - }; - }; + "custom/hide".format = ""; "custom/weather" = { format = "{}"; - return-type = "json"; exec = "wttrbar --date-format %d/%m --nerd --vertical-view"; - tooltip = true; - interval = 600; - signal = 7; - on-click = "pkill -RTMIN+7 waybar"; }; clock = { - interval = 1; format = "\n{:%H\n%M\n%S} "; format-alt = "\n{:%I\n%M\n\n%d\n%m\n%y} "; - tooltip-format = "<tt><small>{calendar}</small></tt>"; - calendar = { - mode = "year"; - mode-mon-col = 3; - weeks-pos = "left"; - on-scroll = 1; - format = with config.lib.stylix.colors; { - months = "<span color='#${base06}'><b>{}</b></span>"; - days = "<span color='#${base05}'><b>{}</b></span>"; - weeks = "<span color='#${base0C}'><b>W{}</b></span>"; - weekdays = "<span color='#${base0A}'><b>{}</b></span>"; - today = "<span color='#${base08}'><b><u>{}</u></b></span>"; - }; - }; - - actions = { - on-click-right = "mode"; - on-click-forward = "tz_up"; - on-click-backward = "tz_down"; - on-scroll-up = "shift_down"; - on-scroll-down = "shift_up"; - }; }; "group/notify" = { orientation = "vertical"; - modules = [ - "custom/dunst" - "idle_inhibitor" - ]; drawer.transition-left-to-right = true; }; - "custom/dunst" = - let - run = - text: - "${ - pkgs.writeShellApplication { - name = "notify"; - inherit text; - runtimeInputs = with pkgs; [ - coreutils - dunst - ]; - } - }/bin/notify"; - in - { - tooltip = false; - on-click = "dunstctl history-pop"; - restart-interval = 1; - on-click-right = run '' - if dunstctl is-paused | grep -q "false" - then - dunstctl set-pause-level 50 - else - dunstctl set-pause-level 0 - fi - ''; - exec = run '' - COUNT=$(dunstctl count waiting) - ENABLED="" - DISABLED="" - if [ "$COUNT" != 0 ]; then DISABLED="\n$COUNT"; fi - if dunstctl is-paused | grep -q "false"; then echo "$ENABLED"; else echo "$DISABLED"; fi - ''; - }; - - idle_inhibitor = { - format = "{icon}"; - on-click = "sysutils toggle service swayidle"; - tooltip-format-activated = "Idle Inhibitor: On"; - tooltip-format-deactivated = "Idle Inhibitor: Off"; - format-icons = { - activated = ""; - deactivated = ""; - }; - }; - modules-right = [ "group/menu" "group/users" @@ -339,9 +97,10 @@ in }; in [ - ( + (mkMerge [ + panel shared - // { + { output = display; modules-left = [ "group/notify" @@ -354,10 +113,11 @@ in "bluetooth" ]; } - ) - ( + ]) + (mkMerge [ + panel shared - // { + { output = "!" + display; modules-left = [ "group/notify" @@ -368,7 +128,7 @@ in "bluetooth" ]; } - ) + ]) ]; }; } diff --git a/modules/gui/desktop/niri/apps/utilities.nix b/modules/gui/desktop/niri/apps/utilities.nix @@ -6,6 +6,21 @@ }: { user.homeConfig = { + # Portals + xdg.portal.config.niri = { + default = [ + "gnome" + "gtk" + ]; + + "org.freedesktop.impl.portal.FileChooser" = [ "gtk" ]; + "org.freedesktop.impl.portal.Screenshot" = [ "wlr" ]; + "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; + "org.freedesktop.impl.portal.Background" = [ "gnome" ]; + "org.freedesktop.impl.portal.ScreenCast" = [ "gnome" ]; + "org.freedesktop.impl.portal.RemoteDesktop" = [ "gnome" ]; + }; + # Wallpaper stylix.targets.wpaperd.enable = true; services = { diff --git a/modules/gui/desktop/niri/default.nix b/modules/gui/desktop/niri/default.nix @@ -6,19 +6,13 @@ pkgs, ... }@args: -let - inherit (lib) mkIf mkMerge; - inherit (util.map.modules) list; - inherit (config.gui) desktop; -in { ## Niri Configuration ## - config = mkIf (desktop == "niri") ( - mkMerge ( + imports = [ ../shared/_default.nix ]; + config = lib.mkIf (config.gui.desktop == "niri") ( + lib.mkMerge ( # App Configuration - (builtins.map (path: import path (args // { theme = import ../common/theme.nix pkgs; })) ( - list ../common/apps ++ list ./apps - )) + (builtins.map (path: import path args) (util.map.modules.list ./apps)) ++ [ ## Environment Setup { @@ -27,9 +21,9 @@ in enable = true; package = pkgs.niri-stable; }; - } - { + # Settings + shared.enable = true; user.homeConfig = { imports = [ inputs.niri.homeModules.config diff --git a/modules/gui/desktop/niri/settings/apps.nix b/modules/gui/desktop/niri/settings/apps.nix @@ -30,22 +30,81 @@ in { # Applications - "Super+space".action = toggle "rofi" "-show"; - "Super+A".action = spawn "nwg-drawer"; - "Super+F".action = spawn "nemo"; - "Super+T".action = spawn "kitty"; - "Super+W".action = spawn "firefox"; - "Super+Return".action = runOnce "resources" ""; - "XF86Calculator".action = spawn "qalculate-gtk"; + "Alt+Tab" = { + action = spawn "rofi" "-show" "window"; + hotkey-overlay.title = "Window Switcher"; + }; + + "Super+space" = { + action = spawn "rofi" "-show" "drun"; + hotkey-overlay.title = "Launcher"; + }; + + "Super+A" = { + action = spawn "nwg-drawer"; + hotkey-overlay.title = "Application Drawer"; + }; + + "Super+F" = { + action = spawn "nemo"; + hotkey-overlay.title = "Files"; + }; + + "Super+T" = { + action = spawn "kitty"; + hotkey-overlay.title = "Terminal"; + }; + + "Super+W" = { + action = spawn "firefox"; + hotkey-overlay.title = "Browser"; + }; + + "Super+Return" = { + action = runOnce "resources" ""; + hotkey-overlay.title = "Task Manager"; + }; + + "XF86Calculator" = { + action = spawn "qalculate-gtk"; + hotkey-overlay.title = "Calculator"; + }; # Utilities - "Super+N".action = spawn "dunstctl" "history-pop"; - "Super+V".action = spawn "kitty" "--class=clipboard" "-e" "clipse"; - "Super+Shift+C".action = runOnce "hyprpicker" "-arf hex"; - "Super+Shift+B".action = runOnce "overskride" ""; - "Super+Shift+N".action = sh "env XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi"; - "Super+Shift+P".action = spawn "pavucontrol"; - "Super+Escape".action = toggle "wlogout" "-p layer-shell"; + "Super+N" = { + action = spawn "dunstctl" "history-pop"; + hotkey-overlay.title = "Show Notifications"; + }; + + "Super+V" = { + action = spawn "kitty" "--class=clipboard" "-e" "clipse"; + hotkey-overlay.title = "Clipboard"; + }; + + "Super+Shift+C" = { + action = runOnce "hyprpicker" "-arf hex"; + hotkey-overlay.title = "Color Picker"; + }; + + "Super+Shift+B" = { + action = runOnce "overskride" ""; + hotkey-overlay.title = "Bluetooth Settings"; + }; + + "Super+Shift+N" = { + action = sh "env XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi"; + hotkey-overlay.title = "Network Settings"; + }; + + "Super+Shift+P" = { + action = spawn "pavucontrol"; + hotkey-overlay.title = "Audio Settings"; + }; + + "Super+Escape" = { + action = toggle "wlogout" "-p layer-shell"; + hotkey-overlay.title = "Power Menu"; + }; }; ## Window Rules diff --git a/modules/gui/desktop/niri/settings/keybinds.nix b/modules/gui/desktop/niri/settings/keybinds.nix @@ -1,4 +1,12 @@ { config, ... }: +let + inherit (builtins) + concatLists + genList + listToAttrs + toString + ; +in { programs.niri.settings = { input.power-key-handling.enable = false; @@ -33,23 +41,16 @@ "Super+Shift+Down".action = move-window-down-or-to-workspace-down; "Super+Shift+Return".action = move-window-to-monitor-next; - "Super+1".action = focus-workspace 1; - "Super+2".action = focus-workspace 2; - "Super+3".action = focus-workspace 3; - "Super+4".action = focus-workspace 4; - "Super+5".action = focus-workspace 5; - "Super+6".action = focus-workspace 6; - "Super+7".action = focus-workspace 7; - "Super+8".action = focus-workspace 8; - "Super+9".action = focus-workspace 9; - "Super+0".action = focus-workspace 10; - "Print".action = screenshot; - "Shift+Print".action.screenshot-screen = [ ]; # https://github.com/sodiboo/niri-flake/issues/922 + "Shift+Print".action.screenshot-screen = [ ]; "Ctrl+Print".action = screenshot-window; # Controls - "Super+L".action = sh "loginctl lock-session"; + "Super+L" = { + action = sh "loginctl lock-session"; + hotkey-overlay.title = "Lock Screen"; + }; + "XF86AudioPlay".action = sh "sysutils media toggle"; "XF86AudioPrev".action = sh "sysutils media previous"; "XF86AudioNext".action = sh "sysutils media next"; @@ -60,6 +61,40 @@ "XF86MonBrightnessDown".action = sh "sysutils brightness down"; "XF86KbdBrightnessUp".action = sh "sysutils backlight up"; "XF86KbdBrightnessDown".action = sh "sysutils backlight down"; - }; + + # Mouse + "Super+Shift+MouseRight".action = switch-preset-window-width; + "Super+WheelScrollUp" = { + action = focus-workspace-up; + cooldown-ms = 150; + }; + "Super+WheelScrollDown" = { + action = focus-workspace-down; + cooldown-ms = 150; + }; + } + // + # Workspaces + listToAttrs ( + concatLists ( + genList ( + n: + let + num = n + 1; + snum = toString (n + 1); + in + [ + { + name = "Super+${snum}"; + value.action = focus-workspace num; + } + { + name = "Super+Shift+${snum}"; + value.action.move-window-to-workspace = num; + } + ] + ) 9 + ) + ); }; } diff --git a/modules/gui/desktop/shared/_default.nix b/modules/gui/desktop/shared/_default.nix @@ -0,0 +1,5 @@ +{ lib, util, ... }: +{ + options.shared.enable = lib.mkEnableOption "INTERNAL: Enable Shared Configuration"; + imports = util.map.modules.list ./.; +} diff --git a/modules/gui/desktop/shared/browser.nix b/modules/gui/desktop/shared/browser.nix @@ -0,0 +1,30 @@ +{ + config, + lib, + ... +}: +let + inherit (config.shared) enable theme; +in +{ + ## Browser Configuration + config = lib.mkIf enable { + apps.list = [ "firefox" ]; + user.homeConfig = { + home.file.".mozilla/firefox/default/chrome/userChrome.css".text = '' + #TabsToolbar { + -moz-window-dragging: no-drag; + } + ''; + + # Theme + programs.firefox.policies.ExtensionSettings = { + name = with theme; "${name}-${variant}-${accent}"; + value = { + installation_mode = "normal_installed"; + install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/{d49033ac-8969-488c-afb0-5cdb73957f41}/latest.xpi"; + }; + }; + }; + }; +} diff --git a/modules/gui/desktop/shared/files.nix b/modules/gui/desktop/shared/files.nix @@ -0,0 +1,133 @@ +{ + config, + lib, + util, + pkgs, + files, + ... +}: +let + inherit (lib) + hm + getExe + getExe' + mkIf + replaceStrings + ; + + inherit (config.gui) icons; + terminal = "kitty"; + nemo = pkgs.nemo-with-extensions; +in +{ + ## File Manager Configuration + config = mkIf config.shared.enable { + services.dbus.packages = [ nemo ]; + environment.systemPackages = [ + nemo + ] + ++ (with pkgs; [ + cinnamon-desktop + bulky + file-roller + lxqt.pcmanfm-qt + ]); + + user = { + persist.directories = [ + ".config/nemo" + ".local/share/nemo" + ".config/pcmanfm-qt" + ]; + + homeConfig = { + xdg.mimeApps.defaultApplications = util.build.mime { + archive = [ "org.gnome.FileRoller.desktop" ]; + directory = [ "nemo.desktop" ]; + }; + + # Settings + dconf.settings = { + "org/gtk/gtk4/settings/file-chooser".sort-directories-first = true; + "org/nemo/search".search-reverse-sort = false; + "org/nemo/desktop".show-desktop-icons = false; + "org/nemo/plugins".disabled-actions = [ "change-background.nemo_action" ]; + "org/nemo/icon-view".captions = [ + "size" + "type" + "date_modified" + ]; + + "org/nemo/preferences" = { + click-policy = "double"; + date-format = "informal"; + inherit-folder-viewer = true; + quick-renames-with-pause-in-between = true; + show-advanced-permissions = true; + show-new-folder-icon-toolbar = false; + show-show-thumbnails-toolbar = true; + tooltips-in-icon-view = true; + tooltips-in-list-view = false; + tooltips-show-access-date = true; + tooltips-show-birth-date = true; + tooltips-show-file-type = true; + tooltips-show-mod-date = true; + }; + + "org/nemo/preferences/menu-config" = { + background-menu-open-in-terminal = false; + selection-menu-open-in-terminal = false; + }; + }; + + home = { + # Bulk Renamer + activation.nemo-rename = hm.dag.entryAfter [ "writeBoundary" ] '' + if [[ -v DBUS_SESSION_BUS_ADDRESS ]] + then + export DCONF_DBUS_RUN_SESSION="" + else + export DCONF_DBUS_RUN_SESSION="${getExe' pkgs.dbus "dbus-run-session"} --dbus-daemon=${getExe' pkgs.dbus "dbus-daemon"}" + fi + + run $DCONF_DBUS_RUN_SESSION ${getExe pkgs.dconf} write /org/nemo/preferences/bulk-rename-tool "b'bulky'" + unset DCONF_DBUS_RUN_SESSION + ''; + + file = { + # Open in Terminal + ".local/share/nemo/actions/terminal.nemo_action".text = '' + [Nemo Action] + Name=Open in Terminal + Comment=Opens ${terminal} in the selected folder + Exec=${terminal} --working-directory=%F + Icon-Name=${terminal} + Selection=any + Extensions=dir; + EscapeSpaces=true + ''; + + # Desktop Icons + ".config/pcmanfm-qt/default/settings.conf".text = + replaceStrings + [ + "@icon" + "@font" + "@terminal" + "@wallpaper" + "@archiver" + ] + [ + icons.name + config.stylix.fonts.sansSerif.name + terminal + (builtins.toString files.images.transparent) + "file-roller" + ] + files.pcmanfm; + }; + }; + }; + }; + }; +} diff --git a/modules/gui/desktop/shared/login.nix b/modules/gui/desktop/shared/login.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: +let + inherit (lib) mkForce mkIf; + inherit (config.shared) enable theme; +in +{ + ## Login Configuration + config = mkIf enable { + stylix.targets.regreet.enable = true; + environment.persist.directories = [ "/var/lib/regreet" ]; + programs.regreet = { + enable = true; + package = pkgs.greetd.regreet; + settings.commands = { + reboot = [ + "systemctl" + "reboot" + ]; + poweroff = [ + "systemctl" + "poweroff" + ]; + }; + + extraCss = mkForce ""; + theme = mkForce theme.gtk; + iconTheme = mkForce theme.icons; + }; + }; +} diff --git a/modules/gui/desktop/shared/media.nix b/modules/gui/desktop/shared/media.nix @@ -0,0 +1,51 @@ +{ + config, + lib, + util, + pkgs, + ... +}: +{ + ## Media Configuration + config = lib.mkIf config.shared.enable { + environment.systemPackages = with pkgs; [ + celluloid + lollypop + papers + playerctl + shotwell + transmission_4-gtk + ]; + + user = { + # Persisted Files + persist.directories = [ + ".config/mpv" + ".config/shotwell" + ".local/share/lollypop" + ".local/share/shotwell" + ".cache/shotwell" + ]; + + homeConfig = { + # Default Applications + xdg.mimeApps.defaultApplications = util.build.mime { + audio = [ "org.gnome.Lollypop.desktop" ]; + document = [ "org.gnome.Papers.desktop" ]; + image = [ "org.gnome.Shotwell-Viewer.desktop" ]; + magnet = [ "transmission-gtk.desktop" ]; + pdf = [ "org.gnome.Papers.desktop" ]; + video = [ "io.github.celluloid_player.Celluloid.desktop" ]; + }; + + # Media Player + services.playerctld.enable = true; + programs.mpv = { + enable = true; + defaultProfiles = [ "gpu-hq" ]; + scripts = [ pkgs.mpvScripts.mpris ]; + }; + }; + }; + }; +} diff --git a/modules/gui/desktop/shared/misc.nix b/modules/gui/desktop/shared/misc.nix @@ -0,0 +1,87 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +let + inherit (lib) mkIf; + inherit (builtins) concatStringsSep elem map; + inherit (config.shared) enable theme; + inherit (theme) name variant accent; + exists = app: elem app config.apps.list; +in +{ + ## 3rd Party Apps Configuration + config = mkIf enable { + apps = { + # Logseq Notes + logseq.style = "url('https://logseq.${name}.com/ctp-${variant}.css')"; + + # YouTube Music + ytmusic.style = "@import url('https://youtubemusic.${name}.com/src/${variant}.css');"; + }; + + user.homeConfig = { + # Theme + imports = [ inputs.catppuccin.homeModules.catppuccin ]; + catppuccin = { + inherit accent; + flavor = variant; + + thunderbird.enable = true; + vesktop.enable = true; + vscode.enable = true; + }; + + # Code Editor + programs.vscode.profiles.default = mkIf (exists "vscode") { + extensions = [ pkgs.vscode-extensions.catppuccin.catppuccin-vsc-icons ]; + userSettings = { + "workbench.iconTheme" = "${name}-${variant}"; + "terminal.external.linuxExec" = "kitty"; + }; + }; + + # KDE Apps + home.file.".config/kdeglobals".text = + with config.lib.stylix.colors; + '' + [Colors:Selection] + BackgroundNormal=${base0D-rgb-r},${base0D-rgb-g},${base0D-rgb-b} + BackgroundAlternate=${base0D-rgb-r},${base0D-rgb-g},${base0D-rgb-b} + ForegroundNormal=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} + ForegroundActive=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} + ForegroundInactive=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} + ForegroundLink=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} + ForegroundVisited=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} + '' + + (concatStringsSep "\n" ( + map + (name: '' + [Colors:${name}] + BackgroundNormal=${base00-rgb-r},${base00-rgb-g},${base00-rgb-b} + BackgroundAlternate=${base01-rgb-r},${base01-rgb-g},${base01-rgb-b} + DecorationFocus=${base0D-rgb-r},${base0D-rgb-g},${base0D-rgb-b} + DecorationHover=${base0D-rgb-r},${base0D-rgb-g},${base0D-rgb-b} + ForegroundNormal=${base05-rgb-r},${base05-rgb-g},${base05-rgb-b} + ForegroundActive=${base05-rgb-r},${base05-rgb-g},${base05-rgb-b} + ForegroundInactive =${base05-rgb-r},${base05-rgb-g},${base05-rgb-b} + ForegroundLink=${base05-rgb-r},${base05-rgb-g},${base05-rgb-b} + ForegroundVisited=${base05-rgb-r},${base05-rgb-g},${base05-rgb-b} + ForegroundNegative=${base08-rgb-r},${base08-rgb-g},${base08-rgb-b} + ForegroundNeutral=${base0D-rgb-r},${base0D-rgb-g},${base0D-rgb-b} + ForegroundPositive=${base0B-rgb-r},${base0B-rgb-g},${base0B-rgb-b} + '') + [ + "View" + "Window" + "Button" + "Tooltip" + "Complementary" + ] + )); + }; + }; +} diff --git a/modules/gui/desktop/shared/notify.nix b/modules/gui/desktop/shared/notify.nix @@ -0,0 +1,90 @@ +{ + config, + lib, + ... +}: +let + inherit (lib) mkIf mkForce; + inherit (config.shared) enable theme; + inherit (theme) icons; + inherit (config.lib.stylix) colors; +in +{ + ## Notifications Configuration + config = mkIf enable { + # Phone Connect + user.persist.directories = [ ".config/kdeconnect" ]; + programs.kdeconnect.enable = true; + user.homeConfig = { + services.kdeconnect = { + enable = true; + indicator = true; + }; + + # Notifications Daemon + stylix.targets.dunst.enable = true; + services.dunst = + let + system = { + fullscreen = "show"; + highlight = "#${colors.base07}"; + history_ignore = "yes"; + override_pause_level = 70; + }; + in + { + enable = true; + iconTheme = icons; + settings = { + global = { + alignment = "center"; + corner_radius = 10; + follow = "mouse"; + format = "<b>%s</b>\\n%b"; + frame_width = 1; + horizontal_padding = 8; + icon_corner_radius = 10; + icon_position = "left"; + icon_theme = icons.name; + indicate_hidden = "yes"; + markup = "yes"; + max_icon_size = 64; + mouse_left_click = "do_action"; + mouse_middle_click = "close_all"; + mouse_right_click = "close_current"; + offset = "10x5"; + padding = 8; + progress_bar_corner_radius = 10; + separator_height = 1; + show_indicators = false; + shrink = "no"; + transparency = 10; + word_wrap = "yes"; + }; + + urgency_low.frame_color = mkForce "#${colors.base0E}"; + urgency_normal.frame_color = mkForce "#${colors.base0D}"; + fullscreen_delay.fullscreen = "delay"; + utility = { + appname = "utility"; + } + // system; + upower = { + appname = "poweralertd"; + new_icon = "/run/current-system/sw/share/icons/${icons.name}/24x24/apps/preferences-system-power.svg"; + } + // system; + + hyprland = { + appname = "grimblast"; + } + // system; + niri = { + appname = "niri"; + } + // system; + }; + }; + }; + }; +} diff --git a/modules/gui/desktop/shared/panel.nix b/modules/gui/desktop/shared/panel.nix @@ -0,0 +1,315 @@ +{ + config, + lib, + pkgs, + ... +}: +let + inherit (lib) + mkDefault + mkIf + mkOption + types + ; +in +{ + options.shared.panel = mkOption { + description = "INTERNAL: Shared Panel Configuration"; + type = types.attrs; + }; + + ## Panel Configuration + config = mkIf config.shared.enable { + user.homeConfig = { + stylix.targets.waybar = { + enable = true; + font = "sansSerif"; + addCss = false; + }; + + home.packages = [ pkgs.wttrbar ]; + programs.waybar = { + enable = true; + systemd.enable = true; + package = pkgs.unstable.waybar; + }; + }; + + shared.panel = { + layer = "top"; + + "custom/logo" = { + format = ""; + tooltip = false; + on-click = "nwg-drawer"; + }; + + user = { + format = "{user}"; + icon = true; + height = 30; + width = 30; + open-on-click = true; + }; + + "custom/user" = { + exec = "sh -c 'getent passwd $USER | cut -d : -f 5'"; + format = "{}"; + rotate = 270; + tooltip = false; + on-click = "sh -c 'nemo ~'"; + }; + + "custom/power" = { + format = "⏻"; + tooltip = false; + on-click = "wlogout -p layer-shell"; + }; + + "group/menu" = { + modules = [ + "custom/hide" + "keyboard-state" + "tray" + ]; + drawer.click-to-reveal = true; + }; + + "custom/hide" = { + format = mkDefault ""; + tooltip = false; + }; + + keyboard-state = { + numlock = true; + capslock = true; + format = { + numlock = mkDefault " N {icon}"; + capslock = mkDefault " {icon}"; + }; + format-icons = { + locked = ""; + unlocked = ""; + }; + }; + + bluetooth = { + format = ""; + format-disabled = ""; + format-connected = " {num_connections}"; + tooltip-format = " {status}"; + tooltip-format-connected = "{device_enumerate}"; + tooltip-format-enumerate-connected = " {device_alias} {device_battery_percentage}%"; + on-click = "overskride"; + }; + + network = + let + tooltip = "Strength: <b>{signaldBm}dBm ({signalStrength}%)</b>\nFrequency: <b>{frequency}MHz</b>\nInterface: <b>{ifname}</b>\nIP: <b>{ipaddr}/{cidr}</b>\nGateway: <b>{gwaddr}</b>\nNetmask: <b>{netmask}</b>"; + in + { + format = "{ifname}"; + format-disconnected = ""; + format-wifi = "{icon}"; + format-ethernet = ""; + format-icons = [ + "" + "" + "" + "" + "" + ]; + format-linked = " {ifname}"; + tooltip-format-wifi = "Network: <big><b>{essid}</b></big>\n${tooltip}"; + tooltip-format-ethernet = "Network: <big><b>Wired</b></big>\n${tooltip}"; + tooltip-format-disconnected = " Disconnected"; + on-click = "sh -c 'env XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi'"; + }; + + "group/media" = { + modules = [ + "wireplumber" + "mpris" + ]; + drawer.transition-duration = 1000; + }; + + wireplumber = { + max-volume = 150; + scroll-step = 1; + reverse-scrolling = 1; + format = "{icon}"; + tooltip-format = "Volume: {volume}%\nDevice: {node_name}"; + format-icons = [ + "" + "" + "" + ]; + format-muted = ""; + on-click = "pavucontrol"; + }; + + mpris = { + dynamic-len = 20; + dynamic-order = [ + "title" + "artist" + "length" + ]; + dynamic-separator = " - "; + format = mkDefault " {player}"; + format-paused = " <i>{player}</i>"; + format-stopped = ""; + tooltip-format-stopped = "Not Playing"; + on-click = "sysutils media toggle"; + on-click-right = "sysutils media next"; + on-click-middle = "sysutils media previous"; + }; + + backlight = { + format = "{icon}"; + tooltip-format = "Backlight: {percent}%"; + format-icons = [ + "" + "" + "" + "" + "" + "" + "" + "" + "" + ]; + on-scroll-up = "sysutils brightness down"; + on-scroll-down = "sysutils brightness up"; + }; + + "group/power".modules = [ + "battery" + "power-profiles-daemon" + ]; + + battery = { + interval = 5; + rotate = 0; + format = "{icon}"; + tooltip-format = "Battery: {capacity}%"; + format-charging = ""; + format-icons = [ + "" + "" + "" + "" + "" + ]; + states = { + good = 80; + warning = 20; + critical = 10; + }; + }; + + power-profiles-daemon = { + format = "{icon}"; + tooltip = true; + tooltip-format = "Power Profile: {profile}"; + format-icons = { + default = ""; + performance = ""; + balanced = ""; + power-saver = ""; + }; + }; + + "custom/weather" = { + format = mkDefault "{}°"; + return-type = "json"; + exec = mkDefault "wttrbar --date-format %d/%m --nerd"; + tooltip = true; + interval = 600; + signal = 7; + on-click = "pkill -RTMIN+7 waybar"; + }; + + clock = { + interval = 1; + format = mkDefault " {:%H:%M:%S} "; + format-alt = mkDefault " {:%I:%M %A, %d %B %Y} "; + tooltip-format = "<tt><small>{calendar}</small></tt>"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "left"; + on-scroll = 1; + format = with config.lib.stylix.colors; { + months = "<span color='#${base06}'><b>{}</b></span>"; + days = "<span color='#${base05}'><b>{}</b></span>"; + weeks = "<span color='#${base0C}'><b>W{}</b></span>"; + weekdays = "<span color='#${base0A}'><b>{}</b></span>"; + today = "<span color='#${base08}'><b><u>{}</u></b></span>"; + }; + }; + + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_down"; + on-scroll-down = "shift_up"; + }; + }; + + "group/notify".modules = [ + "custom/dunst" + "idle_inhibitor" + ]; + + "custom/dunst" = + let + run = + text: + "${ + pkgs.writeShellApplication { + name = "notify"; + inherit text; + runtimeInputs = with pkgs; [ + coreutils + dunst + ]; + } + }/bin/notify"; + in + { + tooltip = false; + on-click = "dunstctl history-pop"; + restart-interval = 1; + on-click-right = run '' + if dunstctl is-paused | grep -q "false" + then + dunstctl set-pause-level 50 + else + dunstctl set-pause-level 0 + fi + ''; + exec = run '' + COUNT=$(dunstctl count waiting) + ENABLED="" + DISABLED="" + if [ "$COUNT" != 0 ]; then DISABLED=" $COUNT"; fi + if dunstctl is-paused | grep -q "false"; then echo "$ENABLED"; else echo "$DISABLED"; fi + ''; + }; + + idle_inhibitor = { + format = "{icon}"; + on-click = "sysutils toggle service swayidle"; + tooltip-format-activated = "Idle Inhibitor: On"; + tooltip-format-deactivated = "Idle Inhibitor: Off"; + format-icons = { + activated = ""; + deactivated = ""; + }; + }; + }; + }; +} diff --git a/modules/gui/desktop/shared/security.nix b/modules/gui/desktop/shared/security.nix @@ -0,0 +1,112 @@ +{ + config, + lib, + util, + pkgs, + files, + ... +}: +let + inherit (lib) getExe getExe' mkIf; + locker = pkgs.swaylock-effects; +in +{ + ## Security Configuration + config = mkIf config.shared.enable { + # User Authentication + security = { + soteria.enable = true; + pam.services.swaylock.text = "auth include login"; + }; + + user.homeConfig = { + # Locker + stylix.targets.swaylock = { + enable = true; + useImage = true; + }; + + programs.swaylock = { + enable = true; + package = locker; + settings = { + clock = true; + indicator = true; + font = config.stylix.fonts.sansSerif.name; + effect-vignette = "0.3:1"; + }; + }; + + # Idle Daemon + services.swayidle = + let + pause = "${getExe pkgs.playerctl} pause -a;"; + lock = + pre: flag: + "sh -c 'if ! ${getExe' pkgs.procps "pgrep"} -x swaylock; then ${pre} ${getExe locker} -f ${flag}; fi'"; + in + { + enable = true; + extraArgs = [ "-w" ]; + events = [ + { + event = "before-sleep"; + command = lock pause ""; + } + { + event = "lock"; + command = lock pause "--fade-in 0.2 --grace 15 --grace-no-mouse"; + } + ]; + }; + + # Logout + programs.wlogout = { + enable = true; + style = util.build.theme { + inherit (config.lib.stylix) colors; + file = files.wlogout; + }; + + layout = [ + { + label = "lock"; + action = "loginctl lock-session"; + text = ""; + keybind = "l"; + } + { + label = "logout"; + action = "loginctl terminate-user $USER"; + text = "↶"; + keybind = "e"; + } + { + label = "shutdown"; + action = "systemctl poweroff"; + text = "⏻"; + keybind = "s"; + } + { + label = "reboot"; + action = "systemctl reboot"; + text = "↺"; + keybind = "r"; + } + { + label = "suspend"; + action = "systemctl suspend"; + text = ""; + keybind = "u"; + } + { + label = "hibernate"; + action = "systemctl hibernate"; + text = ""; + keybind = "h"; + } + ]; + }; + }; + }; +} diff --git a/modules/gui/desktop/shared/style.nix b/modules/gui/desktop/shared/style.nix @@ -0,0 +1,38 @@ +{ + config, + lib, + pkgs, + files, + ... +}: +let + inherit (config.shared) enable theme; + inherit (theme) icons gtk qt; +in +{ + ## Desktop Integration + config = lib.mkIf enable { + stylix.base16Scheme = files.colors.catppuccin; + environment.systemPackages = [ pkgs.custom.cursors ]; + gui = { + inherit icons; + + gtk = { + enable = true; + theme = gtk; + }; + + qt = { + enable = true; + theme = qt; + style = "kvantum"; + }; + }; + + # GTK Apps + user.homeConfig.dconf.settings."org/gnome/desktop/wm/preferences" = { + action-double-click-titlebar = "none"; + button-layout = "appmenu"; + }; + }; +} diff --git a/modules/gui/desktop/shared/terminal.nix b/modules/gui/desktop/shared/terminal.nix @@ -0,0 +1,47 @@ +{ + config, + lib, + pkgs, + ... +}: +let + inherit (config.shared) enable theme; +in +{ + ## Terminal Configuration + config = lib.mkIf enable { + user.homeConfig = { + programs.kitty = { + enable = true; + themeFile = with theme; "${name-alt}-${variant-alt}"; + keybindings = { + "ctrl+c" = "copy_or_interrupt"; + "kitty_mod+f" = + "launch --allow-remote-control kitty +kitten search/search.py @active-kitty-window-id"; + }; + + settings = { + kitty_mod = "ctrl+shift"; + confirm_os_window_close = 2; + copy_on_select = "clipboard"; + placement_strategy = "center"; + scrollback_lines = 10000; + enable_audio_bell = "no"; + visual_bell_duration = "0.1"; + + cursor_shape = "beam"; + cursor_shape_unfocused = "underline"; + tab_bar_style = "powerline"; + tab_powerline_style = "round"; + window_padding_width = 10; + }; + }; + + home.file.".config/kitty/search".source = pkgs.custom.kitty-search; + stylix.targets.kitty = { + enable = true; + variant256Colors = true; + }; + }; + }; +} diff --git a/modules/gui/desktop/shared/text.nix b/modules/gui/desktop/shared/text.nix @@ -0,0 +1,63 @@ +{ + config, + lib, + util, + pkgs, + files, + ... +}: +let + inherit (config.shared) enable theme; +in +{ + ## Text Configuration + config = lib.mkIf enable { + environment.systemPackages = [ pkgs.geany ]; + user = { + persist.directories = [ + ".config/clipse" + ".config/geany" + ]; + + homeConfig = { + # Text Editor + xdg.mimeApps.defaultApplications = util.build.mime { + markdown = [ "geany.desktop" ]; + text = [ "geany.desktop" ]; + }; + + home.file = with files.geany; { + ".config/geany/geany.conf".text = settings; + ".config/geany/keybindings.conf".text = keybindings; + ".config/geany/colorschemes/theme.conf".source = + with theme; + "${pkgs.custom.geany-catppuccin}/share/geany/colorschemes/${name}-${variant}.conf"; + }; + + # Clipboard Manager + services.clipse = { + enable = true; + allowDuplicates = false; + historySize = 150; + imageDisplay.type = "kitty"; + theme = with config.lib.stylix.colors; { + useCustomTheme = true; + DimmedDesc = "#${base07}"; + DimmedTitle = "#${base07}"; + FilteredMatch = "#${base08}"; + NormalTitle = "#${base08}"; + NormalDesc = "#${base0B}"; + SelectedDesc = "#${base0D}"; + SelectedTitle = "#${base0D}"; + SelectedBorder = "#${base0D}"; + SelectedDescBorder = "#${base0D}"; + TitleFore = "#${base05}"; + Titleback = "#${base01}"; + StatusMsg = "#${base0E}"; + PinIndicatorColor = "#${base0F}"; + }; + }; + }; + }; + }; +} diff --git a/modules/gui/desktop/shared/theme.nix b/modules/gui/desktop/shared/theme.nix @@ -0,0 +1,40 @@ +{ lib, pkgs, ... }: +{ + options.shared.theme = lib.mkOption { + description = "INTERNAL: Shared Theme Configuration"; + type = lib.types.attrs; + }; + + ## Theming + config.shared.theme = rec { + name = "catppuccin"; + name-alt = "Catppuccin"; + + accent = "blue"; + variant = "macchiato"; + variant-alt = "Macchiato"; + + gtk = { + name = "${name}-${variant}-${accent}-standard"; + package = pkgs.catppuccin-gtk.override { + accents = [ accent ]; + inherit variant; + }; + }; + + qt = { + name = "${name}-${variant}-${accent}"; + package = pkgs.catppuccin-kvantum.override { + inherit accent variant; + }; + }; + + icons = { + name = "Papirus-Dark"; + package = pkgs.catppuccin-papirus-folders.override { + inherit accent; + flavor = variant; + }; + }; + }; +} diff --git a/modules/gui/desktop/shared/utilities.nix b/modules/gui/desktop/shared/utilities.nix @@ -0,0 +1,96 @@ +{ + config, + lib, + pkgs, + ... +}: +let + inherit (lib) getExe mkIf; + inherit (config.lib.stylix) colors; +in +{ + config = mkIf config.shared.enable { + environment.systemPackages = with pkgs; [ + # Apps + clipse + font-manager + gnome-clocks + gnome-disk-utility + hyprpicker + nwg-drawer + overskride + qalculate-gtk + remmina + resources + smile + + # Utilities + custom.sysutils + pavucontrol + wev + wlclock + wl-clipboard + wl-screenrec + wlr-randr + + # Network Settings + (gnome-control-center.overrideAttrs (old: { + postInstall = old.postInstall + '' + dir=$out/share/applications + for panel in $dir/* + do + [ "$panel" = "$dir/gnome-network-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-wifi-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-wwan-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-sharing-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-wacom-panel.desktop" ] && continue + rm "$panel" + done + ''; + })) + ]; + + ## Essential Utilities + # Power + services = { + power-profiles-daemon.enable = true; + upower.enable = true; + }; + + # Backlight + hardware.brillo.enable = true; + user.groups = [ + "input" + "video" + ]; + + user = { + homeConfig = { + systemd.user.services.wlclock = + let + target = [ "graphical-session.target" ]; + in + { + Install.WantedBy = target; + Unit = { + Description = "Desktop Clock"; + After = target; + }; + Service.ExecStart = + with colors; + "${getExe pkgs.wlclock} --layer bottom --exclusive-zone true --position top-right --margin 10 --size 300 --corner-radius 10 --border-size 2 --hand-width 7 --marking-width 3 --background-colour #${base00}4d --clock-colour #${base0D} --border-colour #${base00}"; + }; + + # Network Settings + xdg.desktopEntries."org.gnome.Settings" = { + name = "Network Settings"; + comment = "Gnome Control Center"; + icon = "org.gnome.Settings"; + exec = "env XDG_CURRENT_DESKTOP=gnome gnome-control-center"; + categories = [ "X-Preferences" ]; + terminal = false; + }; + }; + }; + }; +} diff --git a/modules/hardware/filesystem.nix b/modules/hardware/filesystem.nix @@ -26,6 +26,7 @@ let inherit (config.hardware.fs) scheme; in { + ## File System Configuration ## imports = [ inputs.impermanence.nixosModule ] @@ -61,7 +62,6 @@ in }; }; - ## File System Configuration ## config = mkMerge [ { warnings = optional (scheme == null) (options.hardware.fs.scheme.description + " is unset");