Reorganize files, use less extra options on Sway, move session commands to home-manager

This commit is contained in:
Bun 2025-05-09 17:37:01 -04:00
parent 5cdd7b1de8
commit ee3b40f61f
25 changed files with 64 additions and 107 deletions

View file

@ -39,6 +39,7 @@
{
criteria = config.displays.estradiol2;
position = "1920,0";
scale = 0.85;
}
{
criteria = "eDP-1";

View file

@ -1,9 +1,5 @@
{ config, ... }:
{
imports = [
./makotoggle
];
services.mako = {
enable = config.home.desktop.enable;
borderColor = "#${config.look.colors.accent}";

View file

@ -1,20 +0,0 @@
{ config, pkgs, ... }:
{
home.packages = with pkgs; lib.mkIf config.services.mako.enable [
(pkgs.writeScriptBin "makotoggle" ''
mode_output=$(makoctl mode)
# Extract the second line after "default"
mode_line=$(echo "$mode_output" | sed -n '/default/{n;p}')
if [[ "$mode_line" == "do-not-disturb" ]]; then
makoctl mode -r do-not-disturb
notify-send 'Notifications Enabled'
else
notify-send 'Notifications Disabled'
sleep 2
makoctl mode -a do-not-disturb
fi
'')
];
}

View file

@ -14,7 +14,7 @@
case $POWER in
Shutdown) poweroff;;
Reboot) reboot;;
Lock) swaylock;;
Sleep) systemctl suspend;;
Kill) pkill -9 $XDG_CURRENT_DESKTOP;;
esac
'')

View file

@ -1,53 +1,34 @@
{ config, lib, pkgs, ... }:
let
lockcommand = "${pkgs.swaylock-effects}/bin/swaylock --daemonize";
unlockcommand = "pkill -SIGUSR1 swaylock";
timeoutcommand = "${pkgs.sway}/bin/swaymsg \"output * dpms off\"";
resumecommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\"";
with pkgs; let
lockCommand = "${swaylock-effects}/bin/swaylock --daemonize";
sleepCommand = "${systemd}/bin/systemctl suspend";
in
{
config = lib.mkIf config.home.desktop.enable {
services.swayidle = {
enable = config.home.desktop.enable;
enable = true;
events = [
{
event = "before-sleep";
command = lockcommand;
command = lockCommand;
}
{
event = "lock";
command = lockcommand;
}
{
event = "unlock";
command = unlockcommand;
}
{
event = "after-resume";
command = resumecommand;
command = lockCommand;
}
];
timeouts = [
{
{
timeout = 900; # 15m
command = lockCommand;
}
{
timeout = 1800; # 30m
command = "${pkgs.libnotify}/bin/notify-send \"Locking in 30 seconds\"";
}
{
timeout = 1830;
command = lockcommand;
}
{
timeout = 3600; # 1h
command = timeoutcommand;
resumeCommand = resumecommand;
}
{
timeout = 3605;
command = "${pkgs.systemd}/bin/systemctl suspend";
command = sleepCommand;
}
];
};
home.packages = with pkgs; [ sway-audio-idle-inhibit ];
home.packages = with pkgs; [ wayland-pipewire-idle-inhibit ];
};
}

View file

@ -12,7 +12,7 @@ in {
package = pkgs.swaylock-effects;
settings = {
clock = true;
image = "~/.assets/lockscreen/lock.png";
image = builtins.toString ./lock.png;
font = config.look.fonts.main;
font-size = 30;
timestr = "%I:%M%p";

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

View file

@ -157,14 +157,11 @@
notificationModule = {
exec = pkgs.writeScript "notificationScript" ''
# Run makoctl mode and store the output in a variable
mode_output=$(makoctl mode)
# Extract the second line after "default"
mode_line=$(echo "$mode_output" | sed -n '/default/{n;p}')
mode=$(echo "$(makoctl mode)" | sed -n '/default/{n;p}')
# Print the notification status with the tooltip
if [[ "$mode_line" == "do-not-disturb" ]]; then
if [[ "$mode" == "do-not-disturb" ]]; then
printf '{"text":"󱆥 Off","class":"disabled","tooltip":"Notifications Disabled."}'
else
printf '{"text":" On","tooltip":"Notifications Enabled."}';

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ ... }:
{
wayland.windowManager.sway.config = {
bars = [{ command = "waybar"; }];
@ -10,7 +10,11 @@
{ command = "foot -a sound -T Sound pulsemixer"; }
# Daemons and tray
{ command = "sway-audio-idle-inhibit"; }
{
command = "kanshictl reload";
always = true;
}
{ command = "wayland-pipewire-idle-inhibit"; }
# Foreground
{ command = "thunderbird"; }

View file

@ -1,7 +1,8 @@
{ config, pkgs, ... }:
{ config, ... }:
{
imports = [
./autostart
./extra
./hotkeys
./inputs
./outputs
@ -11,15 +12,12 @@
wayland.windowManager.sway = {
enable = config.home.desktop.enable;
package = null;
wrapperFeatures.gtk = true;
checkConfig = false;
extraConfig = ''
default_floating_border pixel ${config.look.border.string}
hide_edge_borders --i3 smart
titlebar_padding 10 1
primary_selection disabled
mouse_warping container
extraOptions = [ "--unsupported-gpu" ];
extraSessionCommands = ''
export ELECTRON_OZONE_PLATFORM_HINT=wayland
export WLR_RENDERER=vulkan
'';
};
}

View file

@ -0,0 +1,7 @@
{ config, ... }:
{
wayland.windowManager.sway.extraConfig = ''
titlebar_padding 10 1
primary_selection disabled
'';
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, ... }:
{
wayland.windowManager.sway.config = let
# Set default modifier and variables
@ -55,7 +55,7 @@
## Miscellaneous
# Notifications
"${primeMod}+n" = ''exec makotoggle'';
"${primeMod}+n" = ''exec makoctl mode -t do-not-disturb'';
"${primeMod}+Shift+n" = ''exec makoctl restore'';
"${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a'';

View file

@ -1,4 +1,4 @@
{ config, ... }:
{ ... }:
{
# HID devices
wayland.windowManager.sway.config.input = {
@ -8,9 +8,6 @@
"9639:64097:Compx_2.4G_Receiver_Mouse" = {
pointer_accel = "-0.82";
};
"1452:627:bcm5974" = {
scroll_factor = "0.3";
};
"*" = {
accel_profile = "flat";
dwt = "disabled";

View file

@ -1,7 +1,14 @@
{ config, ... }:
{
wayland.windowManager.sway.config = {
defaultWorkspace = "1:${config.ws.w1}";
defaultWorkspace = "workspace 1:${config.ws.w1}";
focus = {
mouseWarping = "container";
wrapping = "yes";
};
workspaceAutoBackAndForth = true;
window = {
titlebar = false;
@ -66,6 +73,5 @@
];
"44:${config.ws.w4a}" = [{ app_id = "com.obsproject.Studio"; }];
};
focus.newWindow = "focus";
};
}

View file

@ -31,21 +31,31 @@
childBorder = "#${config.look.colors.urgent}";
};
};
fonts = {
names = [ config.look.fonts.main ];
size = 10.5;
};
window = {
border = config.look.border.int;
hideEdgeBorders = "smart";
};
floating.border = config.look.border.int;
gaps = {
inner = 5;
smartGaps = true;
};
output = {
"*".bg = "~/.assets/wallpapers/1.png fill";
"${config.displays.tower2}".bg = "~/.assets/wallpapers/2.png fill";
"${config.displays.tower3}".bg = "~/.assets/wallpapers/3.png fill";
"*".bg = "${builtins.toString ./wallpapers/1.png} fill";
"${config.displays.tower2}".bg = "${builtins.toString ./wallpapers/2.png} fill";
"${config.displays.tower3}".bg = "${builtins.toString ./wallpapers/3.png} fill";
"${config.displays.estradiol2}".bg = "${builtins.toString ./wallpapers/2.png} fill";
};
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB