docs(hyprland): preserve disabled slice one config
This commit is contained in:
@@ -1,13 +1,52 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
# pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
# The lock screen: a hyprlock session-lock surface the compositor owns.
|
# The lock screen: a hyprlock session-lock surface the compositor owns.
|
||||||
let
|
let
|
||||||
user = config.user.name;
|
user = config.user.name;
|
||||||
|
|
||||||
# The hyprlock this module installs, used by the lock keybind below.
|
/*
|
||||||
|
Slice 1 disables the lock keybinds, so their supporting values stay
|
||||||
|
commented out with the bind block.
|
||||||
|
|
||||||
|
# The hyprlock this module installs, used by the lock keybind below.
|
||||||
|
hyprlock = "${config.home-manager.users.${user}.programs.hyprlock.package}/bin/hyprlock";
|
||||||
|
|
||||||
|
sleepIcon = builtins.fromJSON ''"\udb81\udcb2"'';
|
||||||
|
sleepOffIcon = builtins.fromJSON ''"\udb81\udcb3"'';
|
||||||
|
|
||||||
|
idleLockToggle = pkgs.writeShellScript "lockscreen-idle-inhibit-toggle" ''
|
||||||
|
unit=lockscreen-idle-inhibit.service
|
||||||
|
|
||||||
|
refresh_waybar() {
|
||||||
|
${pkgs.procps}/bin/pkill -RTMIN+9 waybar >/dev/null 2>&1 || true
|
||||||
|
}
|
||||||
|
|
||||||
|
if ${pkgs.systemd}/bin/systemctl --user is-active --quiet "$unit"; then
|
||||||
|
${pkgs.systemd}/bin/systemctl --user stop "$unit"
|
||||||
|
refresh_waybar
|
||||||
|
${pkgs.swayosd}/bin/swayosd-client --custom-message "${sleepIcon}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ${pkgs.systemd}/bin/systemd-run \
|
||||||
|
--user \
|
||||||
|
--collect \
|
||||||
|
--unit=lockscreen-idle-inhibit \
|
||||||
|
--description="Disable idle-triggered screen locking" \
|
||||||
|
${pkgs.systemd}/bin/systemd-inhibit \
|
||||||
|
--what=idle \
|
||||||
|
--who=lockscreen-hotkey \
|
||||||
|
--why="lock screen disabled by hotkey" \
|
||||||
|
${pkgs.coreutils}/bin/sleep infinity >/dev/null; then
|
||||||
|
refresh_waybar
|
||||||
|
${pkgs.swayosd}/bin/swayosd-client --custom-message "${sleepOffIcon}"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
*/
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.desktop.session.hyprland.hyprlock.enable =
|
options.modules.desktop.session.hyprland.hyprlock.enable =
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
# pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
# mako as the notification daemon: toasts, a do-not-disturb mode, and history recall.
|
# mako as the notification daemon: toasts, a do-not-disturb mode, and history recall.
|
||||||
let
|
let
|
||||||
user = config.user.name;
|
user = config.user.name;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Slice 1 disables the Mako recall keybind, so its supporting value stays
|
||||||
|
commented out with the bind block.
|
||||||
|
|
||||||
|
makoctl = "${pkgs.mako}/bin/makoctl";
|
||||||
|
*/
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.desktop.session.mako.enable = lib.mkEnableOption "the mako notification daemon";
|
options.modules.desktop.session.mako.enable = lib.mkEnableOption "the mako notification daemon";
|
||||||
|
|||||||
@@ -1,14 +1,31 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
# pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
# rofi as the desktop launcher and dmenu-style menu frontend.
|
# rofi as the desktop launcher and dmenu-style menu frontend.
|
||||||
let
|
let
|
||||||
user = config.user.name;
|
user = config.user.name;
|
||||||
|
|
||||||
# A session menu built on the same themed rofi, so the power actions look
|
/*
|
||||||
# like every other menu the launcher drives.
|
Slice 1 disables the Rofi keybinds, so their supporting script stays
|
||||||
|
commented out with the bind block.
|
||||||
|
|
||||||
|
# A session menu built on the same themed rofi, so the power actions look
|
||||||
|
# like every other menu the launcher drives.
|
||||||
|
powerMenu = pkgs.writeShellScript "rofi-power-menu" ''
|
||||||
|
chosen=$(printf '%s\n' Lock Suspend 'Log out' Reboot 'Shut down' \
|
||||||
|
| ${pkgs.rofi}/bin/rofi -dmenu -i -p Power)
|
||||||
|
case "$chosen" in
|
||||||
|
Lock) ${pkgs.systemd}/bin/loginctl lock-session ;;
|
||||||
|
Suspend) ${pkgs.systemd}/bin/systemctl suspend ;;
|
||||||
|
'Log out') ${pkgs.systemd}/bin/loginctl terminate-session "$XDG_SESSION_ID" ;;
|
||||||
|
Reboot) ${pkgs.systemd}/bin/systemctl reboot ;;
|
||||||
|
'Shut down') ${pkgs.systemd}/bin/systemctl poweroff ;;
|
||||||
|
esac
|
||||||
|
'';
|
||||||
|
*/
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.desktop.session.rofi.enable = lib.mkEnableOption "the rofi launcher";
|
options.modules.desktop.session.rofi.enable = lib.mkEnableOption "the rofi launcher";
|
||||||
|
|||||||
@@ -8,10 +8,25 @@
|
|||||||
let
|
let
|
||||||
user = config.user.name;
|
user = config.user.name;
|
||||||
|
|
||||||
# The picker reuses the themed rofi, so history looks like every other menu
|
/*
|
||||||
# the launcher drives.
|
Slice 1 disables the clipboard picker keybind, so its supporting values
|
||||||
# decode is needed because list emits id-prefixed lines rather than the copied
|
stay commented out with the bind block.
|
||||||
# bytes, so the chosen id has to be resolved back before it can be re-copied.
|
|
||||||
|
cliphist = "${pkgs.cliphist}/bin/cliphist";
|
||||||
|
rofi = "${pkgs.rofi}/bin/rofi";
|
||||||
|
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
|
||||||
|
|
||||||
|
# The picker reuses the themed rofi, so history looks like every other menu
|
||||||
|
# the launcher drives.
|
||||||
|
# decode is needed because list emits id-prefixed lines rather than the
|
||||||
|
# copied bytes must be resolved back before it can be re-copied.
|
||||||
|
picker = pkgs.writeShellScript "clipboard-picker" ''
|
||||||
|
${cliphist} list \
|
||||||
|
| ${rofi} -dmenu -i -p Clipboard \
|
||||||
|
| ${cliphist} decode \
|
||||||
|
| ${wl-copy}
|
||||||
|
'';
|
||||||
|
*/
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.desktop.utilities.clipboard.enable =
|
options.modules.desktop.utilities.clipboard.enable =
|
||||||
|
|||||||
@@ -1,18 +1,48 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
# pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
# Keybound screen recording: pick a region, then toggle a video-only capture.
|
# Keybound screen recording: pick a region, then toggle a video-only capture.
|
||||||
let
|
let
|
||||||
user = config.user.name;
|
user = config.user.name;
|
||||||
|
|
||||||
# A single key both starts and stops.
|
/*
|
||||||
# A running wf-recorder is stopped with SIGINT so it finalises the file.
|
Slice 1 disables the recording keybind, so its supporting values stay
|
||||||
# Otherwise slurp picks a region and wf-recorder runs in the foreground until
|
commented out with the bind block.
|
||||||
# that stop arrives, so this instance lives for the whole recording and then
|
|
||||||
# reports it saved.
|
slurp = "${pkgs.slurp}/bin/slurp";
|
||||||
# No -a means no audio is captured.
|
wf-recorder = "${pkgs.wf-recorder}/bin/wf-recorder";
|
||||||
|
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||||
|
pgrep = "${pkgs.procps}/bin/pgrep";
|
||||||
|
pkill = "${pkgs.procps}/bin/pkill";
|
||||||
|
date = "${pkgs.coreutils}/bin/date";
|
||||||
|
mkdir = "${pkgs.coreutils}/bin/mkdir";
|
||||||
|
xdgUserDir = "${pkgs.xdg-user-dirs}/bin/xdg-user-dir";
|
||||||
|
|
||||||
|
# A single key both starts and stops.
|
||||||
|
# A running wf-recorder is stopped with SIGINT so it finalises the file.
|
||||||
|
# Otherwise slurp picks a region and wf-recorder runs in the foreground
|
||||||
|
# until that stop arrives.
|
||||||
|
# This instance lives for the whole recording and then reports it saved.
|
||||||
|
# No -a means no audio is captured.
|
||||||
|
toggle = pkgs.writeShellScript "screen-record-toggle" ''
|
||||||
|
if ${pgrep} -x wf-recorder >/dev/null; then
|
||||||
|
${pkill} -INT -x wf-recorder
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
region=$(${slurp}) || exit 0
|
||||||
|
dir="$(${xdgUserDir} VIDEOS)/Recordings"
|
||||||
|
${mkdir} -p "$dir"
|
||||||
|
file="$dir/recording-$(${date} +%Y%m%d-%H%M%S).mp4"
|
||||||
|
|
||||||
|
${notify-send} -a "Screen recording" "Recording started" "Region capture, no audio."
|
||||||
|
${wf-recorder} -g "$region" -f "$file"
|
||||||
|
${notify-send} -a "Screen recording" "Recording saved" "$file"
|
||||||
|
'';
|
||||||
|
*/
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.desktop.utilities.recording.enable =
|
options.modules.desktop.utilities.recording.enable =
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
# pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
# Keyboard-driven screenshots copy to the clipboard before Satty opens for
|
# Keyboard-driven screenshots copy to the clipboard before Satty opens for
|
||||||
@@ -8,8 +9,33 @@
|
|||||||
let
|
let
|
||||||
user = config.user.name;
|
user = config.user.name;
|
||||||
|
|
||||||
# Copy the original screenshot before Satty opens.
|
/*
|
||||||
# Satty copies and saves annotated screenshots when the user presses Enter.
|
Slice 1 disables the screenshot keybinds and Satty rule, so their
|
||||||
|
supporting values stay commented out with the bind block.
|
||||||
|
|
||||||
|
grimblast = "${pkgs.grimblast}/bin/grimblast";
|
||||||
|
satty = "${pkgs.satty}/bin/satty";
|
||||||
|
tee = "${pkgs.coreutils}/bin/tee";
|
||||||
|
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
|
||||||
|
xdgUserDir = "${pkgs.xdg-user-dirs}/bin/xdg-user-dir";
|
||||||
|
|
||||||
|
# Copy the original screenshot before Satty opens.
|
||||||
|
# Satty copies and saves annotated screenshots when the user presses Enter.
|
||||||
|
capture =
|
||||||
|
target:
|
||||||
|
pkgs.writeShellScript "screenshot-${target}" ''
|
||||||
|
dir="$(${xdgUserDir} PICTURES)/Screenshots"
|
||||||
|
mkdir -p "$dir"
|
||||||
|
${grimblast} save ${target} - \
|
||||||
|
| ${tee} >(${wl-copy}) \
|
||||||
|
| ${satty} --filename - \
|
||||||
|
--output-filename "$dir/screenshot-%Y%m%d-%H%M%S.png" \
|
||||||
|
--copy-command ${wl-copy} \
|
||||||
|
--save-after-copy \
|
||||||
|
--early-exit \
|
||||||
|
--actions-on-enter save-to-clipboard
|
||||||
|
'';
|
||||||
|
*/
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.desktop.utilities.screenshot.enable =
|
options.modules.desktop.utilities.screenshot.enable =
|
||||||
|
|||||||
Reference in New Issue
Block a user