migrated sway config to compatible i3 conf

This commit is contained in:
2024-02-07 06:03:10 +01:00
parent b54d0b6e5b
commit 308fb250ac

196
home.nix
View File

@@ -12,6 +12,7 @@
home.stateVersion = "23.11"; # Please read the comment before changing. home.stateVersion = "23.11"; # Please read the comment before changing.
home.packages = with pkgs; [ home.packages = with pkgs; [
feh
killall killall
sshfs sshfs
hledger hledger
@@ -71,6 +72,8 @@
libreoffice libreoffice
borgbackup borgbackup
gnupg gnupg
i3lock-blur
xclip
]; ];
programs.taskwarrior = { programs.taskwarrior = {
enable = true; enable = true;
@@ -93,6 +96,7 @@
foreground = "#fc28c3"; foreground = "#fc28c3";
background = "#230038"; background = "#230038";
}; };
font.size = 9;
}; };
}; };
programs.starship = { programs.starship = {
@@ -148,101 +152,40 @@
LEDGER_FILE = "$HOME/hledger/hledger.journal"; LEDGER_FILE = "$HOME/hledger/hledger.journal";
}; };
wayland.windowManager.sway.enable = true;
wayland.windowManager.sway.package = pkgs.swayfx;
wayland.windowManager.sway.config = {
bars = [{
command = "waybar";
position = "top";
}];
colors.focused = {
border = "#ef5ffc";
background = "#ef5ffc";
text = "#333333";
indicator = "#2e9ef4";
childBorder = "#ef5ffc";
};
defaultWorkspace = "1";
floating = {
criteria = [
{
app_id = "org.keepassxc.KeePassXC";
}
];
};
gaps = {
inner = 8;
smartBorders = "on";
smartGaps = true;
};
input = {
"type:keyboard" = {
xkb_layout = "us";
xkb_variant = "altgr-intl";
xkb_options = "caps:escape,compose:102,shift:both_capslock,eurosign:e";
};
};
keybindings =
let
modifier = config.xsession.windowManager.i3.config.modifier;
menu = config.xsession.windowManager.i3.config.menu;
in lib.mkOptionDefault {
"${modifier}+space" = "exec ${menu}";
"${modifier}+Control+Space" = "focus mode_toggle";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
# "XF86Launch1" = "exec ~/scripts/sunset.sh";
# "${modifier}+Control+p" = "exec swaylock -f -c ef5ffc";
};
menu = "dmenu_run";
modifier = "Mod4";
output = {
"*" = {
bg = "~/.config/sway/xenia.png fill";
};
};
window.titlebar = false;
terminal = "alacritty";
window.border = 2;
};
wayland.windowManager.sway.extraConfig = ''
blur enable
blur_xray disable
corner_radius 4
shadows enable
default_dim_inactive 0.1
dim_inactive_colors.unfocused #fc28c3
include ~/.config/sway/device-conf
'';
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
xsession.windowManager.i3 = { xsession.windowManager.i3.enable = true;
enable = true; xsession.windowManager.i3.package = pkgs.i3-rounded;
package = pkgs.i3-rounded;
config = { xsession.windowManager.i3.config = {
bars = [{
colors = {
activeWorkspace = {
background = "#a15ffc";
border = "#a15ffc";
text = "#333333";
};
background = "#ef5ffc";
inactiveWorkspace = {
background = "#ef5ffc";
border = "#a15ffc";
text = "#333333";
};
# seperator = "#a15fffc";
statusline = "#333333";
};
fonts = { fonts = {
names = [ "Ubuntu Mono" ]; names = [ "Ubuntu" ];
size = 13.0; style = "Regular";
size = 12.0;
}; };
mode = "dock"; defaultWorkspace = "workspace 1";
bars = [{
position = "top"; position = "top";
colors.background = "#ef5ffc";
colors.focusedWorkspace = {
text = "#333333";
border = "#ef5ffc";
background = "#a15ffc";
};
colors.inactiveWorkspace = {
text = "#333333";
border = "#ef5ffc";
background = "#ef5ffc";
};
colors.statusline = "#333333";
fonts = {
names = [ "Hack Nerd Font Mono" ];
style = "Bold";
size = 10.0;
};
statusCommand = "i3status";
extraConfig = ''
height 24
'';
}]; }];
colors.focused = { colors.focused = {
border = "#ef5ffc"; border = "#ef5ffc";
@@ -251,7 +194,6 @@
indicator = "#2e9ef4"; indicator = "#2e9ef4";
childBorder = "#ef5ffc"; childBorder = "#ef5ffc";
}; };
defaultWorkspace = "1";
floating = { floating = {
criteria = [ criteria = [
{ {
@@ -266,8 +208,8 @@
}; };
keybindings = keybindings =
let let
modifier = config.wayland.windowManager.sway.config.modifier; modifier = config.xsession.windowManager.i3.config.modifier;
menu = config.wayland.windowManager.sway.config.menu; menu = config.xsession.windowManager.i3.config.menu;
in lib.mkOptionDefault { in lib.mkOptionDefault {
"${modifier}+space" = "exec ${menu}"; "${modifier}+space" = "exec ${menu}";
"${modifier}+Control+Space" = "focus mode_toggle"; "${modifier}+Control+Space" = "focus mode_toggle";
@@ -275,25 +217,49 @@
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; "XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle";
"XF86Launch1" = "exec ~/scripts/sunset.sh"; # "XF86Launch1" = "exec ~/scripts/sunset.sh";
"${modifier}+Control+p" = "exec swaylock -f -c ef5ffc"; "${modifier}+Control+p" = "exec i3lock -n -c ef5ffc";
}; };
menu = "dmenu_run";
modifier = "Mod4"; modifier = "Mod4";
window.titlebar = false; window.titlebar = false;
terminal = "alacritty"; terminal = "alacritty";
window.border = 2; window.border = 2;
startup = [
{ command = "feh --bg-scale ~/.config/home-manager/xenia.png"; }
{ command = "keepassxc"; }
];
}; };
extraConfig = '' xsession.windowManager.i3.extraConfig = ''
include ~/.config/sway/device-conf
''; '';
services.redshift = {
enable = true;
latitude = 49.0;
longitude = 9.0;
tray = true;
};
services.caffeine.enable = true;
services.screen-locker.enable = true;
services.screen-locker.lockCmd = "i3lock -n -c ef5ffc";
programs.i3status = {
enable = true;
enableDefault = false;
general = {
colors = false;
interval = 5;
};
modules = {
"volume master".position = 1;
"wireless wlp2s0".position = 2;
"battery 0".position = 3;
"time" = {
position = 4;
settings = {
format = "%a, %d.%m.%Y - %H:%M";
};
};
};
}; };
programs.home-manager.enable = true; programs.home-manager.enable = true;
@@ -387,24 +353,4 @@
services.gpg-agent.enable = true; services.gpg-agent.enable = true;
services.syncthing.enable = true; services.syncthing.enable = true;
services.swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "/run/current-system/sw/bin/swaylock -f -c ef5ffc";
}
];
timeouts = [
{
command = "/run/current-system/sw/bin/swaylock -f -c ef5ffc";
timeout = 300;
}
{
command = "swaymsg \"output * dpms off\"";
resumeCommand = "swaymsg \"output * dpms on\"";
timeout = 600;
}
];
};
} }