From 385106ccb0633e1f4800f43608191b90bef984db Mon Sep 17 00:00:00 2001 From: Harzo Date: Sat, 10 Jun 2023 12:32:56 +0200 Subject: [PATCH] dotfiles: Add patch for grimblast and update script --- .local/share/dotfiles/extra/patch-scripts.sh | 7 +++++ .../files/patches/grimblast-hide-cursor.patch | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .local/share/dotfiles/extra/patch-scripts.sh create mode 100644 .local/share/dotfiles/files/patches/grimblast-hide-cursor.patch diff --git a/.local/share/dotfiles/extra/patch-scripts.sh b/.local/share/dotfiles/extra/patch-scripts.sh new file mode 100644 index 0000000..c398d6e --- /dev/null +++ b/.local/share/dotfiles/extra/patch-scripts.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +CURDIR="$(dirname "$0")" +. "${CURDIR}/../helpers/root_guard.sh" + +cp /usr/bin/grimblast ~/.local/bin/ +patch -u ~/.local/bin/grimblast -i "${CURDIR}/../files/patches/grimblast-hide-cursor.patch" diff --git a/.local/share/dotfiles/files/patches/grimblast-hide-cursor.patch b/.local/share/dotfiles/files/patches/grimblast-hide-cursor.patch new file mode 100644 index 0000000..8b0ee11 --- /dev/null +++ b/.local/share/dotfiles/files/patches/grimblast-hide-cursor.patch @@ -0,0 +1,26 @@ +--- /usr/bin/grimblast 2023-06-08 21:37:37.000000000 +0200 ++++ ../../../../bin/grimblast 2023-06-09 14:42:41.857503879 +0200 +@@ -131,6 +131,14 @@ + FILE=$1 + GEOM=$2 + OUTPUT=$3 ++ ++ ORIG_POS="$(hyprctl cursorpos | tr -d ,)" ++ MONITOR="$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')" ++ HEIGHT="$(hyprctl monitors -j | jq -r '.[] | select(.name == "'$MONITOR'").height')" ++ HEIGHT="$(echo "$HEIGHT - 1" | bc)" ++ ++ hyprctl dispatch movecursor "0 $HEIGHT" > /dev/null ++ + if [ -n "$OUTPUT" ]; then + grim ${CURSOR:+-c} -o "$OUTPUT" "$FILE" || die "Unable to invoke grim" + elif [ -z "$GEOM" ]; then +@@ -138,6 +146,8 @@ + else + grim ${CURSOR:+-c} -g "$GEOM" "$FILE" || die "Unable to invoke grim" + fi ++ ++ hyprctl dispatch movecursor "$ORIG_POS" > /dev/null + } + + if [ "$ACTION" = "check" ]; then