Change sway config
This commit is contained in:
@@ -10,5 +10,7 @@
|
||||
./direnv.nix
|
||||
./git.nix
|
||||
./qt.nix
|
||||
./sway.nix
|
||||
./gtk.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,24 +1,16 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, systemConfig
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib; let
|
||||
cfg = config.simmer.gtk;
|
||||
gui = config.simmer.gui;
|
||||
gui = systemConfig.gui;
|
||||
in
|
||||
{
|
||||
options.simmer.gtk = {
|
||||
theme.enable = mkOption {
|
||||
description = "Whether to enable gtk themes";
|
||||
type = types.bool;
|
||||
default = gui.enable;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
gtk = mkIf cfg.enable {
|
||||
gtk = mkIf gui.enable {
|
||||
enable = true;
|
||||
cursorTheme = {
|
||||
name = "phinger-cursors-dark";
|
||||
|
||||
230
modules/home/sway.nix
Normal file
230
modules/home/sway.nix
Normal file
@@ -0,0 +1,230 @@
|
||||
{ lib
|
||||
, pkgs
|
||||
, config
|
||||
, systemConfig
|
||||
, utils
|
||||
, ...
|
||||
}:
|
||||
|
||||
with lib; let
|
||||
cfg = config.simmer.sway;
|
||||
gui = systemConfig.gui;
|
||||
modifier = "Mod4";
|
||||
in
|
||||
{
|
||||
options.simmer.sway = {
|
||||
enable = mkOption {
|
||||
description = "Whether to install and set sway as window manager";
|
||||
type = types.bool;
|
||||
default = gui.enable;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
checkConfig = false;
|
||||
|
||||
config = {
|
||||
modifier = modifier;
|
||||
keybindings = {
|
||||
"XF86AudioRaiseVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||
"XF86AudioLowerVolume" = "exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||
"XF86AudioMute" = "exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||
"XF86AudioMicMute" = "exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||
"XF86AudioPause" = "exec playerctl play-pause";
|
||||
"XF86AudioNext" = "exec playerctl next";
|
||||
"XF86AudioPrev" = "exec playerctl previous";
|
||||
"${modifier}+Return" = "exec alacritty ";
|
||||
"${modifier}+Control+f" = "exec MOZ_ENABLE_WAYLAND=1 firefox";
|
||||
"${modifier}+Control+s" = "exec steam";
|
||||
"${modifier}+Control+t" = "exec thunar";
|
||||
"${modifier}+Control+d" = "exec vesktop --enable-features=WebRTCPipeWireCapturer";
|
||||
"${modifier}+Control+x" = "exec feishin";
|
||||
"${modifier}+Control+h" = "exec helvum";
|
||||
"${modifier}+Control+p" = "exec pavucontrol";
|
||||
"${modifier}+Shift+s" = "exec grip -g $(slurp)";
|
||||
"${modifier}+Shift+q" = "kill";
|
||||
"${modifier}+h" = "focus left";
|
||||
"${modifier}+j" = "focus down";
|
||||
"${modifier}+k" = "focus up";
|
||||
"${modifier}+l" = "focus right";
|
||||
"${modifier}+Left" = "focus left";
|
||||
"${modifier}+Down" = "focus down";
|
||||
"${modifier}+Up" = "focus up";
|
||||
"${modifier}+Right" = "focus right";
|
||||
"${modifier}+Shift+h" = "move left";
|
||||
"${modifier}+Shift+j" = "move down";
|
||||
"${modifier}+Shift+k" = "move up";
|
||||
"${modifier}+Shift+l" = "move right";
|
||||
"${modifier}+Shift+Left" = "move left";
|
||||
"${modifier}+Shift+Down" = "move down";
|
||||
"${modifier}+Shift+Up" = "move up";
|
||||
"${modifier}+Shift+Right" = "move right";
|
||||
"${modifier}+b" = "split h";
|
||||
"${modifier}+v" = "split v";
|
||||
"${modifier}+f" = "fullscreen toggle";
|
||||
"${modifier}+s" = "layout stacking";
|
||||
"${modifier}+w" = "layout tabbed";
|
||||
"${modifier}+e" = "layout toggle split";
|
||||
"${modifier}+Shift+space" = "floating toggle";
|
||||
"${modifier}+a" = "focus parent";
|
||||
"${modifier}+1" = "workspace 1 ";
|
||||
"${modifier}+2" = "workspace 2";
|
||||
"${modifier}+3" = "workspace 3";
|
||||
"${modifier}+4" = "workspace 4";
|
||||
"${modifier}+5" = "workspace 5";
|
||||
"${modifier}+6" = "workspace 6";
|
||||
"${modifier}+7" = "workspace 7";
|
||||
"${modifier}+8" = "workspace 8";
|
||||
"${modifier}+9" = "workspace 9";
|
||||
"${modifier}+0" = "workspace 10";
|
||||
"${modifier}+Shift+1" = "move container to workspace 1";
|
||||
"${modifier}+Shift+2" = "move container to workspace 2";
|
||||
"${modifier}+Shift+3" = "move container to workspace 3";
|
||||
"${modifier}+Shift+4" = "move container to workspace 4";
|
||||
"${modifier}+Shift+5" = "move container to workspace 5";
|
||||
"${modifier}+Shift+6" = "move container to workspace 6";
|
||||
"${modifier}+Shift+7" = "move container to workspace 7";
|
||||
"${modifier}+Shift+8" = "move container to workspace 8";
|
||||
"${modifier}+Shift+9" = "move container to workspace 9";
|
||||
"${modifier}+Shift+0" = "move container to workspace 10";
|
||||
"${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'";
|
||||
"${modifier}+Shift+c" = "reload";
|
||||
"${modifier}+r" = "mode 'resize'";
|
||||
};
|
||||
|
||||
startup = [
|
||||
{ command = "--no-startup-id swayidle -w timeout 600 'swaymsg \"output * dpms off\"' resume 'swaymsg \"output * dpms on\"'"; }
|
||||
]
|
||||
++ optionals gui.sway.desktop [
|
||||
{ command = "vorta"; }
|
||||
{ command = "MOZ_ENABLE_WAYLAND=1 firefox"; }
|
||||
{ command = "sleep 20 && vesktop --enable-features=WebRTCPipeWireCapturer"; }
|
||||
{ command = "--no-startup-id openrgb --startminimized"; }
|
||||
{ command = "--no-startup-id easyeffects --gapplication-service"; }
|
||||
{ command = "--no-startup-id wayland-pipewire-idle-inhibit"; }
|
||||
{ command = "--no-startup-id protonmail-bridge --noninteractive"; }
|
||||
];
|
||||
|
||||
workspaceOutputAssign = mkIf gui.sway.desktop [
|
||||
{workspace = "1"; output = "DP-2"; }
|
||||
{workspace = "2"; output = "DP-2"; }
|
||||
{workspace = "3"; output = "DP-2"; }
|
||||
{workspace = "4"; output = "HDMI-A-1"; }
|
||||
{workspace = "5"; output = "HDMI-A-1"; }
|
||||
{workspace = "6"; output = "HDMI-A-1"; }
|
||||
{workspace = "7"; output = "HDMI-A-1"; }
|
||||
{workspace = "8"; output = "HDMI-A-1"; }
|
||||
{workspace = "9"; output = "HDMI-A-1"; }
|
||||
{workspace = "10"; output = "HDMI-A-1"; }
|
||||
];
|
||||
|
||||
assigns = mkIf gui.sway.desktop {
|
||||
"1" = [];
|
||||
|
||||
"2" = [
|
||||
{app_id="mpv"; }
|
||||
];
|
||||
|
||||
"3" = [
|
||||
{class="steam"; }
|
||||
{class="gamescope"; }
|
||||
{app_id="gamescope"; }
|
||||
];
|
||||
|
||||
"4" = [
|
||||
{app_id="firefox"; }
|
||||
];
|
||||
|
||||
"5" = [
|
||||
{app_id="de.shorsh.discord-screenaudio"; }
|
||||
{class="discord"; }
|
||||
{class="vesktop"; }
|
||||
];
|
||||
|
||||
"6" = [
|
||||
{app_id="com.obsproject.Studio"; }
|
||||
];
|
||||
|
||||
"7" = [
|
||||
{app_id="org.strawberrymusicplayer.strawberry"; }
|
||||
];
|
||||
|
||||
"8" = [
|
||||
{app_id="com.github.wwmm.easyeffects"; }
|
||||
{app_id="org.pipewire.Helvum"; }
|
||||
{app_id="pavucontrol"; }
|
||||
];
|
||||
|
||||
"9" = [];
|
||||
|
||||
"0" = [
|
||||
{app_id="python3"; }
|
||||
{class="steam_proton"; }
|
||||
];
|
||||
};
|
||||
|
||||
input."type:keyboard" = {
|
||||
xkb_layout = "us,de";
|
||||
xkb_options = "caps:escape,grp:shifts_toggle";
|
||||
};
|
||||
|
||||
output = gui.monitors;
|
||||
|
||||
floating = {
|
||||
modifier = modifier;
|
||||
border = 5;
|
||||
};
|
||||
|
||||
window = {
|
||||
border = 5;
|
||||
titlebar = false;
|
||||
commands = [
|
||||
{ criteria = { class = "vesktop"; }; command = "opacity 0.9"; }
|
||||
{ criteria = { app_id = "Alacritty"; }; command = "opacity 0.9"; }
|
||||
{ criteria = { class = "gamescope"; }; command = "fullscreen"; }
|
||||
{ criteria = { app_id = "gamescope"; }; command = "fullscreen"; }
|
||||
{ criteria = { app_id = "mpv"; }; command = "fullscreen"; }
|
||||
];
|
||||
};
|
||||
|
||||
gaps = {
|
||||
inner = 10;
|
||||
outer = -5;
|
||||
smartGaps = true;
|
||||
};
|
||||
|
||||
bars = [
|
||||
{ command = "\${pkgs.waybar}/bin/waybar"; }
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
extraConfig = ''
|
||||
|
||||
bindsym ${modifier}+space exec kickoff-dot-desktop | kickoff --from-stdin --stdout | xargs -d '\n' swaymsg exec
|
||||
|
||||
set $bg-color #58536d
|
||||
set $inactive-bg-color #2f343f
|
||||
set $text-color #f3f4f5
|
||||
set $inactive-text-color #676E7D
|
||||
set $urgent-bg-color #E53935
|
||||
|
||||
# window colors
|
||||
# border background text indicator
|
||||
client.focused $bg-color $bg-color $text-color #4B5177
|
||||
client.unfocused $inactive-bg-color $inactive-bg-color $inactive-text-color #4B5177
|
||||
client.focused_inactive $inactive-bg-color $inactive-bg-color $inactive-text-color #4B5177
|
||||
client.urgent $urgent-bg-color $urgent-bg-color $text-color #4B5177
|
||||
|
||||
smart_gaps inverse_outer
|
||||
|
||||
bar {
|
||||
swaybar_command waybar
|
||||
}
|
||||
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user