migrated sway config to compatible i3 conf

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

194
home.nix
View File

@@ -12,6 +12,7 @@
home.stateVersion = "23.11"; # Please read the comment before changing.
home.packages = with pkgs; [
feh
killall
sshfs
hledger
@@ -71,6 +72,8 @@
libreoffice
borgbackup
gnupg
i3lock-blur
xclip
];
programs.taskwarrior = {
enable = true;
@@ -93,6 +96,7 @@
foreground = "#fc28c3";
background = "#230038";
};
font.size = 9;
};
};
programs.starship = {
@@ -148,12 +152,40 @@
LEDGER_FILE = "$HOME/hledger/hledger.journal";
};
wayland.windowManager.sway.enable = true;
wayland.windowManager.sway.package = pkgs.swayfx;
wayland.windowManager.sway.config = {
# Let Home Manager install and manage itself.
xsession.windowManager.i3.enable = true;
xsession.windowManager.i3.package = pkgs.i3-rounded;
xsession.windowManager.i3.config = {
fonts = {
names = [ "Ubuntu" ];
style = "Regular";
size = 12.0;
};
defaultWorkspace = "workspace 1";
bars = [{
command = "waybar";
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 = {
border = "#ef5ffc";
@@ -162,11 +194,10 @@
indicator = "#2e9ef4";
childBorder = "#ef5ffc";
};
defaultWorkspace = "1";
floating = {
criteria = [
{
app_id = "org.keepassxc.KeePassXC";
class = "org.keepassxc.KeePassXC";
}
];
};
@@ -175,13 +206,6 @@
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;
@@ -194,106 +218,48 @@
"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";
"${modifier}+Control+p" = "exec i3lock -n -c ef5ffc";
};
menu = "dmenu_run";
modifier = "Mod4";
output = {
"*" = {
bg = "~/.config/sway/xenia.png fill";
};
};
window.titlebar = false;
terminal = "alacritty";
window.border = 2;
startup = [
{ command = "feh --bg-scale ~/.config/home-manager/xenia.png"; }
{ command = "keepassxc"; }
];
};
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
xsession.windowManager.i3.extraConfig = ''
'';
# Let Home Manager install and manage itself.
xsession.windowManager.i3 = {
services.redshift = {
enable = true;
package = pkgs.i3-rounded;
config = {
bars = [{
colors = {
activeWorkspace = {
background = "#a15ffc";
border = "#a15ffc";
text = "#333333";
};
background = "#ef5ffc";
inactiveWorkspace = {
background = "#ef5ffc";
border = "#a15ffc";
text = "#333333";
};
# seperator = "#a15fffc";
statusline = "#333333";
};
fonts = {
names = [ "Ubuntu Mono" ];
size = 13.0;
};
mode = "dock";
position = "top";
}];
colors.focused = {
border = "#ef5ffc";
background = "#ef5ffc";
text = "#333333";
indicator = "#2e9ef4";
childBorder = "#ef5ffc";
};
defaultWorkspace = "1";
floating = {
criteria = [
{
class = "org.keepassxc.KeePassXC";
}
];
};
gaps = {
inner = 8;
smartBorders = "on";
smartGaps = true;
};
keybindings =
let
modifier = config.wayland.windowManager.sway.config.modifier;
menu = config.wayland.windowManager.sway.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";
};
modifier = "Mod4";
window.titlebar = false;
terminal = "alacritty";
window.border = 2;
};
extraConfig = ''
include ~/.config/sway/device-conf
'';
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;
@@ -386,25 +352,5 @@
};
services.gpg-agent.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;
}
];
};
services.syncthing.enable = true;
}