-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
167 additions
and
195 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bash | ||
dir="${1:-forward}" # forward or reverse | ||
if [[ "$(hyprctl activewindow -j | jq -r .floating)" == "true" ]]; then | ||
|
||
# Get the cache directory and active window name | ||
cache_dir="$XDG_RUNTIME_DIR/hypr/cyclefloating" | ||
window_address="$(hyprctl activewindow -j | jq -r .address)" | ||
|
||
mkdir -p $cache_dir | ||
touch $cache_dir/$window_address | ||
|
||
# top_left top_center top_right | ||
# middle_left middle_right | ||
# bottom_left bottom_center bottom_right | ||
pos="$(cat $cache_dir/$window_address)" | ||
next_pos="top_left" | ||
|
||
|
||
if [[ "$pos" == "top_left" ]]; then | ||
hyprctl --batch "dispatch movewindow u ; dispatch movewindow l" | ||
[[ "$dir" == "forward" ]] && next_pos="top_center" || next_pos="middle_left" | ||
|
||
elif [[ "$pos" == "top_center" ]]; then | ||
hyprctl --batch "dispatch centerwindow 1; dispatch movewindow u" | ||
[[ "$dir" == "forward" ]] && next_pos="top_right" || next_pos="top_left" | ||
|
||
elif [[ "$pos" == "top_right" ]]; then | ||
hyprctl --batch "dispatch movewindow u ; dispatch movewindow r" | ||
[[ "$dir" == "forward" ]] && next_pos="middle_right" || next_pos="top_center" | ||
|
||
elif [[ "$pos" == "middle_right" ]]; then | ||
hyprctl --batch "dispatch centerwindow 1 ; dispatch movewindow r" | ||
[[ "$dir" == "forward" ]] && next_pos="bottom_right" || next_pos="top_right" | ||
|
||
elif [[ "$pos" == "bottom_right" ]]; then | ||
hyprctl --batch "dispatch movewindow d ; dispatch movewindow r" | ||
[[ "$dir" == "forward" ]] && next_pos="bottom_center" || next_pos="middle_right" | ||
|
||
elif [[ "$pos" == "bottom_center" ]]; then | ||
hyprctl --batch "dispatch centerwindow 1 ; dispatch movewindow d" | ||
[[ "$dir" == "forward" ]] && next_pos="bottom_left" || next_pos="bottom_right" | ||
|
||
elif [[ "$pos" == "bottom_left" ]]; then | ||
hyprctl --batch "dispatch movewindow d ; dispatch movewindow l" | ||
[[ "$dir" == "forward" ]] && next_pos="middle_left" || next_pos="bottom_center" | ||
|
||
elif [[ "$pos" == "middle_left" ]]; then | ||
hyprctl --batch "dispatch centerwindow 1 ; dispatch movewindow l" | ||
[[ "$dir" == "forward" ]] && next_pos="top_left" || next_pos="bottom_left" | ||
fi | ||
|
||
# Save the next position to file | ||
echo "$next_pos" > $cache_dir/$window_address | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
is_floating="$(hyprctl activewindow -j | jq -r .floating)" | ||
dir="${1-l}" # [l]eft [d]own [u]p [r]ight | ||
x="${2-0}" y="${3-0}" # distance to move window | ||
if [[ "$is_floating" == "true" ]]; then | ||
hyprctl dispatch moveactive $x $y | ||
else | ||
hyprctl dispatch movewindoworgroup $dir | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
flag="${1-rc}" | ||
|
||
# r: region | ||
# s: screen | ||
# c: clipboard | ||
# f: file | ||
# i: interactive | ||
# p: pixel | ||
|
||
# Region to clipboard | ||
if [[ $flag == rc ]]; then | ||
grim -g "$(slurp -b '#000000b0' -c '#00000000')" - | wl-copy | ||
notify-send 'Copied to Clipboard' Screenshot | ||
|
||
# Region to file | ||
elif [[ $flag == rf ]]; then | ||
mkdir -p ~/Pictures/Screenshots | ||
filename=~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png | ||
grim -g "$(slurp -b '#000000b0' -c '#00000000')" $filename | ||
notify-send 'Screenshot Taken' $filename | ||
|
||
# Region to interactive | ||
elif [[ $flag == ri ]]; then | ||
grim -g "$(slurp -b '#000000b0' -c '#00000000')" - | tee >(wl-copy) | swappy -f - | ||
# grim -g "$(slurp -b '#000000b0' -c '#00000000')" - | swappy -f - | ||
|
||
# Screen to clipboard | ||
elif [[ $flag == sc ]]; then | ||
filename=~/Pictures/Screenshots/%Y-%m-%d_%H-%M-%S.png | ||
grim - | wl-copy | ||
notify-send 'Copied to Clipboard' Screenshot | ||
|
||
# Screen to file | ||
elif [[ $flag == sf ]]; then | ||
mkdir -p ~/Pictures/Screenshots | ||
filename=~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png | ||
grim $filename | ||
notify-send 'Screenshot Taken' $filename | ||
|
||
# Screen to interactive | ||
elif [[ $flag == si ]]; then | ||
grim - | swappy -f - | ||
|
||
# Colour to clipboard | ||
elif [[ $flag == p ]]; then | ||
color=$(hyprpicker -a) | ||
wl-copy $color | ||
notify-send 'Copied to Clipboard' $color | ||
fi |
2 changes: 2 additions & 0 deletions
2
modules/hyprland/bin/supertab.sh → modules/hyprland/bin/hypr-supertab.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Stack of hyprland client windows | ||
STACK="$XDG_RUNTIME_DIR/supertab" | ||
touch $STACK | ||
|
2 changes: 2 additions & 0 deletions
2
modules/hyprland/bin/hyprwindow.sh → modules/hyprland/bin/rofi-hyprwindow.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Cache found names/icons | ||
CACHE="$XDG_RUNTIME_DIR/hyprwindow" | ||
mkdir -p $CACHE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
#!/usr/bin/env bash | ||
if $(pidof -q rofi >/dev/null); then | ||
kill $(pidof -s rofi) | ||
else | ||
if [[ -n "${@-}" ]]; then | ||
# keyd bind super.j=down super.k=up super.h=left super.l=right | ||
# keyd bind super.enter=enter super.space=space | ||
rofi "${@}" | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.