summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
Diffstat (limited to 'users')
-rw-r--r--users/kassouni/desktop/sway/default.nix (renamed from users/kassouni/wayland/default.nix)0
-rw-r--r--users/kassouni/desktop/sway/fuzzel.nix37
-rw-r--r--users/kassouni/desktop/sway/sway.nix (renamed from users/kassouni/wayland/sway.nix)17
-rw-r--r--users/kassouni/desktop/sway/waybar.nix (renamed from users/kassouni/wayland/waybar.nix)32
-rw-r--r--users/kassouni/desktop/xmonad/default.nix7
-rw-r--r--users/kassouni/desktop/xmonad/rofi.nix (renamed from users/kassouni/rofi.nix)0
-rw-r--r--users/kassouni/desktop/xmonad/xbindkeys.nix (renamed from users/kassouni/xbindkeys.nix)0
-rw-r--r--users/kassouni/desktop/xmonad/xmonad.nix9
-rw-r--r--users/kassouni/ghostty.nix4
-rw-r--r--users/kassouni/home.nix15
-rw-r--r--users/kassouni/neovim.nix20
-rw-r--r--users/kassouni/palette/default.nix26
-rw-r--r--users/kassouni/palette/fuzzel-palette.nix27
-rw-r--r--users/kassouni/palette/rofi-palette.nix24
-rw-r--r--users/kassouni/theme.nix19
-rw-r--r--users/kassouni/wayland/fuzzel.nix23
16 files changed, 189 insertions, 71 deletions
diff --git a/users/kassouni/wayland/default.nix b/users/kassouni/desktop/sway/default.nix
index 947924a..947924a 100644
--- a/users/kassouni/wayland/default.nix
+++ b/users/kassouni/desktop/sway/default.nix
diff --git a/users/kassouni/desktop/sway/fuzzel.nix b/users/kassouni/desktop/sway/fuzzel.nix
new file mode 100644
index 0000000..d6d294b
--- /dev/null
+++ b/users/kassouni/desktop/sway/fuzzel.nix
@@ -0,0 +1,37 @@
+{
+ pkgs,
+ lib,
+ config,
+ ...
+}:
+let
+ inherit (config.colorScheme) ui editor common;
+
+ # fuzzel wants RRGGBBAA with no leading '#'.
+ rgba = c: lib.toLower (lib.removePrefix "#" c) + "ff";
+in
+{
+ programs.fuzzel = {
+ enable = true;
+ settings = {
+ main = {
+ font = lib.mkForce "${config.theme.font.family}:size=${toString config.theme.font.size}";
+ };
+
+ colors = {
+ background = rgba ui.bg;
+ text = rgba editor.fg;
+ match = rgba common.accent.tint;
+ selection = rgba ui.panel.bg;
+ selection-text = rgba editor.fg;
+ selection-match = rgba common.accent.tint;
+ border = rgba ui.line;
+ };
+
+ border = {
+ radius = 0;
+ };
+ };
+ };
+
+}
diff --git a/users/kassouni/wayland/sway.nix b/users/kassouni/desktop/sway/sway.nix
index 0cf97f7..2e73d5f 100644
--- a/users/kassouni/wayland/sway.nix
+++ b/users/kassouni/desktop/sway/sway.nix
@@ -12,16 +12,19 @@
config = {
window.titlebar = false;
menu = "fuzzel";
- gaps = {
- };
modifier = "Mod4";
# Use kitty as default terminal
- terminal = "foot";
+ terminal = "ghostty";
};
- extraConfig = let incr = "5"; in ''
- output * scale 2
- bindsym XF86MonBrightnessDown exec brightnessctl set -e 5%-
- bindsym XF86MonBrightnessUp exec brightnessctl set -e +5%
+ extraConfig = let
+ incr = "5";
+ brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
+ in ''
+ # home-manager inlines these values instead of emitting `set` lines
+ output * scale 1.75
+ output * bg ${config.theme.desktop.wallpaper} fill
+ bindsym XF86MonBrightnessDown exec ${brightnessctl} set -e ${incr}%-
+ bindsym XF86MonBrightnessUp exec ${brightnessctl} set -e +${incr}%
bindsym XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_SINK@ ${incr}%+
bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_SINK@ ${incr}%-
input "type:keyboard" {
diff --git a/users/kassouni/wayland/waybar.nix b/users/kassouni/desktop/sway/waybar.nix
index 3026c2f..7cb37a0 100644
--- a/users/kassouni/wayland/waybar.nix
+++ b/users/kassouni/desktop/sway/waybar.nix
@@ -1,4 +1,7 @@
{ pkgs, inputs, config, ... }:
+let
+ inherit (config.colorScheme) ui editor common;
+in
{
programs.waybar = {
enable = true;
@@ -82,27 +85,50 @@
};
};
style = ''
+ * {
+ /* waybar's css font-size is px, but theme.font.size is points like
+ ghostty and fuzzel take. 1pt = 4/3px. */
+ font-family: ${config.theme.font.family};
+ font-size: ${builtins.toString (config.theme.font.size * 4 / 3)}px;
+ }
+
+ window#waybar {
+ background: ${ui.bg};
+ color: ${editor.fg};
+ }
+
.module {
padding: 0px 15px 0px;
}
-
+
#workspaces button {
- font-family: ${config.theme.font.family};
- font-size: ${builtins.toString config.theme.font.size}px;
font-weight: normal;
+ color: ${ui.fg};
+ background: none;
+ border: none;
}
#workspaces button.focused {
+ color: ${common.accent.tint};
+ }
+
+ #workspaces button.urgent {
+ color: ${common.error};
}
#workspaces button:hover {
font-weight: bold;
+ color: ${editor.fg};
box-shadow: none;
text-shadow: inherit;
background: none;
transition: none;
}
+ /* matches the `states.low = 20` threshold on the battery module */
+ #battery.low {
+ color: ${common.error};
+ }
'';
};
diff --git a/users/kassouni/desktop/xmonad/default.nix b/users/kassouni/desktop/xmonad/default.nix
new file mode 100644
index 0000000..d62dbe4
--- /dev/null
+++ b/users/kassouni/desktop/xmonad/default.nix
@@ -0,0 +1,7 @@
+{...}: {
+ imports = [
+ ./xmonad.nix
+ ./rofi.nix
+ ./xbindkeys.nix
+ ];
+}
diff --git a/users/kassouni/rofi.nix b/users/kassouni/desktop/xmonad/rofi.nix
index 740047b..740047b 100644
--- a/users/kassouni/rofi.nix
+++ b/users/kassouni/desktop/xmonad/rofi.nix
diff --git a/users/kassouni/xbindkeys.nix b/users/kassouni/desktop/xmonad/xbindkeys.nix
index 41ef7ed..41ef7ed 100644
--- a/users/kassouni/xbindkeys.nix
+++ b/users/kassouni/desktop/xmonad/xbindkeys.nix
diff --git a/users/kassouni/desktop/xmonad/xmonad.nix b/users/kassouni/desktop/xmonad/xmonad.nix
new file mode 100644
index 0000000..d49dcc1
--- /dev/null
+++ b/users/kassouni/desktop/xmonad/xmonad.nix
@@ -0,0 +1,9 @@
+{pkgs, config, ...}: {
+ xmonad-config = {
+ launcher = "rofi -show drun -show-icons";
+ terminal = "ghostty";
+ wallpaper = config.theme.desktop.wallpaper;
+ xmobar.font = config.theme.font;
+ };
+}
+
diff --git a/users/kassouni/ghostty.nix b/users/kassouni/ghostty.nix
index 8c4aefd..cbfaee1 100644
--- a/users/kassouni/ghostty.nix
+++ b/users/kassouni/ghostty.nix
@@ -3,9 +3,9 @@
programs.ghostty = {
enable = true;
settings = {
- theme = "Ayu Light";
+ theme = "Ayu";
font-family = config.theme.font.family;
- font-size = 24;
+ font-size = config.theme.font.size;
window-decoration = "none";
};
};
diff --git a/users/kassouni/home.nix b/users/kassouni/home.nix
index 9268980..84b69f1 100644
--- a/users/kassouni/home.nix
+++ b/users/kassouni/home.nix
@@ -8,11 +8,12 @@
imports = [
./neovim.nix
./claude.nix
- ./rofi.nix
./music.nix
./fonts.nix
./slippi.nix
./ssh.nix
+ ./desktop/sway
+ ./desktop/xmonad
./rip.nix
./ayu/ayu-dark.nix
./git.nix
@@ -21,23 +22,11 @@
./firefox.nix
./cursor.nix
./bash.nix
- ./xbindkeys.nix
./scripts
./palette
];
home.username = "kassouni";
-
- xmonad-config = {
- launcher = "rofi -show drun -show-icons";
- terminal = "ghostty";
- wallpaper = pkgs.fetchurl {
- url = "https://i.redd.it/p5flk9uzzxxz.jpg";
- sha256 = "1qcl6yh6l24sz3qprj3iyzinj3lyh3c426i6zwambwg816yg3bxs";
- };
- xmobar.font = config.theme.font;
- };
-
home.sessionVariables = {
"TEST_VAR" = "asdf";
};
diff --git a/users/kassouni/neovim.nix b/users/kassouni/neovim.nix
index ec90023..3aac114 100644
--- a/users/kassouni/neovim.nix
+++ b/users/kassouni/neovim.nix
@@ -9,6 +9,11 @@
enable = true;
defaultEditor = true;
+ globals = {
+ mapleader = " ";
+ maplocalleader = " ";
+ };
+
opts = {
number = true;
relativenumber = true;
@@ -19,9 +24,22 @@
plugins = {
# Existing plugins
sleuth.enable = true;
- telescope.enable = true;
+ telescope = {
+ enable = true;
+ keymaps = {
+ "<leader>ff" = {
+ action = "find_files";
+ options.desc = "Telescope find files";
+ };
+ "<leader>fg" = {
+ action = "live_grep";
+ options.desc = "Telescope live grep";
+ };
+ };
+ };
highlight-colors.enable = true;
web-devicons.enable = true;
+ which-key.enable = true;
# LSP
lsp = {
diff --git a/users/kassouni/palette/default.nix b/users/kassouni/palette/default.nix
index 403aa60..0600510 100644
--- a/users/kassouni/palette/default.nix
+++ b/users/kassouni/palette/default.nix
@@ -1,12 +1,4 @@
-{
- config,
- lib,
- pkgs,
- ...
-}:
-let
- cfg = config.kassouni.palette;
-in
+{ lib, ... }:
{
imports = [
./bluetooth.nix
@@ -14,6 +6,8 @@ in
./rebuild.nix
./screenshot.nix
./shutdown.nix
+ ./rofi-palette.nix
+ ./fuzzel-palette.nix
];
options.kassouni.palette.commands = lib.mkOption {
@@ -37,18 +31,8 @@ in
);
default = [ ];
description = ''
- Entries shown in the rofi command palette.
+ Entries shown in the command palette. Rendered by both front ends:
+ `open-palette` (rofi, X11) and `open-palette-fuzzel` (fuzzel, Wayland).
'';
};
-
- config.home.packages = [
- (pkgs.writers.writeBashBin "open-palette" ''
- set -eu
- exes=(${lib.concatMapStringsSep " " (c: "${c.exe}") cfg.commands})
- idx=$(${pkgs.rofi}/bin/rofi -dmenu -i -format i -p palette <<EOF
-${lib.concatMapStrings (c: "${c.icon} ${c.name}\n") cfg.commands}EOF
- )
- exec "''${exes[$idx]}"
- '')
- ];
}
diff --git a/users/kassouni/palette/fuzzel-palette.nix b/users/kassouni/palette/fuzzel-palette.nix
new file mode 100644
index 0000000..d6d4774
--- /dev/null
+++ b/users/kassouni/palette/fuzzel-palette.nix
@@ -0,0 +1,27 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+let
+ cfg = config.kassouni.palette;
+in
+{
+ # Wayland front end for the palette. `--index` is fuzzel's answer to rofi's
+ # `-format i`, so the same index-into-exes trick works. Unlike rofi, fuzzel
+ # will happily accept text that matches no row; it exits non-zero there, but
+ # the numeric guard keeps a surprising build of fuzzel from indexing the
+ # array with garbage.
+ home.packages = [
+ (pkgs.writers.writeBashBin "open-palette-fuzzel" ''
+ set -eu
+ exes=(${lib.concatMapStringsSep " " (c: "${c.exe}") cfg.commands})
+ idx=$(${pkgs.fuzzel}/bin/fuzzel --dmenu --index --prompt "palette " <<EOF
+${lib.concatMapStrings (c: "${c.icon} ${c.name}\n") cfg.commands}EOF
+ )
+ [[ $idx =~ ^[0-9]+$ ]] && [[ $idx -lt ''${#exes[@]} ]] || exit 1
+ exec "''${exes[$idx]}"
+ '')
+ ];
+}
diff --git a/users/kassouni/palette/rofi-palette.nix b/users/kassouni/palette/rofi-palette.nix
new file mode 100644
index 0000000..7418ceb
--- /dev/null
+++ b/users/kassouni/palette/rofi-palette.nix
@@ -0,0 +1,24 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+let
+ cfg = config.kassouni.palette;
+in
+{
+ # X11 front end for the palette. `-format i` makes rofi print the row index,
+ # so the label shown and the executable run stay paired by position rather
+ # than by parsing the label back out.
+ home.packages = [
+ (pkgs.writers.writeBashBin "open-palette" ''
+ set -eu
+ exes=(${lib.concatMapStringsSep " " (c: "${c.exe}") cfg.commands})
+ idx=$(${pkgs.rofi}/bin/rofi -dmenu -i -format i -p palette <<EOF
+${lib.concatMapStrings (c: "${c.icon} ${c.name}\n") cfg.commands}EOF
+ )
+ exec "''${exes[$idx]}"
+ '')
+ ];
+}
diff --git a/users/kassouni/theme.nix b/users/kassouni/theme.nix
index 4c96615..70785ca 100644
--- a/users/kassouni/theme.nix
+++ b/users/kassouni/theme.nix
@@ -6,7 +6,7 @@
font = {
size = lib.mkOption {
type = lib.types.int;
- default = 24;
+ default = 16;
description = "Global font size for all applications";
};
@@ -21,6 +21,23 @@
default = 10;
type = lib.types.int;
};
+
+ wallpaper = lib.mkOption {
+ type = lib.types.path;
+ description = "Wallpaper image used by the window manager";
+ default = pkgs.runCommand "fw-13-pro-wallpaper-6.png" {
+ src = pkgs.fetchurl {
+ url = "https://downloads.frame.work/assets/framework-laptop13pro-wallpaper-pack.zip";
+ sha256 = "0pjmsyfz49r2fwkz0c00rzjhf2rzfxrk72lnqc94z6a8h3rs3v3b";
+ };
+ nativeBuildInputs = [ pkgs.unzip ];
+ } ''
+ unzip -j "$src" "FW 13 Pro Wallpaper 6.png"
+ # unzip restores the archive's own mode bits, which nix rejects on a
+ # store output; install with an explicit mode instead of moving.
+ install -m 0444 "FW 13 Pro Wallpaper 6.png" "$out"
+ '';
+ };
};
};
};
diff --git a/users/kassouni/wayland/fuzzel.nix b/users/kassouni/wayland/fuzzel.nix
deleted file mode 100644
index a716b2b..0000000
--- a/users/kassouni/wayland/fuzzel.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- pkgs,
- lib,
- config,
- ...
-}:
-{
- programs.fuzzel = {
- enable = true;
- settings = {
- main = {
- font = lib.mkForce "${config.theme.font.family}:size=${toString config.theme.font.size}";
- };
-
-
-
- border = {
- radius = 0;
- };
- };
- };
-
-}