Compare commits
4 Commits
1535800e2f
...
ed0d1e41d6
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ed0d1e41d6 | ||
![]() |
2c27d580f4 | ||
![]() |
75ac4b91f3 | ||
![]() |
9abe43096b |
@ -260,6 +260,10 @@ in
|
|||||||
./graphical_session_target.nix
|
./graphical_session_target.nix
|
||||||
./iso.nix
|
./iso.nix
|
||||||
./rofimoji.nix
|
./rofimoji.nix
|
||||||
|
./lockscreen.nix
|
||||||
|
./screenshot.nix
|
||||||
|
./force_focus.nix
|
||||||
|
./notification.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.me.swayIncludes = lib.mkOption {
|
options.me.swayIncludes = lib.mkOption {
|
||||||
|
27
nix/configuration/roles/sway/force_focus.nix
Normal file
27
nix/configuration/roles/sway/force_focus.nix
Normal 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
33
nix/configuration/roles/sway/lockscreen.nix
Normal file
33
nix/configuration/roles/sway/lockscreen.nix
Normal 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
32
nix/configuration/roles/sway/notification.nix
Normal file
32
nix/configuration/roles/sway/notification.nix
Normal 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
42
nix/configuration/roles/sway/screenshot.nix
Normal file
42
nix/configuration/roles/sway/screenshot.nix
Normal 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user