aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'modules/desktop')
-rw-r--r--modules/desktop/default.nix1
-rw-r--r--modules/desktop/popup-manager/default.nix4
-rw-r--r--modules/desktop/popup-manager/rofi/default.nix4
-rw-r--r--modules/desktop/status-bar/polybar/bar/main.nix6
-rw-r--r--modules/desktop/status-bar/polybar/default.nix12
-rw-r--r--modules/desktop/terminal/alacritty/default.nix10
-rw-r--r--modules/desktop/terminal/default.nix1
-rw-r--r--modules/desktop/terminal/kitty/default.nix48
-rw-r--r--modules/desktop/window-manager/sxhkd/default.nix4
-rw-r--r--modules/desktop/xdg-portal/default.nix24
10 files changed, 96 insertions, 18 deletions
diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix
index b4ff4c5..bae73fc 100644
--- a/modules/desktop/default.nix
+++ b/modules/desktop/default.nix
@@ -7,5 +7,6 @@
./status-bar
./terminal
./window-manager
+ ./xdg-portal
];
}
diff --git a/modules/desktop/popup-manager/default.nix b/modules/desktop/popup-manager/default.nix
index edf3dfa..c34d29d 100644
--- a/modules/desktop/popup-manager/default.nix
+++ b/modules/desktop/popup-manager/default.nix
@@ -6,9 +6,9 @@
];
options.desktop.popup-manager = {
- application-launcher.default = lib.mkOption {
+ application-launcher.command = lib.mkOption {
type = lib.types.str;
- description = "Path to the default application launcher program.";
+ description = "Command for default application launcher program.";
};
};
}
diff --git a/modules/desktop/popup-manager/rofi/default.nix b/modules/desktop/popup-manager/rofi/default.nix
index be22bcd..1ddc208 100644
--- a/modules/desktop/popup-manager/rofi/default.nix
+++ b/modules/desktop/popup-manager/rofi/default.nix
@@ -6,9 +6,9 @@
};
config = lib.mkIf config.desktop.popup-manager.rofi.enable {
- desktop.popup-manager.application-launcher.default = "${pkgs.rofi}/bin/rofi -show run";
+ desktop.popup-manager.application-launcher.command = "${pkgs.rofi}/bin/rofi -show run";
programs.rofi.enable = true;
- programs.rofi.font = "FiraCode Nerd Font 16";
+ programs.rofi.font = "${config.fonts.normal} ${toString config.fonts.size}";
programs.rofi.theme = config.scheme {
template = builtins.readFile ./theme.mustache.rasi;
};
diff --git a/modules/desktop/status-bar/polybar/bar/main.nix b/modules/desktop/status-bar/polybar/bar/main.nix
index 34858d8..d1f05b2 100644
--- a/modules/desktop/status-bar/polybar/bar/main.nix
+++ b/modules/desktop/status-bar/polybar/bar/main.nix
@@ -10,7 +10,7 @@ with config.scheme.withHashtag;
border-bottom-size = 1;
border-left-size = 1;
border-right-size = 1;
- border-color = base02;
+ border-color = base03;
background = base00;
foreground = base05;
@@ -21,13 +21,15 @@ with config.scheme.withHashtag;
padding-left = 1;
padding-right = 1;
+ separator = "%{F${base03}}│%{F-}";
+
module-margin-left = 2;
module-margin-right = 2;
offset-x = "\${env:POLYBAR_OFFSET}";
offset-y = "\${env:POLYBAR_OFFSET}";
- font-0 = "FiraCode Nerd Font:pixelsize=16;3";
+ font-0 = "${config.fonts.normal}:pixelsize=${toString config.fonts.size};3";
modules-left =
if config.desktop.window-manager.bspwm.enable then
diff --git a/modules/desktop/status-bar/polybar/default.nix b/modules/desktop/status-bar/polybar/default.nix
index b8e1907..fb72e5f 100644
--- a/modules/desktop/status-bar/polybar/default.nix
+++ b/modules/desktop/status-bar/polybar/default.nix
@@ -1,4 +1,4 @@
-{ config, lib, ... }:
+{ config, lib, pkgs, ... }:
{
options.desktop.status-bar.polybar = {
@@ -7,11 +7,13 @@
type = lib.types.str;
description = "Command to run polybar.";
# This command calculates the width of the polybar to create those gaps
- default = ''
-MONITOR_WIDTH=$(xrandr | grep '*' | awk '{print $1}' | cut -d'x' -f1 | head -n1); \
-OFFSET=${toString config.desktop.window-manager.gap}; \
+ default = toString (pkgs.writeShellScript "polybar-run.sh" ''
+#!/bin/sh
+
+MONITOR_WIDTH=$(xrandr | grep '*' | awk '{print $1}' | cut -d'x' -f1 | head -n1)
+OFFSET=${toString config.desktop.window-manager.gap}
POLYBAR_WIDTH=$((MONITOR_WIDTH - 2 * OFFSET)) POLYBAR_OFFSET=$OFFSET polybar main &
-'';
+'');
};
};
diff --git a/modules/desktop/terminal/alacritty/default.nix b/modules/desktop/terminal/alacritty/default.nix
index a1f521a..575fe4e 100644
--- a/modules/desktop/terminal/alacritty/default.nix
+++ b/modules/desktop/terminal/alacritty/default.nix
@@ -7,7 +7,7 @@
config = lib.mkIf config.desktop.terminal.alacritty.enable {
programs.alacritty.enable = true;
- desktop.terminal.default = "${pkgs.alacritty}/bin/alacritty";
+ desktop.terminal.default = lib.mkDefault "${pkgs.alacritty}/bin/alacritty";
programs.alacritty.settings = {
window = {
@@ -21,17 +21,17 @@
font = {
normal = {
- family = "Fira Code Nerd Font";
+ family = config.fonts.normal;
style = "Retina";
};
bold = {
- family = "Fira Code Nerd Font";
+ family = config.fonts.bold;
style = "Bold";
};
italic = {
- family = "Fira Code Nerd Font";
+ family = config.fonts.italic;
};
- size = 16.0;
+ size = config.fonts.size;
};
colors = with config.scheme; {
diff --git a/modules/desktop/terminal/default.nix b/modules/desktop/terminal/default.nix
index 60b1e59..ac84471 100644
--- a/modules/desktop/terminal/default.nix
+++ b/modules/desktop/terminal/default.nix
@@ -3,6 +3,7 @@
{
imports = [
./alacritty
+ ./kitty
];
options.desktop.terminal = {
diff --git a/modules/desktop/terminal/kitty/default.nix b/modules/desktop/terminal/kitty/default.nix
new file mode 100644
index 0000000..943a730
--- /dev/null
+++ b/modules/desktop/terminal/kitty/default.nix
@@ -0,0 +1,48 @@
+{ pkgs, config, lib, ... }:
+
+{
+ options.desktop.terminal.kitty = {
+ enable = lib.mkEnableOption "Enables kitty.";
+ };
+
+ config = lib.mkIf config.desktop.terminal.kitty.enable {
+ assertions = [
+ {
+ assertion = config.desktop.xdg-portal.enable;
+ message ="Module desktop.terminal.kitty requires desktop.xdg-portal module to be enabled.";
+ }
+ ];
+ programs.kitty.enable = true;
+ desktop.terminal.default = lib.mkDefault "${pkgs.kitty}/bin/kitty";
+
+ programs.kitty.settings = with config.scheme.withHashtag; {
+ window_padding_width = config.desktop.window-manager.gap;
+ font_size = config.fonts.size;
+ font_family = config.fonts.normal;
+ filter_notification = "all";
+ update_check_interval = 0;
+ scrollback_indicator_opacity = "0.5";
+
+ dynamic_background_opacity = false;
+ allow_remote_control = false;
+ enable_audio_bell = false;
+
+ background = base00;
+ foreground = base05;
+
+ color0 = base00; # Black
+ color1 = base08; # Red
+ color2 = base0B; # Green
+ color3 = base0A; # Yellow
+ color4 = base0D; # Blue
+ color5 = base0E; # Magenta
+ color6 = base0C; # Cyan
+ color7 = base05; # White
+
+ selection_background = base03;
+ selection_foreground = base00;
+
+ shell = config.shell.default;
+ };
+ };
+}
diff --git a/modules/desktop/window-manager/sxhkd/default.nix b/modules/desktop/window-manager/sxhkd/default.nix
index decad25..04fb0cc 100644
--- a/modules/desktop/window-manager/sxhkd/default.nix
+++ b/modules/desktop/window-manager/sxhkd/default.nix
@@ -29,7 +29,7 @@
${(createKeybinding
"r"
"Application launcher.")}
- = config.desktop.popup-manager.application-launcher.default;
+ = config.desktop.popup-manager.application-launcher.command;
${(createKeybinding
"t"
@@ -39,7 +39,7 @@
${(createKeybinding
"f"
"Launch File Manager.")}
- = "${config.desktop.terminal.default} -t 'File Manager' --class popup -e ${config.tools.file-manager.default}";
+ = "${config.desktop.terminal.default} --title 'File Manager' --class popup -e ${config.tools.file-manager.default}";
}
];
};
diff --git a/modules/desktop/xdg-portal/default.nix b/modules/desktop/xdg-portal/default.nix
new file mode 100644
index 0000000..a3681ef
--- /dev/null
+++ b/modules/desktop/xdg-portal/default.nix
@@ -0,0 +1,24 @@
+{ pkgs, config, lib, ... }:
+
+{
+ options.desktop.xdg-portal = {
+ enable = lib.mkEnableOption "Enables xdg desktop portal.";
+ };
+
+ config = lib.mkIf config.desktop.xdg-portal.enable {
+ xdg.portal.enable = true;
+ xdg.portal.xdgOpenUsePortal = true;
+
+ xdg.portal.config = {
+ common = {
+ default = [
+ "gtk"
+ ];
+ };
+ };
+
+ xdg.portal.extraPortals = [
+ pkgs.xdg-desktop-portal-gtk
+ ];
+ };
+}