Switch back to Hyprland

Add separate config files for waybar, fuzzel, mako

Enable gnome-keyring as secret-service, with seahorse for interface

Restructure desktop-related things into a desktop directory
This commit is contained in:
Evie Litherland-Smith 2024-10-25 11:25:34 +01:00
parent 356ce4e4f7
commit 7b9d0a41d6
328 changed files with 1171 additions and 40 deletions

View file

@ -20,10 +20,7 @@
home-manager.users.${username} = {
home.stateVersion = "23.05";
};
system = {
stateVersion = "23.05";
autoUpgrade.operation = "switch";
};
system.stateVersion = "23.05";
users.mutableUsers = false;
hardware.bluetooth.enable = true;
}

View file

@ -36,6 +36,10 @@
input-overlay
];
};
wayland.windowManager.hyprland.settings.monitor = [
"desc:Acer Technologies ED270R TJMEE0043W01,1920x1080@144,0x140,1.0,vrr,2"
"desc:Microstep MSI G27CQ4 E2,2560x1440@144,1920x0,1.25,vrr,2"
];
xdg.configFile."MangoHud/MangoHud.conf".text = with config.lib.stylix.scheme; ''
preset=2
time

View file

@ -82,7 +82,6 @@
};
system.autoUpgrade = {
enable = true;
operation = lib.mkDefault "boot";
persistent = true;
allowReboot = false;
flake = "git+${config.nix.registry.my-nixos.to.url}";
@ -209,7 +208,7 @@
console.useXkbConfig = true;
stylix = {
enable = true;
image = ./home/wallpapers/default.jpg;
image = ./home/desktop/wallpapers/default.jpg;
base16Scheme = "${pkgs.base16-schemes}/share/themes/one-light.yaml";
opacity.popups = 0.8;
cursor = {

View file

@ -1,25 +1,23 @@
{ pkgs, username, ... }:
{
home-manager.users.${username}.imports = [ ./home/desktop.nix ];
home-manager.users.${username}.imports = [ ./home/desktop/default.nix ];
nixpkgs.config.chromium.commandLineArgs = "--password-store='gnome-libsecret' --enable-features=UseOzonePlatform --ozone-platform=wayland";
hardware.bluetooth.enable = true;
environment = {
sessionVariables = {
NIXOS_OZONE_WL = "1";
MOZ_ENABLE_WAYLAND = "1";
XDG_SESSION_TYPE = "wayland";
QT_QPA_PLATFORM = "wayland";
};
systemPackages = with pkgs; [
libsecret
libnotify
xdg-utils
xarchiver
hunspell
hunspellDicts.en_GB-large
];
plasma6.excludePackages = with pkgs.kdePackages; [
plasma-browser-integration
konsole
kate
];
};
security = {
polkit.enable = true;
@ -35,21 +33,34 @@
programs = {
dconf.enable = true;
noisetorch.enable = true;
seahorse.enable = true;
kdeconnect.enable = true;
hyprland.enable = true;
xwayland.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
};
gtk.iconCache.enable = true;
qt = {
enable = true;
style = "adwaita";
platformTheme = "gnome";
};
services = {
displayManager.sddm = {
enable = true;
wayland.enable = true;
};
desktopManager.plasma6 = {
enable = true;
enableQt5Integration = true;
};
gnome.gnome-keyring.enable = true;
flatpak.enable = true;
printing.enable = true;
tumbler.enable = true;
udisks2.enable = true;
gvfs = {
enable = true;
package = pkgs.gnome3.gvfs;
};
pipewire = {
enable = true;
pulse.enable = true;
@ -58,6 +69,20 @@
support32Bit = true;
};
};
greetd = {
enable = true;
settings =
let
default_session.command = "Hyprland";
in
{
inherit default_session;
initial_session = {
inherit (default_session) command;
user = username;
};
};
};
xserver = {
enable = true;
xkb = {
@ -67,4 +92,8 @@
};
};
};
xdg.portal = {
enable = true;
config.common.default = "*"; # TODO change for xdg-desktop-portal > 1.17 changes
};
}

View file

@ -147,6 +147,10 @@
title = "Arch Wiki";
url = "https://wiki.archlinux.org";
}
{
title = "Hyprland Wiki";
url = "https://wiki.hyprland.org";
}
];
};
search = rec {

View file

@ -1,29 +1,28 @@
{ config, pkgs, ... }:
{
imports = [
./plasma/default.nix
./hyprland.nix
./email/default.nix
./calendar/default.nix
./terminal/default.nix
./emacs/default.nix
./browser/default.nix
];
home = {
packages = with pkgs; [
webcord
signal-desktop
whatsapp-for-linux
nomachine-client
];
file.${config.gtk.gtk2.configLocation}.force = true; # Stop clashing with KDE
};
home.packages = with pkgs; [
wl-clipboard
webcord
signal-desktop
whatsapp-for-linux
nomachine-client
];
services.syncthing.enable = true;
programs.mpv.enable = true;
gtk = {
enable = true;
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
iconTheme = {
package = (pkgs.papirus-icon-theme.override { color = "magenta"; });
name = "Papirus";
name = "Papirus-Light";
};
};
xdg = {

View file

@ -1,9 +1,9 @@
{ config, pkgs, ... }:
{
imports = [
../shell/default.nix
../shell/git.nix
../gpg/default.nix
../../shell/default.nix
../../shell/git.nix
../../gpg/default.nix
];
stylix.targets.emacs.enable = false;
services.emacs = {

View file

@ -0,0 +1,24 @@
{ config, ... }:
{
programs.fuzzel = {
enable = true;
settings = {
main = {
icon-theme = config.gtk.iconTheme.name;
icons-enabled = true;
fields = "filename,name,generic,categories";
fuzzy = true;
filter-desktop = true;
terminal = "${config.programs.alacritty.package}/bin/alacritty -e";
lines = 24;
width = 80;
tabs = 4;
layer = "overlay";
};
border = {
width = 1;
radius = 5;
};
};
};
}

View file

@ -0,0 +1,446 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./waybar.nix
./fuzzel.nix
./mako.nix
];
stylix.targets.hyprland.enable = false; # Use my own theme config
home.packages = [
pkgs.libreoffice-fresh
pkgs.ffmpeg
pkgs.swayimg
(pkgs.writeShellScriptBin "protonmail-setup-bridge" ''
pkill -9 -f protonmail-bridge
PASSWORD_STORE_DIR=/dev/null ${pkgs.protonmail-bridge}/bin/protonmail-bridge -c
${config.wayland.windowManager.hyprland.finalPackage}/bin/hyprctl dispatch exec "PASSWORD_STORE_DIR=/dev/null ${pkgs.protonmail-bridge}/bin/protonmail-bridge -n"
'')
];
services = {
hyprpaper.enable = true;
kanshi.systemdTarget = "hyprland-session.target";
gpg-agent.pinentryPackage = pkgs.pinentry-qt;
avizo = {
enable = true;
settings.default.image-opacity = lib.mkForce "1.0";
};
kdeconnect = {
enable = true;
indicator = true;
};
hypridle = {
enable = true;
settings =
let
hyprctl = "${config.wayland.windowManager.hyprland.finalPackage}/bin/hyprctl";
in
{
general = {
after_sleep_cmd = "${hyprctl} dispatch dpms on";
ignore_dbus_inhibit = false;
lock_cmd = "hyprlock";
};
listener = [
{
timeout = 900;
on-timeout = "hyprlock";
}
{
timeout = 1200;
on-timeout = "${hyprctl} dispatch dpms off";
on-resume = "${hyprctl} dispatch dpms on";
}
];
};
};
};
programs = {
waybar.systemd.target = "hyprland-session.target";
hyprlock =
let
font = config.stylix.fonts.sansSerif.name;
foreground = config.lib.stylix.scheme.base05;
background = config.lib.stylix.scheme.base00;
accent = config.lib.stylix.scheme.base0E;
in
{
enable = true;
settings = {
general = {
disable_loading_bar = true;
grace = 5;
hide_cursor = true;
no_fade_in = false;
};
background = [
{
monitor = "";
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}
];
label = [
{
monitor = "";
text = "cmd[update:30000] echo \"$(date +\"%R\")\"";
color = "0xff${background}";
font_size = 90;
font_family = font;
position = "-30, 0";
halign = "right";
valign = "top";
}
{
monitor = "";
text = "cmd[update:43200000] echo \"$(date +\"%A,%e %B %Y\")\"";
color = "0xff${background}";
font_size = 25;
font_family = font;
position = "-30, -150";
halign = "right";
valign = "top";
}
];
image = [
{
monitor = "";
path = "${./pfp/personal.png}";
size = 100;
border_color = "0xff${accent}";
position = "0, 75";
halign = "center";
valign = "center";
}
];
input-field = [
{
monitor = "";
size = "300, 60";
outline_thickness = 2;
dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.2; # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true;
outer_color = "0xff${accent}";
inner_color = "0xff${background}";
font_color = "0xff${foreground}";
fade_on_empty = false;
placeholder_text = "<span foreground=\"##${foreground}\">󰌾 Logged in as <span foreground=\"##${accent}\">$USER</span></span>";
hide_input = false;
position = "0, -50";
halign = "center";
valign = "center";
}
];
};
};
};
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd.enable = true;
settings = {
monitor = [ ",preferred,auto,auto" ];
env = [
"XDG_CURRENT_DESKTOP=Hyprland"
"XDG_SESSION_DESKTOP=Hyprland"
"GDK_BACKEND=wayland,x11"
"QT_AUTO_SCREEN_SCALE_FACTOR,1"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"GRIM_DEFAULT_DIR,${config.xdg.userDirs.pictures}/Screenshots"
];
exec-once = [
"systemctl --user import-environment WAYLAND_DISPLAY QT_QPA_PLATFORMTHEME"
"${config.wayland.windowManager.hyprland.finalPackage}/bin/hyprctl setcursor ${config.gtk.cursorTheme.name} ${toString config.gtk.cursorTheme.size}"
"${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
"PASSWORD_STORE_DIR=/dev/null ${pkgs.protonmail-bridge}/bin/protonmail-bridge -n"
"${pkgs.dex}/bin/dex -a"
# "systemctl --user start hyprland-session.target"
# "systemctl --user start hyprpaper.service"
];
gestures.workspace_swipe = true;
input = {
kb_layout = "gb";
kb_options = "ctrl:nocaps";
follow_mouse = 1;
touchpad.natural_scroll = "yes";
};
dwindle = {
force_split = 2;
preserve_split = false;
smart_split = false;
smart_resizing = false;
special_scale_factor = 0.95;
no_gaps_when_only = 0;
use_active_for_splits = true;
default_split_ratio = 1.0;
};
master = {
allow_small_split = true;
special_scale_factor = 0.95;
mfact = 0.5;
# new_is_master = false;
new_on_top = false;
no_gaps_when_only = 0;
orientation = "left";
inherit_fullscreen = false;
smart_resizing = false;
drop_at_cursor = true;
};
general = with config.lib.stylix.scheme; {
"col.active_border" = "rgb(${base0E})";
"col.inactive_border" = "rgb(${base04})";
gaps_in = 2.5;
gaps_out = 5;
border_size = 1;
# cursor_inactive_timeout = 0;
layout = "master";
};
decoration = {
rounding = 5;
"col.shadow" = "rgba(${config.lib.stylix.scheme.base00}0d)";
drop_shadow = "yes";
shadow_ignore_window = true;
shadow_range = 4;
shadow_render_power = 3;
blur = {
enabled = true;
size = 5;
passes = 3;
new_optimizations = true;
brightness = 1.0;
noise = 2.0e-2;
};
};
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
misc = {
disable_splash_rendering = true;
disable_autoreload = true;
mouse_move_enables_dpms = true;
key_press_enables_dpms = true;
};
xwayland.force_zero_scaling = true;
layerrule =
let
blur = x: "blur, ^(${x})$";
ignorealpha = x: "ignorealpha 0.3, ^(${x})$";
layers = [
"system-menu"
"gtk-layer-shell"
"notifications"
"launcher"
"logout_dialog"
"waybar"
"avizo"
];
in
(lib.lists.forEach layers blur) ++ (lib.lists.forEach layers ignorealpha);
windowrule = [
# Float + move system windows
"float, org.kde.polkit-kde-authentication-agent-1|Pinentry"
"center, org.kde.polkit-kde-authentication-agent-1|Pinentry"
"pin, org.kde.polkit-kde-authentication-agent-1|Pinentry"
"dimaround, org.kde.polkit-kde-authentication-agent-1|Pinentry"
"stayfocused, org.kde.polkit-kde-authentication-agent-1|Pinentry"
"float, pavucontrol|.blueman-manager-wrapped|nm-connection-editor"
"size 800 600, pavucontrol|.blueman-manager-wrapped|nm-connection-editor"
"move onscreen 100%-820 60,pavucontrol|.blueman-manager-wrapped|nm-connection-editor"
# PrismLauncher / Minecraft
"float, org.prismlauncher.PrismLauncher"
"center, org.prismlauncher.PrismLauncher"
"size 800 600, org.prismlauncher.PrismLauncher"
];
windowrulev2 = [
# Firefox PIP
"float, title:Picture-in-Picture|Library,class:firefox"
"size 750 400, title:Picture-in-Picture,class:firefox"
"size 800 800, title:Library,class:firefox"
"move onscreen 100%-775 100%-425, title:Picture-in-Picture,class:firefox"
"center, title:Library,class:firefox"
"pin, title:Picture-in-Picture,class:firefox"
# Thunar extra windows
"float, title:File Operation Progress,class:thunar"
"size 800 600, title:File Operation Progress,class:thunar"
"center, title:File Operation Progress,class:thunar"
# LibreOffice
# "nofullscreenrequest, class:(libreoffice|soffice)(.*)"
# "nomaximizerequest, class:(libreoffice|soffice)(.*)"
"float, title:Open,class:(libreoffice|soffice)(.*)"
# Steam
"float, title:Friends List,class:steam"
"size 400 600, title:Friends List,class:steam"
"float, title:(.*)(Chat),class:steam"
"size 800 600, title:(.*)(Chat),class:steam"
"float, title:Steam Settings,class:steam"
"size 800 600, title:Steam Settings,class:steam"
# X2Go / Remmina / NoMachine
# "nofullscreenrequest, class:x2goclient|org.remmina.Remmina|Nxplayer.bin"
# "nomaximizerequest, class:x2goclient|org.remmina.Remmina|Nxplayer.bin"
"float, title:(X2Go Client|Freia|Heimdall), class:x2goclient"
"float, title:Remmina Remote Desktop Client, class:org.remmina.Remmina"
"float, title:(NoMachine)(.*), class:Nxplayer.bin"
"center, title:(X2Go Client|Freia|Heimdall), class:x2goclient"
"center, title:Remmina Remote Desktop Client, class:org.remmina.Remmina"
"center, title:(NoMachine)(.*), class:Nxplayer.bin"
"size 800 600, title:X2Go Client, class:x2goclient"
"size 1920 1080, title:Freia|Heimdall, class:x2goclient"
"size 1920 1080, title:(NoMachine)(.*), class:Nxplayer.bin"
];
bind =
let
withTerm =
{
term ? "alacritty",
package ? config.programs.${term}.package,
progname,
args ? "",
}:
"${package}/bin/${term} -T ${progname} -e ${progname} ${args}";
workspace = w: [
"SUPER, ${toString w}, moveworkspacetomonitor, ${toString w} current"
"SUPER, ${toString w}, workspace, ${toString w}"
"SUPER SHIFT, ${toString w}, movetoworkspace, ${toString w}"
];
in
lib.lists.flatten (lib.lists.forEach (lib.lists.range 1 9) workspace)
++ (
let
btm_args = "--autohide_time --battery --celsius --enable_cache_memory --enable_gpu_memory --group --hide_avg_cpu --hide_table_gap --retention=3m --show_table_scroll_position";
in
[
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Open Hyprland wiki at correct version number
"CTRL_SHIFT, H, exec, xdg-open \"https://wiki.hyprland.org/$(${config.wayland.windowManager.hyprland.finalPackage}/bin/hyprctl version -j | ${pkgs.jq}/bin/jq $args.tag | ${pkgs.gnused}/bin/sed s/v// | ${pkgs.gnused}/bin/sed s/\\\"//g)\""
"SUPER, F1, exec, ${config.programs.hyprlock.package}/bin/hyprlock"
# "SUPER, F1, exec, ${config.programs.swaylock.package}/bin/swaylock --screenshots --clock --indicator --grace-no-mouse"
"SUPER, Q, killactive,"
# "SUPER SHIFT, Q, exec, pkill rofi || ${config.programs.rofi.finalPackage}/bin/rofi -show powermenu -modi powermenu:${pkgs.rofi-power-menu}/bin/rofi-power-menu"
"SUPER, V, togglefloating"
# "SUPER SHIFT, V, setfloating" ## TODO setfloating exists
# in newer version of Hyprland than mine
"SUPER SHIFT, V, moveactive, exact 1% 4%"
"SUPER SHIFT, V, resizeactive, exact 800 600"
"SUPER SHIFT, V, pin"
"SUPER, M, fullscreen, 1" # Maximise window
"SUPER SHIFT, M, fullscreen, 0" # Actual fullscreen
"SUPER, Z, exec, ${config.services.mako.package}/bin/makoctl restore"
"SUPER SHIFT, Z, exec, exec ${config.services.mako.package}/bin/makoctl dismiss -a"
# Common program shortcuts
"SUPER, Return, exec, ${config.programs.alacritty.package}/bin/alacritty"
"SUPER SHIFT, Return, exec, ${config.programs.emacs.finalPackage}/bin/emacsclient -c"
"SUPER, W, exec, ${config.programs.firefox.package}/bin/firefox"
"SUPER, F, exec, ${pkgs.xfce.thunar}/bin/thunar"
# fuzzel binds
"SUPER, Space, exec, ${config.programs.fuzzel.package}/bin/fuzzel"
# "SUPER, Space, exec, pkill rofi || ${config.programs.rofi.finalPackage}/bin/rofi -show drun"
# "SUPER, tab, exec, pkill rofi || ${config.programs.rofi.finalPackage}/bin/rofi -show window"
# "SUPER, A, exec, pkill rofi || ${config.programs.rofi.finalPackage}/bin/rofi -show emoji"
# rofi-pass binds
"SUPER, P, exec, pkill rofi || ${config.programs.rofi.pass.package}/bin/rofi-pass"
"SUPER SHIFT, P, exec, pkill rofi || ${config.programs.rofi.pass.package}/bin/rofi-pass --last-used"
"SUPER ALT, P, exec, pkill rofi || ${config.programs.rofi.pass.package}/bin/rofi-pass --insert"
# Terminal utilities
"SUPER, S, exec, ${
withTerm {
progname = "btm";
args = btm_args;
}
}"
"SUPER SHIFT, S, exec, ${
withTerm {
progname = "btm";
args = btm_args + " --basic";
}
}"
"SUPER, C, exec, ${withTerm { progname = "cava"; }}"
# Misc useful binds
",Print,exec,${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.swappy}/bin/swappy -f -"
# ",XF86Calculator,exec,pkill rofi || ${config.programs.rofi.finalPackage}/bin/rofi -show calc"
# Movement binds
"SUPER, H, movefocus, l"
"SUPER, L, movefocus, r"
"SUPER, K, movefocus, u"
"SUPER, J, movefocus, d"
"SUPER SHIFT, H, movewindow, l"
"SUPER SHIFT, L, movewindow, r"
"SUPER SHIFT, K, movewindow, u"
"SUPER SHIFT, J, movewindow, d"
# Special workspaces
"SUPER, comma, workspace, m-1"
"SUPER SHIFT, comma, movetoworkspace, r-1"
"SUPER, period, workspace, m+1"
"SUPER SHIFT, period, movetoworkspace, r+1"
"SUPER, N, workspace, empty"
"SUPER SHIFT, N, movetoworkspace, empty"
"SUPER, minus, togglespecialworkspace"
"SUPER SHIFT, minus, movetoworkspace, special"
"SUPER, bracketright, focusmonitor, +1"
"SUPER SHIFT, bracketright, movecurrentworkspacetomonitor, +1"
"SUPER, bracketleft, focusmonitor, -1"
"SUPER SHIFT, bracketleft, movecurrentworkspacetomonitor, -1"
"SUPER, O, focusurgentorlast"
]
);
bindl = [
# Sound
",XF86AudioMute,exec,${config.services.avizo.package}/bin/volumectl %"
",XF86AudioMicMute,exec,${config.services.avizo.package}/bin/volumectl -m %"
# Playback
",XF86AudioPlay,exec,${pkgs.playerctl}/bin/playerctl play-pause"
",XF86AudioStop,exec,${pkgs.playerctl}/bin/playerctl play-pause"
",XF86AudioPrev,exec,${pkgs.playerctl}/bin/playerctl previous"
",XF86AudioNext,exec,${pkgs.playerctl}/bin/playerctl next"
];
bindle = [
# Sound
",XF86AudioRaiseVolume,exec,${config.services.avizo.package}/bin/volumectl -u + 5"
",XF86AudioLowerVolume,exec,${config.services.avizo.package}/bin/volumectl -u - 5"
# Brightness
",XF86MonBrightnessUp,exec,${config.services.avizo.package}/bin/lightctl + 5"
",XF86MonBrightnessDown,exec,${config.services.avizo.package}/bin/lightctl - 5"
];
bindm = [
# Move/resize windows with mainMod + LMB/RMB and dragging
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
};
};
xdg.configFile."hypr/hyprpaper.conf".text = ''
preload = ${config.stylix.image}
wallpaper = ,${config.stylix.image}
'';
}

View file

@ -0,0 +1,17 @@
{ config, ... }:
{
services.mako = {
enable = true;
anchor = "top-right";
width = 600;
height = 600;
layer = "top";
markup = true;
maxVisible = 10;
icons = true;
iconPath = with config.gtk.iconTheme; "${package}/share/icons/${name}";
borderRadius = 5;
borderSize = 1;
defaultTimeout = 0;
};
}

View file

@ -39,7 +39,9 @@ in
"application/x-yaml" = emacs;
"application/msword" = [ "writer.desktop" ];
"application/zip" = [ "xarchiver.desktop" ];
"application/x-archive" = [ "xarchiver.desktop" ];
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;

View file

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 178 KiB

View file

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View file

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -7,12 +7,15 @@
{
stylix.targets.kde.enable = false;
imports = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];
home.packages = with pkgs; [
protonmail-bridge-gui
libreoffice-qt-fresh
rc2nix
wl-clipboard
];
home = {
packages = with pkgs; [
protonmail-bridge-gui
libreoffice-qt-fresh
rc2nix
wl-clipboard
];
file.${config.gtk.gtk2.configLocation}.force = true; # Stop clashing with KDE
};
services.gpg-agent.pinentryPackage = pkgs.pinentry-qt;
programs.plasma = {
enable = true;

View file

@ -0,0 +1,202 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [
./waybar.nix
./fuzzel.nix
./mako.nix
];
stylix.targets.swaylock.useImage = false; # Using swaylock-effects instead
home.packages = with pkgs; [
libreoffice-fresh
ffmpeg
grim
slurp
swappy
wl-clipboard
swayimg
swaybg
(writeShellScriptBin "swaylockfx" ''
${swaylock-effects}/bin/swaylock --screenshots --clock --indicator --effect-blur 7x5 --effect-vignette 0.5:0.5
'')
(writeShellScriptBin "protonmail-setup-bridge" ''
pkill -9 -f protonmail-bridge
${protonmail-bridge}/bin/protonmail-bridge -c
swaymsg exec "${protonmail-bridge}/bin/protonmail-bridge -n"
'')
];
programs = {
waybar.systemd.target = "sway-session.target";
swaylock = {
enable = true;
package = pkgs.swaylock-effects;
};
};
services = {
kanshi.systemdTarget = "sway-session.target";
gpg-agent.pinentryPackage = pkgs.pinentry-gnome3;
avizo = {
enable = true;
settings.default.image-opacity = lib.mkForce "1.0";
};
kdeconnect = {
enable = true;
indicator = true;
};
swayidle = {
enable = true;
timeouts = [
{
timeout = 60 * 15; # 15 minutes
command = "swaylockfx";
}
];
};
udiskie = {
enable = true;
notify = true;
automount = true;
tray = "never";
};
};
wayland.windowManager.sway = {
enable = true;
package = pkgs.swayfx.overrideAttrs (old: {
passthru.providedSessions = [ "sway" ];
});
swaynag.enable = true;
systemd.enable = true;
xwayland = true;
checkConfig = false;
config = {
input = {
"*" = {
xkb_layout = "gb";
xkb_options = "ctrl:nocaps";
};
"type:touchpad" = {
tap = "enabled";
natural_scroll = "enabled";
};
};
seat = {
"seat0" = {
xcursor_theme = "${config.gtk.cursorTheme.name} ${toString config.gtk.cursorTheme.size}";
};
};
modifier = "Mod4";
terminal = "${config.programs.alacritty.package}/bin/alacritty";
menu = "${config.programs.fuzzel.package}/bin/fuzzel";
workspaceAutoBackAndForth = true;
bars = [ ];
gaps = {
inner = 5;
outer = 0;
};
startup = [
{ command = "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"; }
{ command = "${pkgs.protonmail-bridge}/bin/protonmail-bridge -n"; }
{ command = "${pkgs.dex}/bin/dex -a"; }
{ command = "${config.services.mako.package}/bin/mako"; }
];
window = {
border = 1;
titlebar = false;
commands = [
{
criteria.window_role = "(?:pop-up|bubble|dialog)";
command = "floating enable";
}
{
criteria.app_id = "(?:org\.kde\.polkit-kde-authentication-agent-1|Pinentry|pavucontrol|\.blueman-manager-wrapped|nm-connection-editor)";
command = "floating enable";
}
{
criteria.class = "(?:[Mm]atplotlib|.*\.py|Idl)";
command = "floating enable";
}
{
# Catch-all for file dialog windows
criteria.title = "(?:Open|Save) (?:File|Folder|As)";
command = "floating enable, resize set width 1030 height 710";
}
{
# Inhibit idle when watching vidoes
criteria.app_id = "(?:firefox|mpv)";
command = "inhibit_idle fullscreen";
}
{
# Window rules for game sessions.
# Note: controllers don't reset idle timer
criteria.class = "(?:steam_app|Minecraft).*";
command = "floating enable, fullscreen enable, inhibit_idle focus";
}
];
};
floating.border = 1;
keybindings =
let
modifier = config.wayland.windowManager.sway.config.modifier;
in
lib.mkOptionDefault {
# Movement
"${modifier}+comma" = "workspace prev";
"${modifier}+period" = "workspace next";
"${modifier}+shift+comma" = "move workspace prev";
"${modifier}+shift+period" = "move workspace next";
"${modifier}+bracketleft" = "move workspace to output left";
"${modifier}+bracketright" = "move workspace to output right";
# Function keys
## Screenshot
"Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.swappy}/bin/swappy -f -";
## Sound
"XF86AudioMute" = "exec ${config.services.avizo.package}/bin/volumectl %";
"XF86AudioMicMute" = "exec ${config.services.avizo.package}/bin/volumectl -m %";
"XF86AudioRaiseVolume" = "exec ${config.services.avizo.package}/bin/volumectl -u + 5";
"XF86AudioLowerVolume" = "exec ${config.services.avizo.package}/bin/volumectl -u - 5";
## Playback
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioStop" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
## Brightness
"XF86MonBrightnessUp" = "exec ${config.services.avizo.package}/bin/lightctl + 5";
"XF86MonBrightnessDown" = "exec ${config.services.avizo.package}/bin/lightctl - 5";
# System utilities
"Mod4+Mod1+l" = "exec swaylockfx";
"${modifier}+z" = "exec ${config.services.mako.package}/bin/makoctl restore";
"${modifier}+Shift+z" = "exec ${config.services.mako.package}/bin/makoctl dismiss -a";
"${modifier}+Shift+Return" = "exec ${config.programs.emacs.finalPackage}/bin/emacsclient -c";
};
};
extraConfig = ''
bindgesture swipe:right workspace prev
bindgesture swipe:left workspace next
corner_radius 5
blur enable
blur_xray disable
blur_passes 3
blur_radius 5
shadows enable
shadow_blur_radius 5
layer_effects "system-menu" blur enable; blur_ignore_transparent enable; shadows enable
layer_effects "gtk-layer-shell" blur enable; blur_ignore_transparent enable; shadows enable
layer_effects "notifications" blur enable; blur_ignore_transparent enable; shadows enable
layer_effects "launcher" blur enable; blur_ignore_transparent enable; shadows enable
layer_effects "logout_dialog" blur enable; blur_ignore_transparent enable; shadows enable
layer_effects "waybar" blur enable; blur_ignore_transparent enable; shadows enable
layer_effects "avizo" blur enable; blur_ignore_transparent enable; shadows enable
titlebar_separator enable
'';
};
xdg.configFile."swappy/config".source = ./swappy.conf;
}

View file

Before

Width:  |  Height:  |  Size: 562 KiB

After

Width:  |  Height:  |  Size: 562 KiB

View file

Before

Width:  |  Height:  |  Size: 642 KiB

After

Width:  |  Height:  |  Size: 642 KiB

View file

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View file

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View file

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 140 KiB

View file

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

View file

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 125 KiB

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 146 KiB

View file

Before

Width:  |  Height:  |  Size: 167 KiB

After

Width:  |  Height:  |  Size: 167 KiB

View file

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View file

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

Before

Width:  |  Height:  |  Size: 14 MiB

After

Width:  |  Height:  |  Size: 14 MiB

View file

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 183 KiB

View file

Before

Width:  |  Height:  |  Size: 528 KiB

After

Width:  |  Height:  |  Size: 528 KiB

View file

Before

Width:  |  Height:  |  Size: 27 MiB

After

Width:  |  Height:  |  Size: 27 MiB

View file

Before

Width:  |  Height:  |  Size: 20 MiB

After

Width:  |  Height:  |  Size: 20 MiB

View file

Before

Width:  |  Height:  |  Size: 286 KiB

After

Width:  |  Height:  |  Size: 286 KiB

View file

Before

Width:  |  Height:  |  Size: 747 KiB

After

Width:  |  Height:  |  Size: 747 KiB

View file

Before

Width:  |  Height:  |  Size: 7 MiB

After

Width:  |  Height:  |  Size: 7 MiB

View file

Before

Width:  |  Height:  |  Size: 5.3 MiB

After

Width:  |  Height:  |  Size: 5.3 MiB

View file

Before

Width:  |  Height:  |  Size: 7.8 MiB

After

Width:  |  Height:  |  Size: 7.8 MiB

View file

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

View file

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 4.3 MiB

View file

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 3.7 MiB

View file

Before

Width:  |  Height:  |  Size: 1,000 KiB

After

Width:  |  Height:  |  Size: 1,000 KiB

View file

Before

Width:  |  Height:  |  Size: 3.9 MiB

After

Width:  |  Height:  |  Size: 3.9 MiB

View file

Before

Width:  |  Height:  |  Size: 4.8 MiB

After

Width:  |  Height:  |  Size: 4.8 MiB

View file

Before

Width:  |  Height:  |  Size: 4 MiB

After

Width:  |  Height:  |  Size: 4 MiB

View file

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 4.3 MiB

View file

Before

Width:  |  Height:  |  Size: 4 MiB

After

Width:  |  Height:  |  Size: 4 MiB

View file

Before

Width:  |  Height:  |  Size: 5.1 MiB

After

Width:  |  Height:  |  Size: 5.1 MiB

View file

Before

Width:  |  Height:  |  Size: 252 KiB

After

Width:  |  Height:  |  Size: 252 KiB

View file

Before

Width:  |  Height:  |  Size: 254 KiB

After

Width:  |  Height:  |  Size: 254 KiB

View file

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 250 KiB

View file

Before

Width:  |  Height:  |  Size: 255 KiB

After

Width:  |  Height:  |  Size: 255 KiB

View file

Before

Width:  |  Height:  |  Size: 252 KiB

After

Width:  |  Height:  |  Size: 252 KiB

View file

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 249 KiB

View file

Before

Width:  |  Height:  |  Size: 253 KiB

After

Width:  |  Height:  |  Size: 253 KiB

View file

Before

Width:  |  Height:  |  Size: 254 KiB

After

Width:  |  Height:  |  Size: 254 KiB

View file

Before

Width:  |  Height:  |  Size: 247 KiB

After

Width:  |  Height:  |  Size: 247 KiB

View file

Before

Width:  |  Height:  |  Size: 255 KiB

After

Width:  |  Height:  |  Size: 255 KiB

View file

Before

Width:  |  Height:  |  Size: 253 KiB

After

Width:  |  Height:  |  Size: 253 KiB

View file

Before

Width:  |  Height:  |  Size: 254 KiB

After

Width:  |  Height:  |  Size: 254 KiB

View file

Before

Width:  |  Height:  |  Size: 253 KiB

After

Width:  |  Height:  |  Size: 253 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View file

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View file

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View file

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View file

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View file

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Some files were not shown because too many files have changed in this diff Show more