worst screenshot script ever
This commit is contained in:
parent
d6ba358108
commit
5c02e4b809
1 changed files with 34 additions and 9 deletions
|
@ -95,7 +95,21 @@ in {
|
|||
temp_file=$(mktemp)
|
||||
trap 'rm -f "$temp_file"' EXIT
|
||||
|
||||
${lib.getExe pkgs.grimblast} --freeze save area - > "$temp_file" || exit 1
|
||||
mode="$1"
|
||||
case "$mode" in
|
||||
fullscreen)
|
||||
mode="output"
|
||||
;;
|
||||
area)
|
||||
mode="area"
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 [fullscreen|area]" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
${lib.getExe pkgs.grimblast} --freeze save "$mode" - > "$temp_file" || exit 0 # exit successful, highly unlikely that grimblast failed, and it is more likely that the user cancelled the screenshot
|
||||
|
||||
cat "$temp_file" | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard -t image/png
|
||||
|
||||
|
@ -113,10 +127,6 @@ in {
|
|||
esac
|
||||
'';
|
||||
in [
|
||||
"$mod, R, exec, ${lib.getExe pkgs.rofi-wayland} -show run"
|
||||
", print, exec, ${screenshotScript}"
|
||||
"$mod, T, exec, ${lib.getExe pkgs.wezterm}"
|
||||
|
||||
"$mod, Q, killactive, "
|
||||
"$mod, F, togglefloating, "
|
||||
"$mod, P, pseudo, " # dwindle
|
||||
|
@ -129,8 +139,8 @@ in {
|
|||
"$mod, down, movefocus, d"
|
||||
|
||||
# example special workspace (scratchpad)
|
||||
"$mod, S, togglespecialworkspace, magic"
|
||||
"$mod SHIFT, S, movetoworkspace, special:magic"
|
||||
"$mod, grave, togglespecialworkspace, magic"
|
||||
"$mod SHIFT, grave, movetoworkspace, special:magic"
|
||||
|
||||
# scroll through workspaces with mod + scroll
|
||||
"$mod, mouse_down, workspace, e+1"
|
||||
|
@ -139,9 +149,24 @@ in {
|
|||
"$mod, bracketleft, workspace, e-1"
|
||||
"$mod, bracketright, workspace, e+1"
|
||||
|
||||
", XF86LaunchA, exec, ${screenshotScript}"
|
||||
", XF86LaunchB, exec, ${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20"
|
||||
"$mod, R, exec, ${lib.getExe pkgs.rofi-wayland} -show run"
|
||||
"$mod, T, exec, ${lib.getExe pkgs.wezterm}"
|
||||
"$mod, L, exec, ${lib.getExe config.modules.desktop.hyprlock.package}"
|
||||
|
||||
# screenshot
|
||||
# area
|
||||
", Print, exec, ${screenshotScript} area"
|
||||
"$mod SHIFT, S, exec, ${screenshotScript} area"
|
||||
# fullscreen
|
||||
", Print, exec, ${screenshotScript} fullscreen"
|
||||
"$mod SHIFT CTRL, S, exec, ${screenshotScript} fullscreen"
|
||||
|
||||
", XF86LaunchA, exec, ${screenshotScript} area"
|
||||
", XF86LaunchB, exec, ${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20"
|
||||
", XF86ScreenSaver, exec, ${lib.getExe config.modules.desktop.hyprlock.package}"
|
||||
|
||||
# alt-tab emulation
|
||||
# doesnt activate when we let go of alt sadly
|
||||
"ALT, Tab, exec, ${lib.getExe pkgs.rofi-wayland} -show window"
|
||||
] ++ (
|
||||
# workspaces
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue