2022-07-15 13:11:54 +02:00
|
|
|
{ config
|
|
|
|
, lib
|
|
|
|
, pkgs
|
|
|
|
, ...
|
|
|
|
}:
|
2022-04-05 11:09:37 +02:00
|
|
|
|
|
|
|
with lib;
|
2022-07-15 13:11:54 +02:00
|
|
|
let
|
|
|
|
cfg = config.my.programs.sway;
|
|
|
|
in
|
|
|
|
{
|
2022-10-15 20:00:09 +02:00
|
|
|
options.my.programs.sway.enable = mkEnableOption "sway";
|
2022-07-15 13:11:54 +02:00
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2022-04-05 11:09:37 +02:00
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
|
|
|
driSupport = true;
|
|
|
|
};
|
2022-04-05 11:10:55 +02:00
|
|
|
environment.loginShellInit = ''
|
|
|
|
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
|
|
|
|
exec sway
|
|
|
|
fi
|
|
|
|
'';
|
2022-04-05 11:09:37 +02:00
|
|
|
home-manager.users.moritz = {
|
2022-04-05 11:10:55 +02:00
|
|
|
home.packages = with pkgs; [ wl-clipboard wofi waybar feh ];
|
|
|
|
programs.waybar = {
|
|
|
|
enable = true;
|
|
|
|
systemd.enable = true;
|
|
|
|
settings = {
|
|
|
|
mainBar = {
|
|
|
|
layer = "top";
|
|
|
|
position = "top";
|
|
|
|
height = 30;
|
|
|
|
output = [ "eDP-1" "HDMI-A-1" ];
|
|
|
|
modules-left = [ "sway/workspaces" "sway/mode" "wlr/taskbar" ];
|
|
|
|
modules-center = [ "sway/window" "custom/hello-from-waybar" ];
|
2022-07-15 13:11:54 +02:00
|
|
|
modules-right = [ "mpd" "custom/mymodule#with-css-id" "temperature" ];
|
2022-04-05 11:10:55 +02:00
|
|
|
"sway/workspaces" = { all-outputs = true; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-04-05 11:09:37 +02:00
|
|
|
wayland.windowManager.sway = {
|
|
|
|
enable = true;
|
2022-04-05 11:10:55 +02:00
|
|
|
config = {
|
|
|
|
input = {
|
|
|
|
"*" = { xkb_layout = "de"; };
|
|
|
|
"type:touchpad" = {
|
|
|
|
natural_scroll = "enabled";
|
|
|
|
middle_emulation = "enabled";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
terminal = "kitty";
|
|
|
|
menu = "wofi --show drun";
|
|
|
|
modifier = "Mod4";
|
|
|
|
gaps = {
|
|
|
|
inner = 5;
|
|
|
|
outer = 3;
|
|
|
|
smartBorders = "on";
|
|
|
|
};
|
|
|
|
bars = [ ];
|
2022-07-15 13:11:54 +02:00
|
|
|
keybindings = lib.mkOptionDefault {
|
|
|
|
inherit
|
|
|
|
(config.home-manager.users.moritz.wayland.windowManager.sway.config)
|
|
|
|
modifier
|
|
|
|
;
|
2022-04-05 11:10:55 +02:00
|
|
|
"${modifier}+f" = "firefox";
|
|
|
|
"${modifier}+e" = "emacsclient -c -a emacs";
|
|
|
|
};
|
|
|
|
startup = [
|
|
|
|
{
|
|
|
|
command = "systemctl --user restart waybar";
|
|
|
|
always = true;
|
|
|
|
}
|
|
|
|
{ command = "synology-drive"; }
|
|
|
|
{ command = "randomWallpaper"; }
|
|
|
|
];
|
|
|
|
};
|
2022-04-05 11:09:37 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|