new wm, hyprland gone
This commit is contained in:
parent
003f37bfbd
commit
cb4b22b4e5
41 changed files with 1145 additions and 1364 deletions
39
modules/desktop/cliphist.nix
Normal file
39
modules/desktop/cliphist.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ lib, config, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.cliphist;
|
||||
in {
|
||||
options.modules.desktop.cliphist = {
|
||||
enable = mkEnableOption "enable cliphist, a clipboard manager for wayland";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.cliphist;
|
||||
};
|
||||
summonScript = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.writeShellScript "cliphist-summon" ''
|
||||
set -euo pipefail
|
||||
|
||||
${lib.getExe cfg.package} list | ${lib.getExe config.modules.desktop.fuzzel.package} --dmenu | ${lib.getExe cfg.package} decode | wl-copy
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.services.cliphist = {
|
||||
enable = true;
|
||||
allowImages = true;
|
||||
package = cfg.package;
|
||||
};
|
||||
|
||||
# home-manager recently did a huge upgrade and made it so wayland stuff doesn't break anymore
|
||||
# however... they forgot to include cliphist
|
||||
# https://github.com/nix-community/home-manager/pull/5785
|
||||
# EDIT: i initially did this with `graphical-session-pre.target`, but that didn't work, pray this does
|
||||
hm.systemd.user.services.cliphist.Unit.After = "graphical-session.target";
|
||||
hm.systemd.user.services.cliphist-images.Unit.After = "graphical-session.target";
|
||||
|
||||
modules.desktop.rofi.enable = true;
|
||||
};
|
||||
}
|
|
@ -18,6 +18,8 @@ in {
|
|||
|
||||
# enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
networking.networkmanager.wifi.backend = "iwd";
|
||||
networking.wireless.iwd.settings.Settings.AutoConnect = true;
|
||||
|
||||
# speed up boot
|
||||
# https://discourse.nixos.org/t/boot-faster-by-disabling-udev-settle-and-nm-wait-online/6339
|
||||
|
@ -26,13 +28,6 @@ in {
|
|||
|
||||
# mounting, trash, and mtp support
|
||||
services.gvfs.enable = true;
|
||||
|
||||
# various evironment variables that are needed for everything desktop related
|
||||
environment.sessionVariables = {
|
||||
# automatic hidpi for qt apps
|
||||
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
||||
QT_ENABLE_HIGHDPI_SCALING = "1";
|
||||
};
|
||||
}
|
||||
(mkIf (cfg.envProto == "wayland") {
|
||||
environment.sessionVariables = {
|
||||
|
|
|
@ -17,8 +17,7 @@ in {
|
|||
follow = "mouse";
|
||||
width = 300;
|
||||
height = 145;
|
||||
# TODO: make more dynamic
|
||||
frame_color = "#f5c2e7"; # catppuccin pink
|
||||
frame_color = "#${base02}";
|
||||
|
||||
origin = "top-right";
|
||||
vertical_alignment = "center";
|
||||
|
|
|
@ -2,24 +2,28 @@
|
|||
|
||||
with lib;
|
||||
let
|
||||
# TODO: seperate into two functions?
|
||||
# one for the pt controlled fonts and one for the px controlled fonts
|
||||
mkFontOption = kind: default: {
|
||||
family = mkOption {
|
||||
type = types.str;
|
||||
default = default.family;
|
||||
description = "Family name for ${kind} font profile";
|
||||
example = "Fira Code";
|
||||
example = "Cozette";
|
||||
};
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = default.package;
|
||||
description = "Package for ${kind} font profile";
|
||||
example = "pkgs.fira-code";
|
||||
example = "pkgs.cozette";
|
||||
};
|
||||
size = mkOption {
|
||||
type = types.number;
|
||||
default = default.size;
|
||||
description = "${kind} font profile size, px";
|
||||
example = "11";
|
||||
description = ''
|
||||
${kind} font profile size, pt for sans/serif, px for monospace/bitmap fonts.
|
||||
'';
|
||||
example = "13";
|
||||
};
|
||||
};
|
||||
cfg = config.modules.desktop.fonts;
|
||||
|
@ -30,16 +34,16 @@ in {
|
|||
|
||||
fonts = {
|
||||
sansSerif = mkFontOption "sansSerif" {
|
||||
package = pkgs.my.lexica-ultralegible;
|
||||
family = "Lexica Ultralegible";
|
||||
package = pkgs.atkinson-hyperlegible-next;
|
||||
family = "Atkinson Hyperlegible Next";
|
||||
|
||||
size = 11;
|
||||
size = 10;
|
||||
};
|
||||
serif = mkFontOption "serif" {
|
||||
package = pkgs.my.lexica-ultralegible;
|
||||
family = "Lexica Ultralegible";
|
||||
package = pkgs.atkinson-hyperlegible-next;
|
||||
family = "Atkinson Hyperlegible Next";
|
||||
|
||||
size = 11;
|
||||
size = 10;
|
||||
};
|
||||
monospace = mkFontOption "monospace" {
|
||||
package = pkgs.cozette;
|
||||
|
@ -111,7 +115,9 @@ in {
|
|||
mplus-outline-fonts.githubRelease
|
||||
dina-font
|
||||
proggyfonts
|
||||
atkinson-hyperlegible
|
||||
atkinson-hyperlegible # old
|
||||
atkinson-hyperlegible-next
|
||||
atkinson-hyperlegible-mono
|
||||
cozette
|
||||
twemoji-color-font
|
||||
noto-fonts-color-emoji
|
||||
|
|
33
modules/desktop/fuzzel.nix
Normal file
33
modules/desktop/fuzzel.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.fuzzel;
|
||||
in {
|
||||
options.modules.desktop.fuzzel = {
|
||||
enable = mkEnableOption "Enable fuzzel, an application launcher similar to rofi's drun mode";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.fuzzel;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.programs.fuzzel = {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
terminal = "wezterm start";
|
||||
font = with config.modules.desktop.fonts.fonts; "${monospace.family}:pixelsize=${toString monospace.size}";
|
||||
prompt = "> ";
|
||||
dpi-aware = "no";
|
||||
lines = 20;
|
||||
width = 28;
|
||||
letter-spacing = 0.5;
|
||||
horizontal-pad = 32;
|
||||
vertical-pad = 8;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -5,12 +5,18 @@ let
|
|||
cfg = config.modules.desktop.hypridle;
|
||||
in {
|
||||
options.modules.desktop.hypridle = {
|
||||
enable = mkEnableOption "Enable hypridle, hyprland's idle daemon";
|
||||
enable = mkEnableOption "Enable hypridle, a wayland idle daemon";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = inputs.hypridle.packages.${system}.hypridle;
|
||||
example = "pkgs.hypridle";
|
||||
};
|
||||
desktop = mkEnableOption "Enable desktop tweaks (greatly extends the idle timeout)";
|
||||
desktopMultiplier = mkOption {
|
||||
type = types.int;
|
||||
default = 10;
|
||||
example = 10;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -27,32 +33,31 @@ in {
|
|||
before_sleep_cmd = "${pkgs.systemd}/bin/loginctl lock-session"; # lock the screen before sleeping
|
||||
};
|
||||
|
||||
listener = [
|
||||
listener = let
|
||||
toDesktopTimeout = t: if cfg.desktop then t * cfg.desktopMultiplier else t;
|
||||
in [
|
||||
{
|
||||
timeout = 60;
|
||||
timeout = toDesktopTimeout 60; # 1 min
|
||||
on-timeout = "${lib.getExe pkgs.brightnessctl} -c backlight -s set 20"; # dim screen, save brightness state
|
||||
on-resume = "${lib.getExe pkgs.brightnessctl} -c backlight -r"; # restore previous screen brightness state
|
||||
}
|
||||
{
|
||||
timeout = 60;
|
||||
timeout = toDesktopTimeout 60; # 1 min
|
||||
on-timeout = "${lib.getExe pkgs.brightnessctl} -d '*:kbd_backlight' -s set 0"; # turn off keyboard backlight, save state
|
||||
on-resume = "${lib.getExe pkgs.brightnessctl} -d '*:kbd_backlight' -r"; # restore previous keyboard backlight state
|
||||
}
|
||||
{
|
||||
timeout = 60 * 2; # 2 min
|
||||
timeout = toDesktopTimeout (60 * 2); # 2 min
|
||||
on-timeout = "${pkgs.systemd}/bin/loginctl lock-session"; # lock computer
|
||||
}
|
||||
{
|
||||
timeout = 60 * 15; # 15 min
|
||||
timeout = toDesktopTimeout (60 * 15); # 15 min
|
||||
on-timeout = "${pkgs.systemd}/bin/systemctl suspend"; # sleep/suspend
|
||||
}
|
||||
] ++ optional config.modules.desktop.hyprland.enable (let
|
||||
hyprctl = "${config.modules.desktop.hyprland.package}/bin/hyprctl";
|
||||
in {
|
||||
timeout = 90; # 1.5 min
|
||||
on-timeout = "${hyprctl} dispatch dpms off"; # turn off screen
|
||||
on-resume = "${hyprctl} dispatch dpms on"; # turn it back on
|
||||
});
|
||||
] ++ optional config.modules.desktop.niri.enable {
|
||||
timeout = toDesktopTimeout (60 + 30); # 1.5 min
|
||||
on-timeout = "niri msg action power-off-monitors";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,410 +0,0 @@
|
|||
{ inputs, lib, config, system, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.hyprland;
|
||||
hyprpkgs = inputs.hyprland.packages.${system};
|
||||
in {
|
||||
options.modules.desktop.hyprland = {
|
||||
enable = mkEnableOption "Enable hyprland, a dynamic tiling wayland compositor based on wlroots that doesn't sacrifice on its looks";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = hyprpkgs.hyprland;
|
||||
example = "pkgs.hyprland";
|
||||
};
|
||||
portalPackage = mkOption {
|
||||
type = types.package;
|
||||
default = hyprpkgs.xdg-desktop-portal-hyprland;
|
||||
example = "pkgs.xdg-desktop-portal-hyprland";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.displayManager.sessionPackages = [ cfg.package ];
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk cfg.portalPackage ];
|
||||
config = {
|
||||
common = {
|
||||
default = [ "hyprland" "gtk" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# fixes a few things, most notibly, xwayland
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
package = cfg.package;
|
||||
portalPackage = cfg.portalPackage;
|
||||
};
|
||||
|
||||
hm.wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
package = cfg.package;
|
||||
|
||||
systemd.variables = [ "--all" ];
|
||||
|
||||
settings = let
|
||||
wobSock = config.modules.desktop.wob.sockPath;
|
||||
in {
|
||||
source = [];
|
||||
|
||||
"$mod" = "SUPER";
|
||||
bindm = [ # "bind mouse"
|
||||
# move/resize windows with mod + lmb/rmb and dragging
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
];
|
||||
bindel = (if config.modules.desktop.wob.enable then [ # "bind held & locked"
|
||||
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > ${wobSock}"
|
||||
", XF86AudioLowerVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%- && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > ${wobSock}"
|
||||
", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -c backlight s +5% | sed -n 's/.*(\\([0-9]*\\)%).*/\\1/p' > ${wobSock}"
|
||||
", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -c backlight s 5%- | sed -n 's/.*(\\([0-9]*\\)%).*/\\1/p' > ${wobSock}"
|
||||
", XF86KbdBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -d '*:kbd_backlight' s +5% | sed -n 's/.*(\\([0-9]*\\)%).*/\\1/p' > ${wobSock}"
|
||||
", XF86KbdBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -d '*:kbd_backlight' s 5%- | sed -n 's/.*(\\([0-9]*\\)%).*/\\1/p' > ${wobSock}"
|
||||
] else [
|
||||
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -c backlight s +5%"
|
||||
", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -c backlight s 5%-"
|
||||
", XF86KbdBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -d '*:kbd_backlight' s +5%"
|
||||
", XF86KbdBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -d '*:kbd_backlight' s 5%-"
|
||||
]);
|
||||
bindl = ([ # "bind locked"
|
||||
",switch:Lid Switch,exec,${lib.getExe config.modules.desktop.hyprlock.package}"
|
||||
|
||||
", XF86AudioPlay, exec, ${lib.getExe pkgs.playerctl} play-pause"
|
||||
", XF86AudioStop, exec, ${lib.getExe pkgs.playerctl} stop"
|
||||
", XF86AudioPrev, exec, ${lib.getExe pkgs.playerctl} previous"
|
||||
", XF86AudioNext, exec, ${lib.getExe pkgs.playerctl} next"
|
||||
|
||||
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
] ++ (if config.modules.desktop.wob.enable then [
|
||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && (wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q MUTED && echo 0 > ${wobSock}) || wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > ${wobSock}"
|
||||
] else [
|
||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
]));
|
||||
bindr = [ # "bind released"
|
||||
"SUPER, Super_L, exec, ${lib.getExe config.modules.desktop.nwg-drawer.package}"
|
||||
];
|
||||
bind = let
|
||||
screenshotScript = pkgs.writeShellScript "screenshot" ''
|
||||
set -euo pipefail
|
||||
|
||||
temp_file=$(mktemp)
|
||||
trap 'rm -f "$temp_file"' EXIT
|
||||
|
||||
mode="$1"
|
||||
case "$mode" in
|
||||
screen)
|
||||
mode="output"
|
||||
;;
|
||||
area)
|
||||
mode="area"
|
||||
;;
|
||||
window)
|
||||
mode="active"
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 [screen|area|window]" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
${lib.getExe pkgs.grimblast} --freeze save "$mode" - > "$temp_file"
|
||||
|
||||
cat "$temp_file" | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard -t image/png
|
||||
|
||||
action=$(${pkgs.libnotify}/bin/notify-send "Screenshot Captured" \
|
||||
--app-name="Screenshot" \
|
||||
--urgency="normal" \
|
||||
--action="default=Edit Image" \
|
||||
--icon="$temp_file" \
|
||||
"Click to annotate image")
|
||||
|
||||
case "$action" in
|
||||
default)
|
||||
${lib.getExe pkgs.satty} --filename "$temp_file"
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
pickerScript = pkgs.writeShellScript "picker" ''
|
||||
set -euo pipefail
|
||||
|
||||
${lib.getExe pkgs.hyprpicker} --render-inactive --format hex | sed -z 's/\n//g' | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard -t text/plain
|
||||
|
||||
${pkgs.libnotify}/bin/notify-send "Color Captured" \
|
||||
--app-name="Picker" \
|
||||
--urgency="normal" \
|
||||
"Color copied to clipboard"
|
||||
'';
|
||||
ocrScript = pkgs.writeShellScript "ocr" ''
|
||||
set -euo pipefail
|
||||
|
||||
output=$(${lib.getExe pkgs.grimblast} --freeze save area - | ${lib.getExe pkgs.tesseract5} - -)
|
||||
|
||||
echo "$output" | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard -t text/plain
|
||||
|
||||
${pkgs.libnotify}/bin/notify-send "OCR Captured" \
|
||||
--app-name="OCR" \
|
||||
--urgency="normal" \
|
||||
"Text copied to clipboard"
|
||||
'';
|
||||
in [
|
||||
"$mod, Q, killactive, "
|
||||
"$mod, F, togglefloating, "
|
||||
"$mod, P, pseudo, "
|
||||
"$mod, J, togglesplit, "
|
||||
"$mod SHIFT, F, fullscreen, "
|
||||
|
||||
# move focus with mod + arrow keys
|
||||
"$mod, left, movefocus, l"
|
||||
"$mod, right, movefocus, r"
|
||||
"$mod, up, movefocus, u"
|
||||
"$mod, down, movefocus, d"
|
||||
# move windows with mod + shift + arrow keys
|
||||
"$mod SHIFT, left, movewindow, l"
|
||||
"$mod SHIFT, right, movewindow, r"
|
||||
"$mod SHIFT, up, movewindow, u"
|
||||
"$mod SHIFT, down, movewindow, d"
|
||||
|
||||
# example special workspace (scratchpad)
|
||||
"$mod, grave, togglespecialworkspace, magic"
|
||||
"$mod SHIFT, grave, movetoworkspace, special:magic"
|
||||
|
||||
# scroll through workspaces with mod + scroll
|
||||
"$mod, mouse_down, workspace, e+1"
|
||||
"$mod, mouse_up, workspace, e-1"
|
||||
# alternatively, scroll through workspaces with mod + brackets
|
||||
"$mod, bracketleft, workspace, e-1"
|
||||
"$mod, bracketright, workspace, e+1"
|
||||
|
||||
"$mod, R, exec, ${lib.getExe config.modules.desktop.rofi.package} -show run"
|
||||
"$mod, T, exec, ${lib.getExe config.modules.software.system.wezterm.package}"
|
||||
"$mod, L, exec, ${lib.getExe config.modules.desktop.hyprlock.package}"
|
||||
"$mod, V, exec, ${lib.getExe config.modules.software.system.wezterm.package} start --class 'clipse' -e '${lib.getExe config.modules.desktop.clipse.package}'"
|
||||
"$mod, E, exec, ${lib.getExe pkgs.nautilus}"
|
||||
|
||||
# screenshot
|
||||
# area
|
||||
", Print, exec, ${screenshotScript} area"
|
||||
"$mod SHIFT, S, exec, ${screenshotScript} area"
|
||||
# screen
|
||||
"CTRL, Print, exec, ${screenshotScript} screen"
|
||||
"$mod SHIFT CTRL, S, exec, ${screenshotScript} screen"
|
||||
# window
|
||||
"ALT, Print, exec, ${screenshotScript} window"
|
||||
"$mod SHIFT ALT, S, exec, ${screenshotScript} window"
|
||||
# pick color
|
||||
"$mod SHIFT, C, exec, ${pickerScript}"
|
||||
# ocr
|
||||
"$mod SHIFT, T, exec, ${ocrScript}"
|
||||
|
||||
", XF86LaunchA, exec, ${screenshotScript} area"
|
||||
", XF86LaunchB, exec, ${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20"
|
||||
", XF86ScreenSaver, exec, ${lib.getExe config.modules.desktop.hyprlock.package}"
|
||||
] ++ (
|
||||
# workspaces
|
||||
# binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
|
||||
builtins.concatLists (builtins.genList (
|
||||
x: let
|
||||
ws = let
|
||||
c = (x + 1) / 10;
|
||||
in
|
||||
builtins.toString (x + 1 - (c * 10));
|
||||
in [
|
||||
"$mod, ${ws}, workspace, ${toString (x + 1)}"
|
||||
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
|
||||
]
|
||||
)
|
||||
10)
|
||||
);
|
||||
|
||||
input = {
|
||||
kb_layout = "us";
|
||||
|
||||
follow_mouse = 1;
|
||||
|
||||
# uhm?? why do i have to do this here. should be automatic from libinput
|
||||
# whatever. ill just hardcode for now
|
||||
# TODO
|
||||
touchpad = {
|
||||
disable_while_typing = false;
|
||||
natural_scroll = true;
|
||||
};
|
||||
};
|
||||
|
||||
monitor=",highrr,auto,auto";
|
||||
|
||||
exec-once = [
|
||||
"${lib.getExe pkgs.wl-clip-persist} --clipboard regular" # to fix wl clipboards disappearing
|
||||
];
|
||||
|
||||
env = [
|
||||
"XCURSOR_THEME,${config.modules.desktop.themes.cursorTheme.name}"
|
||||
"XCURSOR_SIZE,${toString config.modules.desktop.themes.cursorTheme.size}"
|
||||
];
|
||||
|
||||
general = {
|
||||
gaps_in = 6;
|
||||
gaps_out = 6;
|
||||
border_size = 1;
|
||||
no_border_on_floating = false;
|
||||
|
||||
layout = "dwindle";
|
||||
|
||||
resize_on_border = true;
|
||||
};
|
||||
|
||||
windowrulev2 = [
|
||||
"tag +floater, class:^org.gnome.FileRoller$"
|
||||
"tag +dimmedFloater, class:^org.gnome.Loupe$"
|
||||
"tag +dimmedFloater, class:^com.gabm.satty$"
|
||||
"tag +dimmedFloater, title:^Open.*$"
|
||||
"tag +dimmedFloater, title:^Save As$"
|
||||
"tag +dimmedFloater, title:^Select.*$"
|
||||
"tag +dimmedFloater, title:^File Upload$"
|
||||
|
||||
# add dimmedFloater too, it's a large window!
|
||||
"tag +dimmedFloater, class:^clipse$"
|
||||
"tag +privatePopup, class:^clipse$"
|
||||
"tag +privatePopup, class:^gcr-prompter$"
|
||||
"tag +privatePopup, class:^.*pinentry-.*$"
|
||||
"tag +privatePopup, class:^polkit-.*$"
|
||||
|
||||
"tag +pip, title:^Picture-in-Picture$"
|
||||
"tag +pip, title:^Picture in picture$"
|
||||
"tag +pip, title:^Discord Popout$"
|
||||
|
||||
"float, tag:floater"
|
||||
"center, tag:floater"
|
||||
"size 1100 650, tag:floater"
|
||||
# why is this not monitor size and instead based on the window size..
|
||||
# "size exact 60% 80%, tag:floater"
|
||||
|
||||
"float, tag:dimmedFloater"
|
||||
"center, tag:dimmedFloater"
|
||||
"size 1100 650, tag:dimmedFloater"
|
||||
# "size exact 60% 80%, tag:dimmedFloater"
|
||||
"dimaround, tag:dimmedFloater"
|
||||
|
||||
"float, tag:privatePopup"
|
||||
"center, tag:privatePopup"
|
||||
"stayfocused, tag:privatePopup"
|
||||
"dimaround, tag:privatePopup"
|
||||
|
||||
"float, tag:pip"
|
||||
"pin, tag:pip"
|
||||
"keepaspectratio, tag:pip"
|
||||
"noborder, tag:pip"
|
||||
"noinitialfocus, tag:pip"
|
||||
"nodim, tag:pip"
|
||||
|
||||
# this makes wine stuff better
|
||||
"float, class:^.*\.exe$"
|
||||
"rounding 0, class:^.*\.exe$"
|
||||
|
||||
# steam notifs
|
||||
"rounding 0, title:^notificationtoasts_.*$"
|
||||
"pin, title:^notificationtoasts_.*$"
|
||||
"noborder, title:^notificationtoasts_.*$"
|
||||
"nofocus, title:^notificationtoasts_.*$"
|
||||
"noshadow, title:^notificationtoasts_.*$"
|
||||
|
||||
# workspace moving
|
||||
"workspace 1 silent, class:^firefox$"
|
||||
"workspace 2 silent, class:^code$"
|
||||
"workspace 2 silent, class:^imhex$"
|
||||
"workspace 4 silent, class:^vesktop$"
|
||||
];
|
||||
|
||||
layerrule = [
|
||||
"animation slide, notifications"
|
||||
"animation slide, waybar"
|
||||
"animation popin, rofi"
|
||||
"dimaround, rofi"
|
||||
"blur, nwg-drawer"
|
||||
"blur, wob"
|
||||
"blur, notifications"
|
||||
"blur, waybar"
|
||||
"blur, rofi"
|
||||
"ignorezero, notifications" # fucks up the blur otherwise, rounded corners
|
||||
"ignorezero, waybar"
|
||||
"ignorezero, rofi"
|
||||
];
|
||||
|
||||
decoration = {
|
||||
rounding = 10;
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 6;
|
||||
passes = 3;
|
||||
# these have blur disabled
|
||||
popups = true;
|
||||
special = true;
|
||||
input_methods = true;
|
||||
};
|
||||
|
||||
shadow = {
|
||||
enabled = true;
|
||||
range = 6;
|
||||
render_power = 3;
|
||||
ignore_window = true;
|
||||
};
|
||||
};
|
||||
|
||||
animations = {
|
||||
enabled = true;
|
||||
|
||||
bezier = [
|
||||
"outCubic, 0.33, 1, 0.68, 1"
|
||||
"outExpo, 0.16, 1, 0.3, 1"
|
||||
];
|
||||
|
||||
animation = [
|
||||
"windows, 1, 5, outExpo, popin"
|
||||
"windowsOut, 1, 5, outCubic, popin 80%"
|
||||
"border, 1, 2, outExpo"
|
||||
"fade, 1, 3, outCubic"
|
||||
"workspaces, 1, 6, outExpo"
|
||||
"specialWorkspace, 1, 2, outCubic, fade"
|
||||
];
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
pseudotile = "yes"; # master switch for pseudotiling. enabling is mod + P in the keybinds section
|
||||
preserve_split = "yes";
|
||||
};
|
||||
|
||||
gestures = {
|
||||
workspace_swipe = true;
|
||||
workspace_swipe_min_speed_to_force = 0;
|
||||
workspace_swipe_cancel_ratio = 0.1;
|
||||
};
|
||||
|
||||
misc = {
|
||||
# disable default eye candy
|
||||
force_default_wallpaper = 0;
|
||||
disable_splash_rendering = true;
|
||||
disable_hyprland_logo = true;
|
||||
|
||||
# there is zero reason to have this enabled
|
||||
# what were they thinking
|
||||
initial_workspace_tracking = 0;
|
||||
|
||||
vfr = true;
|
||||
vrr = 2;
|
||||
};
|
||||
|
||||
ecosystem = {
|
||||
no_update_news = true;
|
||||
no_donation_nag = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -5,7 +5,7 @@ let
|
|||
cfg = config.modules.desktop.hyprlock;
|
||||
in {
|
||||
options.modules.desktop.hyprlock = {
|
||||
enable = mkEnableOption "Enable hyprlock, a simple, fast, multithreaded screen lock for hyprland";
|
||||
enable = mkEnableOption "Enable hyprlock, a simple, fast, multithreaded screen lock for wayland compositors";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = inputs.hyprlock.packages.${system}.hyprlock;
|
||||
|
@ -26,14 +26,11 @@ in {
|
|||
no_fade_in = true;
|
||||
no_fade_out = true;
|
||||
text_trim = true;
|
||||
# this will render the color we specified on the background before the image is loaded
|
||||
# i like this because we will no longer see our screen for a split second before the image is ready
|
||||
# extra security feature too
|
||||
immediate_render = true;
|
||||
};
|
||||
background = [
|
||||
{
|
||||
path = toString ../../assets/lockscreen.jpg;
|
||||
path = "${../../assets/lockscreen.png}";
|
||||
color = "rgb(${base00})";
|
||||
blur_passes = 3;
|
||||
blur_size = 6;
|
||||
|
|
32
modules/desktop/monitors.nix
Normal file
32
modules/desktop/monitors.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.monitors;
|
||||
in {
|
||||
options.modules.desktop.monitors = {
|
||||
enable = mkEnableOption "Manually configure monitor settings, use if manual configuration is needed";
|
||||
monitors = mkOption {
|
||||
type = types.listOf types.attrs;
|
||||
description = ''
|
||||
a list of monitor configurations. each entry should be an attribute set with the following keys:
|
||||
- `name`: The name of the monitor to configure
|
||||
- `scale`: The scale factor to apply to the monitor
|
||||
note: the first monitor in the list will be considered the "primary" monitor
|
||||
'';
|
||||
example = [
|
||||
{ name = "eDP-1"; scale = 2.0; }
|
||||
{ name = "HDMI-1"; scale = 1.0; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.programs.niri.settings.outputs = builtins.listToAttrs (builtins.map (monitor: {
|
||||
name = monitor.name;
|
||||
value = {
|
||||
scale = monitor.scale;
|
||||
};
|
||||
}) cfg.monitors);
|
||||
};
|
||||
}
|
421
modules/desktop/niri.nix
Normal file
421
modules/desktop/niri.nix
Normal file
|
@ -0,0 +1,421 @@
|
|||
{ inputs, lib, config, system, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.niri;
|
||||
in {
|
||||
options.modules.desktop.niri = {
|
||||
enable = mkEnableOption "Enable niri, a scrolling wayland compositor";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.niri-unstable;
|
||||
example = "pkgs.niri";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.displayManager.sessionPackages = [ cfg.package ];
|
||||
|
||||
programs.niri = {
|
||||
enable = true;
|
||||
package = cfg.package;
|
||||
};
|
||||
|
||||
systemd.user.services.niri-flake-polkit.enable = false; # niri-flake has its own polkit agent, disable it
|
||||
|
||||
hm.programs.niri = {
|
||||
package = cfg.package;
|
||||
settings = let
|
||||
allCorners = r: { bottom-left = r; bottom-right = r; top-left = r; top-right = r; };
|
||||
in {
|
||||
input = {
|
||||
power-key-handling.enable = false;
|
||||
focus-follows-mouse.enable = true;
|
||||
focus-follows-mouse.max-scroll-amount = "0%";
|
||||
|
||||
# TODO: uhm?? why do i have to do this here. should be automatic from libinput
|
||||
# whatever. ill just hardcode for now
|
||||
touchpad = {
|
||||
click-method = "button-areas";
|
||||
tap = true;
|
||||
natural-scroll = true;
|
||||
};
|
||||
|
||||
mouse = {
|
||||
accel-profile = "flat";
|
||||
};
|
||||
};
|
||||
|
||||
clipboard = {
|
||||
disable-primary = true;
|
||||
};
|
||||
|
||||
cursor = {
|
||||
theme = config.modules.desktop.themes.cursorTheme.name;
|
||||
size = config.modules.desktop.themes.cursorTheme.size;
|
||||
};
|
||||
|
||||
environment = {
|
||||
DISPLAY = ":0";
|
||||
};
|
||||
|
||||
prefer-no-csd = true;
|
||||
|
||||
layout = {
|
||||
gaps = 6;
|
||||
|
||||
center-focused-column = "on-overflow";
|
||||
|
||||
focus-ring = {
|
||||
enable = false;
|
||||
width = 1;
|
||||
active.color = config.modules.desktop.themes.niri.accent;
|
||||
inactive.color = config.modules.desktop.themes.niri.inactive;
|
||||
};
|
||||
|
||||
border = {
|
||||
enable = true;
|
||||
width = 1;
|
||||
active.color = config.modules.desktop.themes.niri.accent;
|
||||
inactive.color = config.modules.desktop.themes.niri.inactive;
|
||||
};
|
||||
|
||||
shadow = {
|
||||
enable = true;
|
||||
# TODO: remove this?
|
||||
# this is a way to make the shadow appear on rounded corners
|
||||
# see: https://github.com/YaLTeR/niri/blob/e251ca7340bc71870c3a81a7ffc3d9bde58e685a/resources/default-config.kdl#L201
|
||||
draw-behind-window = true;
|
||||
offset.x = 0;
|
||||
offset.y = 0;
|
||||
softness = 30;
|
||||
spread = 2;
|
||||
color = config.modules.desktop.themes.niri.shadow;
|
||||
};
|
||||
};
|
||||
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
|
||||
screenshot-path = null;
|
||||
|
||||
animations = {
|
||||
shaders.window-resize = ''
|
||||
vec4 resize_color(vec3 coords_curr_geo, vec3 size_curr_geo) {
|
||||
vec3 coords_next_geo = niri_curr_geo_to_next_geo * coords_curr_geo;
|
||||
|
||||
vec3 coords_stretch = niri_geo_to_tex_next * coords_curr_geo;
|
||||
vec3 coords_crop = niri_geo_to_tex_next * coords_next_geo;
|
||||
|
||||
// We can crop if the current window size is smaller than the next window
|
||||
// size. One way to tell is by comparing to 1.0 the X and Y scaling
|
||||
// coefficients in the current-to-next transformation matrix.
|
||||
bool can_crop_by_x = niri_curr_geo_to_next_geo[0][0] <= 1.0;
|
||||
bool can_crop_by_y = niri_curr_geo_to_next_geo[1][1] <= 1.0;
|
||||
|
||||
vec3 coords = coords_stretch;
|
||||
if (can_crop_by_x)
|
||||
coords.x = coords_crop.x;
|
||||
if (can_crop_by_y)
|
||||
coords.y = coords_crop.y;
|
||||
|
||||
vec4 color = texture2D(niri_tex_next, coords.st);
|
||||
|
||||
// However, when we crop, we also want to crop out anything outside the
|
||||
// current geometry. This is because the area of the shader is unspecified
|
||||
// and usually bigger than the current geometry, so if we don't fill pixels
|
||||
// outside with transparency, the texture will leak out.
|
||||
//
|
||||
// When stretching, this is not an issue because the area outside will
|
||||
// correspond to client-side decoration shadows, which are already supposed
|
||||
// to be outside.
|
||||
if (can_crop_by_x && (coords_curr_geo.x < 0.0 || 1.0 < coords_curr_geo.x))
|
||||
color = vec4(0.0);
|
||||
if (can_crop_by_y && (coords_curr_geo.y < 0.0 || 1.0 < coords_curr_geo.y))
|
||||
color = vec4(0.0);
|
||||
|
||||
return color;
|
||||
}
|
||||
'';
|
||||
|
||||
window-close = {
|
||||
easing = {
|
||||
curve = "linear";
|
||||
duration-ms = 600;
|
||||
};
|
||||
};
|
||||
shaders.window-close = ''
|
||||
vec4 fall_and_rotate(vec3 coords_geo, vec3 size_geo) {
|
||||
float progress = niri_clamped_progress * niri_clamped_progress;
|
||||
vec2 coords = (coords_geo.xy - vec2(0.5, 1.0)) * size_geo.xy;
|
||||
coords.y -= progress * 1440.0;
|
||||
float random = (niri_random_seed - 0.5) / 2.0;
|
||||
random = sign(random) - random;
|
||||
float max_angle = 0.5 * random;
|
||||
float angle = progress * max_angle;
|
||||
mat2 rotate = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));
|
||||
coords = rotate * coords;
|
||||
coords_geo = vec3(coords / size_geo.xy + vec2(0.5, 1.0), 1.0);
|
||||
vec3 coords_tex = niri_geo_to_tex * coords_geo;
|
||||
vec4 color = texture2D(niri_tex, coords_tex.st);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
vec4 close_color(vec3 coords_geo, vec3 size_geo) {
|
||||
return fall_and_rotate(coords_geo, size_geo);
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
window-rules = [
|
||||
{
|
||||
geometry-corner-radius = allCorners 10.0;
|
||||
clip-to-geometry = true;
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{ app-id = "^org\.wezfurlong\.wezterm$"; }
|
||||
];
|
||||
# see earlier shadow config; this is here because it's a transparent window, special case
|
||||
shadow.draw-behind-window = false;
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{ app-id = "^gcr-prompter$"; }
|
||||
{ app-id = "^.*pinentry-.*$"; }
|
||||
{ app-id = "^polkit-.*$"; }
|
||||
{ app-id = "^org.gnome.seahorse.Application$"; }
|
||||
];
|
||||
block-out-from = "screen-capture";
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{ app-id = "^gcr-prompter$"; }
|
||||
{ app-id = "^.*pinentry-.*$"; }
|
||||
{ app-id = "^polkit-.*$"; }
|
||||
{ app-id = "^org\.gnome\.Loupe$"; }
|
||||
{ title = "^Open Folder$"; }
|
||||
{ title = "^Open Files$"; }
|
||||
{ title = "^Open File$"; }
|
||||
{ title = "^Open$"; }
|
||||
{ title = "^Save$"; }
|
||||
{ title = "^Save As$"; }
|
||||
];
|
||||
open-floating = true;
|
||||
focus-ring = {
|
||||
enable = true;
|
||||
width = 4000;
|
||||
active.color = "${config.modules.desktop.themes.niri.shadow}65";
|
||||
inactive.color = "${config.modules.desktop.themes.niri.shadow}65";
|
||||
};
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{ app-id = "firefox$"; title = "^Picture-in-Picture$"; }
|
||||
{ title = "^Picture in picture$"; }
|
||||
{ title = "^Discord Popout$"; }
|
||||
];
|
||||
open-floating = true;
|
||||
default-floating-position = {
|
||||
x = 15;
|
||||
y = 15;
|
||||
relative-to = "top-right";
|
||||
};
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{ app-id = "^gcr-prompter$"; }
|
||||
{ app-id = "^.*pinentry-.*$"; }
|
||||
{ app-id = "^polkit-.*$"; }
|
||||
{ app-id = "^file-roller$"; }
|
||||
{ app-id = "^org\.gnome\.FileRoller$"; }
|
||||
{ app-id = "^org\.gnome\.Loupe$"; }
|
||||
{ title = "^Open Folder$"; }
|
||||
{ title = "^Open Files$"; }
|
||||
{ title = "^Open File$"; }
|
||||
{ title = "^Open$"; }
|
||||
{ title = "^Save$"; }
|
||||
{ title = "^Save As$"; }
|
||||
];
|
||||
open-floating = true;
|
||||
default-column-width.proportion = 0.6;
|
||||
default-window-height.proportion = 0.8;
|
||||
}
|
||||
];
|
||||
|
||||
layer-rules = [
|
||||
{
|
||||
matches = [
|
||||
{ namespace = "^notifications$"; }
|
||||
{ namespace = "^rofi$"; } # a bit silly, but we use rofi for clipboard history
|
||||
];
|
||||
block-out-from = "screencast";
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{ namespace = "^launcher$"; }
|
||||
{ namespace = "^notifications$"; }
|
||||
{ namespace = "^rofi$"; }
|
||||
{ namespace = "^waybar$"; }
|
||||
{ namespace = "^wob$"; }
|
||||
];
|
||||
shadow = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
matches = [
|
||||
{ namespace = "^launcher$"; }
|
||||
{ namespace = "^wob$"; }
|
||||
];
|
||||
# see earlier shadow config; this is here because it's a transparent window, special case
|
||||
shadow.draw-behind-window = false;
|
||||
}
|
||||
];
|
||||
|
||||
binds = with config.hm.lib.niri.actions; let
|
||||
sh = spawn "sh" "-c";
|
||||
in {
|
||||
"Mod+Shift+Slash".action = show-hotkey-overlay;
|
||||
|
||||
"Mod+D".action = spawn "fuzzel";
|
||||
|
||||
"Mod+Q".action = close-window;
|
||||
|
||||
"Mod+H".action = toggle-window-floating;
|
||||
"Mod+Shift+H".action = switch-focus-between-floating-and-tiling;
|
||||
|
||||
"Mod+Left".action = focus-column-left;
|
||||
"Mod+Down".action = focus-window-down;
|
||||
"Mod+Up".action = focus-window-up;
|
||||
"Mod+Right".action = focus-column-right;
|
||||
|
||||
"Mod+Shift+Left".action = move-column-left;
|
||||
"Mod+Shift+Down".action = move-window-down;
|
||||
"Mod+Shift+Up".action = move-window-up;
|
||||
"Mod+Shift+Right".action = move-column-right;
|
||||
|
||||
"Mod+Ctrl+Left".action = focus-monitor-left;
|
||||
"Mod+Ctrl+Down".action = focus-monitor-down;
|
||||
"Mod+Ctrl+Up".action = focus-monitor-up;
|
||||
"Mod+Ctrl+Right".action = focus-monitor-right;
|
||||
|
||||
"Mod+Home".action = focus-column-first;
|
||||
"Mod+End".action = focus-column-last;
|
||||
"Mod+Shift+Home".action = move-column-to-first;
|
||||
"Mod+Shift+End".action = move-column-to-last;
|
||||
|
||||
"Mod+Page_Down".action = focus-workspace-down;
|
||||
"Mod+Page_Up".action = focus-workspace-up;
|
||||
|
||||
"Mod+Shift+Page_Down".action = move-column-to-workspace-down;
|
||||
"Mod+Shift+Page_Up".action = move-column-to-workspace-up;
|
||||
|
||||
"Mod+Ctrl+Page_Down".action = move-workspace-down;
|
||||
"Mod+Ctrl+Page_Up".action = move-workspace-up;
|
||||
|
||||
"Mod+1".action = focus-workspace 1;
|
||||
"Mod+2".action = focus-workspace 2;
|
||||
"Mod+3".action = focus-workspace 3;
|
||||
"Mod+4".action = focus-workspace 4;
|
||||
"Mod+5".action = focus-workspace 5;
|
||||
"Mod+6".action = focus-workspace 6;
|
||||
"Mod+7".action = focus-workspace 7;
|
||||
"Mod+8".action = focus-workspace 8;
|
||||
"Mod+9".action = focus-workspace 9;
|
||||
"Mod+0".action = focus-workspace 10;
|
||||
"Mod+Shift+1".action = move-column-to-workspace 1;
|
||||
"Mod+Shift+2".action = move-column-to-workspace 2;
|
||||
"Mod+Shift+3".action = move-column-to-workspace 3;
|
||||
"Mod+Shift+4".action = move-column-to-workspace 4;
|
||||
"Mod+Shift+5".action = move-column-to-workspace 5;
|
||||
"Mod+Shift+6".action = move-column-to-workspace 6;
|
||||
"Mod+Shift+7".action = move-column-to-workspace 7;
|
||||
"Mod+Shift+8".action = move-column-to-workspace 8;
|
||||
"Mod+Shift+9".action = move-column-to-workspace 9;
|
||||
"Mod+Shift+0".action = move-column-to-workspace 10;
|
||||
|
||||
"Mod+Comma".action = consume-window-into-column;
|
||||
"Mod+Period".action = expel-window-from-column;
|
||||
|
||||
"Mod+BracketLeft".action = consume-or-expel-window-left;
|
||||
"Mod+BracketRight".action = consume-or-expel-window-right;
|
||||
|
||||
"Mod+R".action = switch-preset-column-width;
|
||||
"Mod+Shift+R".action = switch-preset-window-height;
|
||||
"Mod+Ctrl+R".action = reset-window-height;
|
||||
"Mod+F".action = maximize-column;
|
||||
"Mod+Shift+F".action = fullscreen-window;
|
||||
"Mod+C".action = center-column;
|
||||
|
||||
"Mod+Minus".action = set-column-width "-10%";
|
||||
"Mod+Equal".action = set-column-width "+10%";
|
||||
|
||||
"Mod+Shift+Minus".action = set-window-height "-10%";
|
||||
"Mod+Shift+Equal".action = set-window-height "+10%";
|
||||
|
||||
"Print".action = screenshot;
|
||||
|
||||
"Mod+Shift+E".action = quit;
|
||||
|
||||
"XF86AudioMicMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle";
|
||||
"XF86AudioMicMute".allow-when-locked = true;
|
||||
|
||||
"XF86LaunchA".action = screenshot;
|
||||
"XF86LaunchB".action = sh "${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20";
|
||||
"XF86ScreenSaver".action = sh "${pkgs.systemd}/bin/loginctl lock-session";
|
||||
|
||||
# substitutions for when not on laptop
|
||||
"Mod+Shift+S".action = screenshot;
|
||||
"Mod+Shift+P".action = sh "${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20";
|
||||
"Mod+L".action = sh "${pkgs.systemd}/bin/loginctl lock-session";
|
||||
|
||||
"Mod+T".action = spawn "wezterm";
|
||||
"Mod+E".action = spawn "nautilus";
|
||||
|
||||
"XF86AudioPrev".action = sh "${lib.getExe pkgs.playerctl} previous";
|
||||
"XF86AudioPlay".action = sh "${lib.getExe pkgs.playerctl} play-pause";
|
||||
"XF86AudioNext".action = sh "${lib.getExe pkgs.playerctl} next";
|
||||
|
||||
"Mod+V".action = sh "${config.modules.desktop.cliphist.summonScript}";
|
||||
|
||||
"Mod+Shift+Control+T".action = toggle-debug-tint;
|
||||
"Mod+Shift+Control+O".action = debug-toggle-opaque-regions;
|
||||
"Mod+Shift+Control+D".action = debug-toggle-damage;
|
||||
} // (if config.modules.desktop.wob.enable then let
|
||||
wobSock = config.modules.desktop.wob.sockPath;
|
||||
in {
|
||||
"XF86AudioRaiseVolume".action = sh "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > ${wobSock}";
|
||||
"XF86AudioRaiseVolume".allow-when-locked = true;
|
||||
"XF86AudioLowerVolume".action = sh "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%- && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > ${wobSock}";
|
||||
"XF86AudioLowerVolume".allow-when-locked = true;
|
||||
"XF86AudioMute".action = sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && (wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q MUTED && echo 0 > ${wobSock}) || wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > ${wobSock}";
|
||||
"XF86AudioMute".allow-when-locked = true;
|
||||
"XF86MonBrightnessUp".action = sh "${lib.getExe pkgs.brightnessctl} -c backlight s +5% | sed -n 's/.*(\\([0-9]*\\)%).*/\\1/p' > ${wobSock}";
|
||||
"XF86MonBrightnessUp".allow-when-locked = true;
|
||||
"XF86MonBrightnessDown".action = sh "${lib.getExe pkgs.brightnessctl} -c backlight s 5%- | sed -n 's/.*(\\([0-9]*\\)%).*/\\1/p' > ${wobSock}";
|
||||
"XF86MonBrightnessDown".allow-when-locked = true;
|
||||
"XF86KbdBrightnessUp".action = sh "${lib.getExe pkgs.brightnessctl} -d '*:kbd_backlight' s +5% | sed -n 's/.*(\\([0-9]*\\)%).*/\\1/p' > ${wobSock}";
|
||||
"XF86KbdBrightnessUp".allow-when-locked = true;
|
||||
"XF86KbdBrightnessDown".action = sh "${lib.getExe pkgs.brightnessctl} -d '*:kbd_backlight' s 5%- | sed -n 's/.*(\\([0-9]*\\)%).*/\\1/p' > ${wobSock}";
|
||||
"XF86KbdBrightnessDown".allow-when-locked = true;
|
||||
} else {
|
||||
"XF86AudioRaiseVolume".action = sh "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+";
|
||||
"XF86AudioRaiseVolume".allow-when-locked = true;
|
||||
"XF86AudioLowerVolume".action = sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
|
||||
"XF86AudioLowerVolume".allow-when-locked = true;
|
||||
"XF86AudioMute".action = sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
"XF86AudioMute".allow-when-locked = true;
|
||||
"XF86MonBrightnessUp".action = sh "${lib.getExe pkgs.brightnessctl} -c backlight s +5%";
|
||||
"XF86MonBrightnessUp".allow-when-locked = true;
|
||||
"XF86MonBrightnessDown".action = sh "${lib.getExe pkgs.brightnessctl} -c backlight s 5%-";
|
||||
"XF86MonBrightnessDown".allow-when-locked = true;
|
||||
"XF86KbdBrightnessUp".action = sh "${lib.getExe pkgs.brightnessctl} -d '*:kbd_backlight' s +5%";
|
||||
"XF86KbdBrightnessUp".allow-when-locked = true;
|
||||
"XF86KbdBrightnessDown".action = sh "${lib.getExe pkgs.brightnessctl} -d '*:kbd_backlight' s 5%-";
|
||||
"XF86KbdBrightnessDown".allow-when-locked = true;
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
{ lib, config, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.nwg-drawer;
|
||||
in {
|
||||
options.modules.desktop.nwg-drawer = {
|
||||
enable = mkEnableOption "Enable nwg-drawer, a GTK based application launcher for wayland";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.nwg-drawer;
|
||||
example = "pkgs.nwg-drawer";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.systemd.user.services.nwg-drawer = {
|
||||
Unit = {
|
||||
Description = "nwg-drawer, a GTK based application launcher for wayland";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${lib.getExe cfg.package} -r -nofs -nocats -ovl -term wezterm -spacing 15 -fm nautilus -wm hyprland";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
hm.xdg.configFile."nwg-drawer/drawer.css".text = config.modules.desktop.themes.nwg-drawer;
|
||||
};
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.plymouth;
|
||||
in {
|
||||
options.modules.desktop.plymouth = {
|
||||
enable = mkEnableOption "Enable plymouth, a graphical boot splash screen";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.plymouth = {
|
||||
enable = true;
|
||||
|
||||
themePackages = [ config.modules.desktop.themes.plymouthTheme.package ];
|
||||
theme = config.modules.desktop.themes.plymouthTheme.name;
|
||||
};
|
||||
boot.kernelParams = [ "plymouth.use-simpledrm" ];
|
||||
|
||||
# smooth transition from plymouth to the login manager
|
||||
# honestly, i have No Clue what this does, but it's in the arch wiki so it must be good
|
||||
# https://wiki.archlinux.org/title/Plymouth#Smooth_transition
|
||||
# we aren't actually replacing anything here, nix merges it into the existing service for us :3
|
||||
systemd.services.display-manager = {
|
||||
conflicts = [ "plymouth-quit.service" ];
|
||||
after = [
|
||||
"plymouth-quit.service"
|
||||
"plymouth-start.service"
|
||||
"systemd-user-sessions.service"
|
||||
];
|
||||
onFailure = [ "plymouth-quit.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStartPost = [
|
||||
"-${pkgs.coreutils}/bin/sleep 30"
|
||||
"-${pkgs.plymouth}/bin/plymouth quit --retain-splash"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
71
modules/desktop/regreet.nix
Normal file
71
modules/desktop/regreet.nix
Normal file
|
@ -0,0 +1,71 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.regreet;
|
||||
in {
|
||||
options.modules.desktop.regreet = {
|
||||
enable = mkEnableOption "Enable regreet, a clean and customizable greeter for greetd";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
vt = 7;
|
||||
settings = {
|
||||
# TODO: probably should rewrite somehow,,,
|
||||
# this is ugly, but it SOMEHOW WORKS??
|
||||
# kind of beautiful in its own way
|
||||
default_session = let
|
||||
swayConfig = let
|
||||
monitors = config.modules.desktop.monitors;
|
||||
monitorConfig = if monitors.enable && (builtins.length monitors.monitors > 0) then
|
||||
let
|
||||
# TODO: rewrite primary monitor system
|
||||
# it will get repetitive..
|
||||
firstMonitor = builtins.head monitors.monitors;
|
||||
in
|
||||
"output ${firstMonitor.name} scale ${toString firstMonitor.scale}"
|
||||
else
|
||||
"";
|
||||
in command: pkgs.writeText "kiosk-sway-config" ''
|
||||
${monitorConfig}
|
||||
xwayland disable
|
||||
exec '${command}; ${pkgs.sway}/bin/swaymsg exit'
|
||||
'';
|
||||
swayKiosk = command: "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.sway} --unsupported-gpu --config ${swayConfig command}";
|
||||
in {
|
||||
command = swayKiosk (lib.getExe pkgs.greetd.regreet);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.regreet = {
|
||||
enable = true;
|
||||
settings = {
|
||||
background = {
|
||||
path = "${../../assets/lockscreen.png}";
|
||||
fit = "Cover";
|
||||
};
|
||||
};
|
||||
# TODO: move to theme module
|
||||
theme = with config.modules.desktop.themes.gtkTheme; {
|
||||
name = name;
|
||||
package = package;
|
||||
};
|
||||
iconTheme = with config.modules.desktop.themes.iconTheme; {
|
||||
name = name;
|
||||
package = package;
|
||||
};
|
||||
cursorTheme = with config.modules.desktop.themes.cursorTheme; {
|
||||
name = name;
|
||||
package = package;
|
||||
};
|
||||
font = with config.modules.desktop.fonts.fonts.sansSerif; {
|
||||
name = family;
|
||||
size = size;
|
||||
package = package;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.sddm;
|
||||
in {
|
||||
options.modules.desktop.sddm = {
|
||||
enable = mkEnableOption "Enable SDDM, a display manager for X11 and Wayland windowing systems";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
config.modules.desktop.themes.sddmTheme.package
|
||||
config.modules.desktop.themes.cursorTheme.package # system wide is needed for sddm
|
||||
];
|
||||
# why do we need kwin for working hidpi
|
||||
# huh????
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
package = pkgs.kdePackages.sddm;
|
||||
wayland.enable = config.modules.desktop.envProto == "wayland";
|
||||
wayland.compositor = "kwin";
|
||||
theme = config.modules.desktop.themes.sddmTheme.name;
|
||||
settings = {
|
||||
Theme = {
|
||||
CursorTheme = config.modules.desktop.themes.cursorTheme.name;
|
||||
CursorSize = config.modules.desktop.themes.cursorTheme.size;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -36,7 +36,7 @@ in {
|
|||
|
||||
[ ! -f "$wallpaper" ] && exit 1
|
||||
|
||||
${lib.getExe cfg.package} img "$wallpaper" --transition-type grow --transition-fps 60 --transition-pos 0.915,0.977 --transition-duration 1.5
|
||||
${lib.getExe cfg.package} img "$wallpaper" --transition-type grow --transition-fps 60 --transition-pos 1.0,1.0 --transition-duration 1.5
|
||||
|
||||
echo "$file" > "${lastWallpaper}"
|
||||
'';
|
||||
|
@ -58,7 +58,7 @@ in {
|
|||
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${cfg.package}/bin/swww-daemon";
|
||||
ExecStart = "${cfg.package}/bin/swww-daemon --no-cache";
|
||||
ExecStartPost = "${cfg.setScript}";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
|
|
|
@ -45,24 +45,6 @@ in {
|
|||
size = 24;
|
||||
};
|
||||
|
||||
sddmTheme = {
|
||||
name = "catppuccin-${variant}";
|
||||
package = (pkgs.catppuccin-sddm.override {
|
||||
flavor = variant;
|
||||
font = config.modules.desktop.fonts.fonts.sansSerif.family;
|
||||
fontSize = toString config.modules.desktop.fonts.fonts.sansSerif.size;
|
||||
background = ../../../../assets/lockscreen.jpg;
|
||||
loginBackground = true;
|
||||
});
|
||||
};
|
||||
|
||||
plymouthTheme = {
|
||||
name = "catppuccin-${variant}";
|
||||
package = (pkgs.catppuccin-plymouth.override {
|
||||
variant = variant;
|
||||
});
|
||||
};
|
||||
|
||||
editor = {
|
||||
vscode = {
|
||||
colorTheme = {
|
||||
|
@ -84,21 +66,13 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
hyprland = {
|
||||
source = "${inputs.hyprland-catppuccin}/themes/${variant}.conf";
|
||||
extraConfig = ''
|
||||
general {
|
||||
col.active_border=''$${accent}
|
||||
col.inactive_border=$surface0
|
||||
}
|
||||
decoration:shadow {
|
||||
color=$crust
|
||||
color_inactive=$crust
|
||||
}
|
||||
misc {
|
||||
background_color=$crust
|
||||
}
|
||||
'';
|
||||
niri = with colorScheme.palette; {
|
||||
# TODO: make more dynamic
|
||||
# catppuccin pink
|
||||
accent = "#f5c2e7";
|
||||
inactive = "#${base02}";
|
||||
# catppuccin crust
|
||||
shadow = "#11111b";
|
||||
};
|
||||
|
||||
waybar = builtins.concatStringsSep "\n" [
|
||||
|
@ -113,17 +87,17 @@ in {
|
|||
barColor = "${base05}FF";
|
||||
};
|
||||
|
||||
rofi = ./rofi.rasi;
|
||||
rofi = builtins.concatStringsSep "\n" [
|
||||
"@theme \"${inputs.rofi-catppuccin}/themes/catppuccin-${variant}.rasi\""
|
||||
"* { accent: @${accent}; }"
|
||||
(lib.readFile ./rofi.rasi)
|
||||
];
|
||||
|
||||
fuzzel = "${inputs.fuzzel-catppuccin}/themes/catppuccin-${variant}/${accent}.ini";
|
||||
|
||||
wezterm = ''
|
||||
config.color_scheme = 'Catppuccin ${pascalCase variant}'
|
||||
'';
|
||||
|
||||
nwg-drawer = builtins.concatStringsSep "\n" [
|
||||
"@import \"${inputs.waybar-catppuccin}/themes/${variant}.css\";"
|
||||
#"@define-color accent @${accent};" # gtk already does our styling here
|
||||
(lib.readFile ./nwg-drawer.css)
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
window {
|
||||
background: alpha(@base, 0.5);
|
||||
color: @text;
|
||||
font-family: 'Lexica Ultralegible', 'Atkinson Hyperlegible', "Font Awesome 6 Free", "Noto Sans CJK";
|
||||
font-size: 13px;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/* search entry */
|
||||
entry {
|
||||
/* we don't actually need to specify accent color here */
|
||||
/* this is a gtk app, remember? */
|
||||
background-color: alpha(@surface0, 0.5);
|
||||
color: @text;
|
||||
}
|
||||
|
||||
button, box, widget, image {
|
||||
background: none;
|
||||
border: none;
|
||||
color: @text;
|
||||
text-shadow: 0 1px alpha(@base, 0.75);
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 1em 0.5em;
|
||||
border-radius: 1em;
|
||||
}
|
||||
|
||||
button:hover, button:active, box:hover, box:active {
|
||||
background: alpha(@surface0, 0.5);
|
||||
}
|
|
@ -1,13 +1,4 @@
|
|||
* {
|
||||
bg-col: #24273a;
|
||||
bg-col-light: #313244;
|
||||
border-col: #363a4f;
|
||||
selected-col: #45475a;
|
||||
pink: #f5c2e7;
|
||||
fg-col: #cdd6f4;
|
||||
fg-col2: @pink;
|
||||
grey: #bac2de;
|
||||
|
||||
width: 450px;
|
||||
}
|
||||
|
||||
|
@ -20,24 +11,25 @@ window {
|
|||
height: 500px;
|
||||
border: 1px;
|
||||
border-radius: 1em;
|
||||
/* TODO: make more dynamic */
|
||||
border-color: @pink;
|
||||
background-color: @bg-col;
|
||||
border-color: @accent;
|
||||
background-color: @base;
|
||||
}
|
||||
|
||||
mainbox {background-color: @bg-col;}
|
||||
mainbox {
|
||||
background-color: @base;
|
||||
}
|
||||
|
||||
inputbar {
|
||||
margin: 10px 5px 5px 5px;
|
||||
children: [prompt, entry];
|
||||
background-color: @bg-col;
|
||||
background-color: @base;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
prompt {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
text-color: @fg-col;
|
||||
text-color: @text;
|
||||
border-radius: 1.5em;
|
||||
}
|
||||
|
||||
|
@ -49,8 +41,8 @@ textbox-prompt-colon {
|
|||
entry {
|
||||
padding: 1px;
|
||||
margin: 0px;
|
||||
text-color: @fg-col;
|
||||
background-color: @bg-col;
|
||||
text-color: @text;
|
||||
background-color: @base;
|
||||
}
|
||||
|
||||
listview {
|
||||
|
@ -58,27 +50,26 @@ listview {
|
|||
margin: 5px 0px 0px 10px;
|
||||
columns: 1;
|
||||
lines: 10;
|
||||
background-color: @bg-col;
|
||||
background-color: @base;
|
||||
}
|
||||
|
||||
element {
|
||||
padding: 1px;
|
||||
background-color: @bg-col;
|
||||
text-color: @fg-col;
|
||||
background-color: @base;
|
||||
text-color: @text;
|
||||
}
|
||||
|
||||
element-icon {size: 12px;}
|
||||
|
||||
element.selected {
|
||||
background-color: @selected-col;
|
||||
text-color: @fg-col2;
|
||||
background-color: @surface1;
|
||||
text-color: @accent;
|
||||
}
|
||||
|
||||
|
||||
scrollbar {
|
||||
width: 4px ;
|
||||
border: 0;
|
||||
handle-color: @fg-col;
|
||||
handle-color: @text;
|
||||
handle-width: 8px ;
|
||||
padding: 0;
|
||||
}
|
||||
|
@ -87,13 +78,13 @@ mode-switcher {spacing: 0;}
|
|||
|
||||
button {
|
||||
spacing: 0;
|
||||
background-color: @bg-col-light;
|
||||
text-color: @grey;
|
||||
background-color: @surface0;
|
||||
text-color: @subtext1;
|
||||
vertical-align: 0.5;
|
||||
horizontal-align: 0.5;
|
||||
}
|
||||
|
||||
button.selected {
|
||||
background-color: @bg-col;
|
||||
text-color: @pink;
|
||||
background-color: @base;
|
||||
text-color: @accent;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,8 @@ button, button:hover {
|
|||
window#waybar {
|
||||
color: @text;
|
||||
/* background: alpha(@base, 0.8); */
|
||||
background: @base;
|
||||
/* background: @base; */
|
||||
background: alpha(@base, 0.9999999);
|
||||
border-radius: 1em;
|
||||
/* font-family: 'Lexica Ultralegible', 'Atkinson Hyperlegible', "Font Awesome 6 Free", "Noto Sans CJK"; */
|
||||
font-family: "CozetteVector", monospace, "FontAwesome 6 Free", "Noto Sans CJK";
|
||||
|
|
|
@ -31,14 +31,6 @@ in {
|
|||
package = mkPackageOption pkgs "cursor" {};
|
||||
size = mkOpt int 24;
|
||||
};
|
||||
sddmTheme = {
|
||||
name = mkOpt str "";
|
||||
package = mkPackageOption pkgs "sddm" {};
|
||||
};
|
||||
plymouthTheme = {
|
||||
name = mkOpt str "";
|
||||
package = mkPackageOption pkgs "plymouth" {};
|
||||
};
|
||||
|
||||
editor = {
|
||||
vscode = {
|
||||
|
@ -53,9 +45,10 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
hyprland = {
|
||||
source = mkOpt (nullOr str) null;
|
||||
extraConfig = mkOpt (nullOr str) null;
|
||||
niri = {
|
||||
accent = mkOpt str "";
|
||||
inactive = mkOpt str "";
|
||||
shadow = mkOpt str "";
|
||||
};
|
||||
|
||||
waybar = mkOpt str "";
|
||||
|
@ -66,11 +59,11 @@ in {
|
|||
barColor = mkOpt (nullOr str) null;
|
||||
};
|
||||
|
||||
rofi = mkOpt (nullOr path) null;
|
||||
rofi = mkOpt (nullOr str) null;
|
||||
|
||||
fuzzel = mkOpt (nullOr str) null;
|
||||
|
||||
wezterm = mkOpt (nullOr str) null;
|
||||
|
||||
nwg-drawer = mkOpt (nullOr str) null;
|
||||
};
|
||||
|
||||
config = mkIf (cfg.active != null) {
|
||||
|
@ -120,7 +113,7 @@ in {
|
|||
package = cfg.iconTheme.package;
|
||||
};
|
||||
|
||||
hm.programs.vscode = {
|
||||
hm.programs.vscode.profiles.default = {
|
||||
extensions = [
|
||||
cfg.editor.vscode.colorTheme.extension
|
||||
cfg.editor.vscode.iconTheme.extension
|
||||
|
@ -131,11 +124,6 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
hm.wayland.windowManager.hyprland = {
|
||||
settings.source = mkIf (cfg.hyprland.source != null) [ cfg.hyprland.source ];
|
||||
extraConfig = mkIf (cfg.hyprland.extraConfig != null) cfg.hyprland.extraConfig;
|
||||
};
|
||||
|
||||
hm.programs.waybar.style = cfg.waybar;
|
||||
|
||||
hm.services.wob.settings."" = {
|
||||
|
@ -144,11 +132,23 @@ in {
|
|||
bar_color = cfg.wob.barColor;
|
||||
};
|
||||
|
||||
hm.programs.rofi.theme = cfg.rofi;
|
||||
# silly litle hack--rofi hm module doesn't play nice with strings
|
||||
# so, we have to write the config to a file and then read it :P
|
||||
# ...and then back to a string
|
||||
hm.programs.rofi.theme = "${pkgs.writeTextFile {
|
||||
name = "rofi-theme.rasi";
|
||||
text = cfg.rofi;
|
||||
}}";
|
||||
|
||||
hm.programs.fuzzel.settings.main = {
|
||||
include = cfg.fuzzel;
|
||||
icon-theme = cfg.iconTheme.name;
|
||||
};
|
||||
|
||||
hm.xdg.configFile = let
|
||||
iniFmt = pkgs.formats.ini {};
|
||||
|
||||
# souls are forged in the fires of hell
|
||||
mkQtctConf = version: let
|
||||
zeroCount = if version == 5 then 5 else if version == 6 then 10 else builtins.throw "invalid qtct version";
|
||||
zeros = builtins.concatStringsSep "," (builtins.genList (_: "0") zeroCount);
|
||||
|
@ -161,21 +161,12 @@ in {
|
|||
};
|
||||
|
||||
Fonts = with config.modules.desktop.fonts.fonts; {
|
||||
# i'm going to go on a rant here
|
||||
# this actually SUCKS omg
|
||||
# god is dead and The Qt Company killed him
|
||||
# (for qt5, font weight is on a different scale where 50 is equivalent to 400 in qt6, even more fun)
|
||||
# font weight is set to 400, this is the default weight for every font ever and it will fall back to something else if the font doesn't have a 400 weight (ex. cozette only has a 500 weight)
|
||||
# setting the font style name is BAD!! i found it breaks font selection for others that aren't the weight that is given, and it's not required anyway
|
||||
# technically this isn't perfect because we are setting the font size in points to the pixel size, but it doesn't matter since we define it in pixels right afterwards. this is a bit annoying but whatever man
|
||||
# oh and, because why not, the qt5 font config has less zeros than the qt6 font config. the docs don't say anything about this. i am going to kill myself @The Qt Company
|
||||
# yapping over. this is the best we can do for now
|
||||
general = ''"${sansSerif.family},${toString sansSerif.size},${toString sansSerif.size},5,${toString weight},${zeros},1"'';
|
||||
fixed = ''"${monospace.family},${toString monospace.size},${toString monospace.size},5,${toString weight},${zeros},1"'';
|
||||
general = ''"${sansSerif.family},${toString sansSerif.size},-1,5,${toString weight},${zeros},1"'';
|
||||
fixed = ''"${monospace.family},-1,${toString monospace.size},5,${toString weight},${zeros},1"'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
# technically could cause issues w KDE if we use that
|
||||
# technically could cause issues with KDE if we use that
|
||||
# not a concern for now
|
||||
"kdeglobals".text = ''
|
||||
[Icons]
|
||||
|
|
|
@ -8,7 +8,6 @@ in {
|
|||
enable = mkEnableOption "Enable Waybar, a highly customizable wayland bar for wlroots compositors.";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
# default = inputs.waybar.packages.${system}.default;
|
||||
default = pkgs.waybar;
|
||||
example = "pkgs.waybar";
|
||||
};
|
||||
|
@ -35,8 +34,8 @@ in {
|
|||
margin-right = 6;
|
||||
margin-bottom = 0;
|
||||
modules-left = [
|
||||
"hyprland/workspaces"
|
||||
"hyprland/window"
|
||||
"niri/workspaces"
|
||||
"niri/window"
|
||||
];
|
||||
modules-center = [
|
||||
"clock"
|
||||
|
@ -114,24 +113,15 @@ in {
|
|||
tooltip-format = "Change wallpaper";
|
||||
on-click = "${config.modules.desktop.swww.swapScript}";
|
||||
};
|
||||
"hyprland/workspaces" = {
|
||||
"niri/workspaces" = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
"1" = "";
|
||||
"2" = "";
|
||||
"3" = "";
|
||||
"4" = "";
|
||||
urgent = "";
|
||||
default = "•";
|
||||
};
|
||||
persistent-workspaces = {
|
||||
"1" = [];
|
||||
"2" = [];
|
||||
"3" = [];
|
||||
"4" = [];
|
||||
urgent = "◈";
|
||||
focused = "◆";
|
||||
default = "◇";
|
||||
};
|
||||
};
|
||||
"hyprland/window" = {
|
||||
"niri/window" = {
|
||||
format = "{}";
|
||||
icon = true;
|
||||
icon-size = 16;
|
||||
|
@ -170,7 +160,7 @@ in {
|
|||
default = ["" "" ""];
|
||||
};
|
||||
scroll-step = 1;
|
||||
on-click = "${lib.getExe pkgs.pavucontrol}";
|
||||
on-click = "${lib.getExe pkgs.pwvucontrol}";
|
||||
ignored-sinks = ["Easy Effects Sink"];
|
||||
};
|
||||
backlight = {
|
||||
|
|
40
modules/desktop/wl-clip-persist.nix
Normal file
40
modules/desktop/wl-clip-persist.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.wl-clip-persist;
|
||||
in {
|
||||
options.modules.desktop.wl-clip-persist = {
|
||||
enable = mkEnableOption "Enable wl-clip-persist, keep clipboard contents after app exit";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.wl-clip-persist;
|
||||
};
|
||||
clipboard = mkOption {
|
||||
description = "clipboard type to persist";
|
||||
default = "regular";
|
||||
type = types.enum ["regular" "primary" "both"];
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.systemd.user.services.wl-clip-persist = {
|
||||
Unit = {
|
||||
Description = "wl-clip-persist, keep clipboard contents after app exit";
|
||||
After = [ "graphical-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${lib.getExe cfg.package} --clipboard ${cfg.clipboard}";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -2,21 +2,20 @@
|
|||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.clipse;
|
||||
cfg = config.modules.desktop.xwayland-satellite;
|
||||
in {
|
||||
options.modules.desktop.clipse = {
|
||||
enable = mkEnableOption "Enable clipse, a generic clipboard manager";
|
||||
options.modules.desktop.xwayland-satellite = {
|
||||
enable = mkEnableOption "Enable xwayland-satellite, xwayland outside your wayland";
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.clipse;
|
||||
example = "pkgs.clipse";
|
||||
default = pkgs.xwayland-satellite-unstable;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hm.systemd.user.services.clipse = {
|
||||
hm.systemd.user.services.xwayland-satellite = {
|
||||
Unit = {
|
||||
Description = "clipse, a generic clipboard manager";
|
||||
Description = "xwayland-satellite, xwayland outside your wayland";
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
|
@ -27,7 +26,7 @@ in {
|
|||
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${lib.getExe cfg.package} --listen-shell";
|
||||
ExecStart = "${lib.getExe cfg.package}";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue