Reorganize files, use less extra options on Sway, move session commands to home-manager
This commit is contained in:
parent
5cdd7b1de8
commit
ee3b40f61f
25 changed files with 64 additions and 107 deletions
|
@ -39,6 +39,7 @@
|
|||
{
|
||||
criteria = config.displays.estradiol2;
|
||||
position = "1920,0";
|
||||
scale = 0.85;
|
||||
}
|
||||
{
|
||||
criteria = "eDP-1";
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./makotoggle
|
||||
];
|
||||
|
||||
services.mako = {
|
||||
enable = config.home.desktop.enable;
|
||||
borderColor = "#${config.look.colors.accent}";
|
||||
|
|
|
@ -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
|
||||
'')
|
||||
];
|
||||
}
|
|
@ -14,7 +14,7 @@
|
|||
case $POWER in
|
||||
Shutdown) poweroff;;
|
||||
Reboot) reboot;;
|
||||
Lock) swaylock;;
|
||||
Sleep) systemctl suspend;;
|
||||
Kill) pkill -9 $XDG_CURRENT_DESKTOP;;
|
||||
esac
|
||||
'')
|
||||
|
|
|
@ -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 ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
|
BIN
modules/home/wms/programs/swaylock/lock.png
Normal file
BIN
modules/home/wms/programs/swaylock/lock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 314 KiB |
|
@ -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."}';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue