serious sway rice

This commit is contained in:
alisceon 2025-12-02 19:21:57 +01:00
parent 62ae2dd283
commit 57095fae31
6 changed files with 208 additions and 91 deletions

View file

@ -72,20 +72,111 @@
# other
display = status: "swaymsg 'output * power ${status}'";
hostnameOutput =
if hostName == "tower" then {
# Left monitor
DP-1 = {
mode = "1920x1080@143.981Hz";
transform = "90";
position = "0 0";
};
# Main monitor
DP-2 = {
mode = "3440x1440@99.982Hz";
position = "1080 250";
};
# Right monitor
DP-3 = {
mode = "1920x1080@143.981Hz";
position = "4520 250";
};
}
else if hostName == "electra" then {}
else {};
hostnameWorkspaceAssign =
if hostName == "tower" then [
{ output = "DP-2"; workspace = "1"; }
{ output = "DP-3"; workspace = "2"; }
{ output = "DP-1"; workspace = "3"; }
{ output = "DP-2"; workspace = "4"; }
{ output = "DP-3"; workspace = "5"; }
{ output = "DP-1"; workspace = "6"; }
{ output = "DP-2"; workspace = "7"; }
{ output = "DP-3"; workspace = "8"; }
{ output = "DP-1"; workspace = "9"; }
]
else if hostName == "electra" then []
else [];
hostnameServices =
if hostName == "tower" then {}
else if hostName == "electra" then {
swayidle = {
enable = true;
timeouts = [
{
timeout = 120;
command = "${pkgs.libnotify}/bin/notify-send 'Locking in 5 seconds' -t 5000";
}
{
timeout = 125;
command = lock;
}
{
timeout = 125;
command = display "off";
resumeCommand = display "on";
}
{
timeout = 600;
command = "${pkgs.systemd}/bin/systemctl suspend";
}
]; # end timeouts
events = [
{
event = "before-sleep";
command = "display off; systemctl --user stop libinput-gestures" + lock;
}
{
event = "after-resume";
command = "display on; systemctl --user start libinput-gestures";
}
{
event = "lock";
command = (display "off") + "; " + lock;
}
{
event = "unlock";
command = display "on";
}
]; # end events
}; # end swayidle
}
else {};
in
{
wayland.windowManager.sway = {
enable = true;
wrapperFeatures.gtk = true; # Fixes common issues with GTK 3 apps
systemd = {
xdgAutostart = true;
variables = [
"--all"
];
};
extraSessionCommands = ''
export XDG_CURRENT_DESKTOP=GNOME:sway
'';
config = {
modifier = "${key_mod}";
startup = [
{ command = "systemctl --user start libinput-gestures"; always = true; }
{ command = "dbus-update-activation-environment --systemd --all"; always = true; }
{ command = "systemctl --user start libinput-gestures"; }
#{ command = "firefox";}
#{ command = "discord";}
];
bars = [
{ command = "${pkgs.waybar}/bin/waybar"; }
];
bars = [{
command = "${pkgs.waybar}/bin/waybar";
}];
fonts = {
names = ["${style_font}"];
size = style_font_sz;
@ -112,15 +203,6 @@
"${key_mod}+d" = "exec ${dmenu}";
"${key_mod}+Shift+q" = "kill";
"${key_mod}+L" = "exec ${lock}";
#Screenshot region
"${key_mod}+Shift+s" = ''
bash -c '\
${pkgs.slurp}/bin/slurp | \
${pkgs.grim}/bin/grim -g - \
~/Pictures/Screenshots_${hostName}/$(date +"%Y-%m-%d-%H%M%S.png") | \
${pkgs.wl-clipboard}/bin/wl-copy -t image/png \
'
'';
# Workspaces
"${key_mod}+f" = "fullscreen";
"${key_mod}+space" = "floating toggle";
@ -175,6 +257,9 @@
"${key_mod}+Shift+${key_right}" = "move right";
# System
#Screenshot region
"${key_mod}+Shift+s" = "exec grimshot savecopy area";
"Print" = "exec grimshot savecopy output";
"XF86AudioRaiseVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ +3%'";
"XF86AudioLowerVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ -3%'";
"XF86AudioMute" = "exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle'";
@ -222,49 +307,17 @@
childBorder = color_dark_3;
};
}; # end colors
assigns = {
"1" = [{app_id = "firefox";}];
"2" = [{class = "Code";}];
"3" = [{class = "discord";}];
};
output = {} // hostnameOutput;
workspaceOutputAssign = hostnameWorkspaceAssign;
};
};
services = {
swayidle = {
enable = true;
timeouts = [
{
timeout = 120;
command = "${pkgs.libnotify}/bin/notify-send 'Locking in 5 seconds' -t 5000";
}
{
timeout = 125;
command = lock;
}
{
timeout = 125;
command = display "off";
resumeCommand = display "on";
}
{
timeout = 600;
command = "${pkgs.systemd}/bin/systemctl suspend";
}
]; # end timeouts
events = [
{
event = "before-sleep";
command = "display off; systemctl --user stop libinput-gestures" + lock;
}
{
event = "after-resume";
command = "display on; systemctl --user start libinput-gestures";
}
{
event = "lock";
command = (display "off") + "; " + lock;
}
{
event = "unlock";
command = display "on";
}
]; # end events
}; # end swayidle
mako = {
enable = true;
settings = {
@ -287,7 +340,15 @@
markup = true;
}; #end settings
}; # end mako
}; # end services
gnome-keyring = {
enable = true;
components = [
"ssh"
"pkcs11"
"secrets"
];
};
} // hostnameServices; # end services
programs = {
rofi = {
enable = true;
@ -374,16 +435,16 @@
spacing = 0;
modules-left = [
"sway/workspaces"
"sway/window"
];
modules-center = [
"clock"
"sway/window"
];
modules-right = [
"tray"
"network"
"pulseaudio"
"battery"
"tray"
"clock"
];
"sway/workspaces" = {
on-click = "activate";
@ -399,9 +460,9 @@
};
"clock" = {
interval = 60;
tooltip = false;
format = "{:%R}";
format-alt = "{:%a, %Y-%m-%d}";
tooltip = true;
format = "| {:%Y-%m-%d %R} ";
tooltip-format = "{:%A}";
};
"battery" = {
states = {
@ -412,23 +473,23 @@
over = 101;
};
interval = 30;
format = "Bat {capacity}%";
format-charging = "Bat {capacity}%";
format-plugged = "Bat {capacity}%";
format = "| Bat {capacity}% ";
format-charging = "| Chr {capacity}% ";
format-plugged = "| Plg {capacity}% ";
};
"network" = {
format-wifi = "WiFi up";
format-ethernet = "eth up";
format-wifi = "| WiFi up ";
format-ethernet = "";
tooltip-format = "{ifname} = {ipaddr}/{cidr}";
format-linked = "{ifname} (no ip)";
format-disconnected = "No network";
format-alt = "{essid}: {ipaddr}";
format-linked = "| {ifname} (no ip) ";
format-disconnected = "| Disconnected ";
format-alt = "| {essid}: {ipaddr} ";
interval = 10;
};
"pulseaudio" = {
# "scroll-step" = 1; # %; can be a float
format = "Sound: {volume}%";
format-muted = "Sound Muted";
format = "| Sound: {volume}% ";
format-muted = "| Sound: x% ";
};
}; # end mainbar
}; # end settings