Compare commits

...

4 Commits

Author SHA1 Message Date
Tom Alexander
ed0d1e41d6
Add a notification daemon. 2025-01-18 18:44:00 -05:00
Tom Alexander
2c27d580f4
Add a mode to force focus a window. 2025-01-18 18:40:08 -05:00
Tom Alexander
75ac4b91f3
Add screenshot / screen recording. 2025-01-18 18:33:46 -05:00
Tom Alexander
9abe43096b
Add swaylock. 2025-01-18 18:13:30 -05:00
5 changed files with 138 additions and 0 deletions

View File

@ -260,6 +260,10 @@ in
./graphical_session_target.nix
./iso.nix
./rofimoji.nix
./lockscreen.nix
./screenshot.nix
./force_focus.nix
./notification.nix
];
options.me.swayIncludes = lib.mkOption {

View File

@ -0,0 +1,27 @@
{
config,
lib,
pkgs,
...
}:
let
force_focus_sway_config = pkgs.writeTextFile {
name = "force_focus.conf";
text = ''
mode "force focus" {
bindsym $mod+Shift+Escape fullscreen; mode "default"
}
bindsym $mod+Shift+f fullscreen; mode "force focus"
'';
};
in
{
imports = [ ];
config = lib.mkIf config.me.graphical {
me.swayIncludes = [
force_focus_sway_config
];
};
}

View File

@ -0,0 +1,33 @@
{
config,
lib,
pkgs,
...
}:
let
lockscreen_sway_config = pkgs.writeTextFile {
name = "lockscreen.conf";
text = ''
set $lock ${pkgs.swaylock}/bin/swaylock -f -c 000000
# Hotkey to lock the screen
bindsym $mod+l exec $lock
exec ${pkgs.swayidle}/bin/swayidle -w \
timeout 300 '$lock' \
timeout 600 '${pkgs.sway}/bin/swaymsg "output * dpms off"' \
resume '${pkgs.sway}/bin/swaymsg "output * dpms on"' \
before-sleep '$lock'
'';
};
in
{
imports = [ ];
config = lib.mkIf config.me.graphical {
me.swayIncludes = [
lockscreen_sway_config
];
};
}

View File

@ -0,0 +1,32 @@
{
config,
lib,
pkgs,
...
}:
let
notification_sway_config = pkgs.writeTextFile {
name = "notification.conf";
text =
builtins.replaceStrings
[ "@mako@" "@makoctl@" ]
[ "${pkgs.mako}/bin/mako" "${pkgs.mako}/bin/makoctl" ]
''
bindsym $mod+Escape exec @makoctl@ dismiss
bindsym $mod+Shift+Escape exec @makoctl@ invoke
# Notifications
exec @mako@
'';
};
in
{
imports = [ ];
config = lib.mkIf config.me.graphical {
me.swayIncludes = [
notification_sway_config
];
};
}

View File

@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
...
}:
let
screenshot_sway_config = pkgs.writeTextFile {
name = "screenshot.conf";
text =
builtins.replaceStrings
[ "@grim@" "@wl-screenrec@" "@pactl@" "@grep@" "@slurp@" ]
[
"${pkgs.grim}/bin/grim"
"${pkgs.wl-screenrec}/bin/wl-screenrec"
"${pkgs.pulseaudio}/bin/pactl"
"${pkgs.gnugrep}/bin/grep"
"${pkgs.slurp}/bin/slurp"
]
''
# Screenshots
#bindsym $mod+print exec @slurp@ | @grim@ -g - $(xdg-user-dir PICTURES)/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')
bindsym $mod+print exec @slurp@ | @grim@ -g - "$HOME/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')"
bindsym print exec @grim@ "$HOME/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')"
# Maybe add --audio flag? can optionally specify specific device name from `@pactl@ list sources | @grep@ Name`
bindsym $mod+Shift+print exec @wl-screenrec@ -g "$(@slurp@)" --codec av1 -f "$HOME/$(date +'screencast_%Y-%m-%d-%H%M%S.mkv')"
bindsym Shift+print exec @wl-screenrec@ --codec av1 -f "$HOME/$(date +'screencast_%Y-%m-%d-%H%M%S.mkv')"
bindsym $mod+ctrl+Shift+print exec pkill -SIGINT @wl-screenrec@
# Need to make a hotkey to end the recording
'';
};
in
{
imports = [ ];
config = lib.mkIf config.me.graphical {
me.swayIncludes = [
screenshot_sway_config
];
};
}