✨ feat(hypr): new custom_app_workspace script as well as other optimizations
script for launching an app on an specific workspace depending on the monitor
This commit is contained in:
parent
c96de953e2
commit
d906bda02f
5 changed files with 64 additions and 35 deletions
|
@ -14,8 +14,8 @@ bindr=SUPERSHIFT, Return, exec, ~/.config/hypr/scripts/quake
|
|||
|
||||
## Applications
|
||||
bind=SUPER,W,exec,librewolf
|
||||
bind=SUPER,O,exec,obsidian
|
||||
bind=SUPERSHIFT,E,exec,nemo
|
||||
bind=SUPER,O,exec,~/.config/hypr/scripts/custom_app_launch obsidian
|
||||
bind=SUPERSHIFT,E,exec, ~/.config/hypr/scripts/custom_app_launch nemo
|
||||
bind=SUPER,RETURN,exec,kitty
|
||||
bind=SUPER,E,exec,kitty --class kitty-yazi yazi
|
||||
|
||||
|
@ -132,15 +132,15 @@ bind=ALT,tab,changegroupactive
|
|||
bind=SUPER,R,submap,resize
|
||||
submap=resize
|
||||
|
||||
binde=,right,resizeactive,20 0
|
||||
binde=,left,resizeactive,-20 0
|
||||
binde=,up,resizeactive,0 -20
|
||||
binde=,down,resizeactive,0 20
|
||||
binde=,right,resizeactive,40 0
|
||||
binde=,left,resizeactive,-40 0
|
||||
binde=,up,resizeactive,0 -40
|
||||
binde=,down,resizeactive,0 40
|
||||
|
||||
binde=,l,resizeactive,20 0
|
||||
binde=,h,resizeactive,-20 0
|
||||
binde=,k,resizeactive,0 -20
|
||||
binde=,j,resizeactive,0 20
|
||||
binde=,l,resizeactive,40 0
|
||||
binde=,h,resizeactive,-40 0
|
||||
binde=,k,resizeactive,0 -40
|
||||
binde=,j,resizeactive,0 40
|
||||
|
||||
bind=,escape,submap,reset
|
||||
|
||||
|
|
44
.config/hypr/scripts/custom_app_launch
Executable file
44
.config/hypr/scripts/custom_app_launch
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
app=$1
|
||||
|
||||
if [ "$app" = "" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FOCUSED_MONITOR=$(~/.config/hypr/scripts/focused_monitor)
|
||||
source ~/.config/hypr/scripts/monitors
|
||||
|
||||
case $app in
|
||||
"nemo")
|
||||
if [ "$FOCUSED_MONITOR" = "$MONITOR1" ]; then
|
||||
hyprctl dispatch exec [workspace 4] nemo
|
||||
elif [ "$FOCUSED_MONITOR" = "$MONITOR2" ]; then
|
||||
hyprctl dispatch exec [workspace 14] nemo
|
||||
else
|
||||
nemo
|
||||
fi
|
||||
;;
|
||||
"obsidian")
|
||||
if [ "$FOCUSED_MONITOR" = "$MONITOR1" ]; then
|
||||
hyprctl dispatch exec [workspace 10] obsidian
|
||||
elif [ "$FOCUSED_MONITOR" = "$MONITOR2" ]; then
|
||||
hyprctl dispatch exec [workspace 20] obsidian
|
||||
else
|
||||
obsidian
|
||||
fi
|
||||
;;
|
||||
# I DONT KNOW WHY LIBREWOLF IS NOT WORKING ._.
|
||||
# "librewolf")
|
||||
# if [ "$FOCUSED_MONITOR" = "$MONITOR1" ]; then
|
||||
# hyprctl dispatch exec [workspace 1] librewolf
|
||||
# elif [ "$FOCUSED_MONITOR" = "$MONITOR2" ]; then
|
||||
# hyprctl dispatch exec [workspace 11] librewolf
|
||||
# elif [ "$FOCUSED_MONITOR" = "$MONITOR3" ]; then
|
||||
# hyprctl dispatch exec [workspace 25] librewolf
|
||||
# else
|
||||
# librewolf
|
||||
# fi
|
||||
# ;;
|
||||
*) ;;
|
||||
esac
|
|
@ -1,17 +1,4 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
MONITOR_DATA=$(hyprctl monitors)
|
||||
readarray -t LINES <<<"$MONITOR_DATA"
|
||||
|
||||
CURRENT_MONITOR=""
|
||||
|
||||
for LINE in "${LINES[@]}"; do
|
||||
if [[ $LINE == *"Monitor"* ]]; then
|
||||
CURRENT_MONITOR=$(echo $LINE | awk '{print $2}')
|
||||
fi
|
||||
|
||||
if [[ $LINE == *"focused: yes"* ]]; then
|
||||
echo $CURRENT_MONITOR
|
||||
break
|
||||
fi
|
||||
done
|
||||
FOCUSED_MONITOR_NAME=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name')
|
||||
echo "$FOCUSED_MONITOR_NAME"
|
||||
|
|
8
.config/hypr/scripts/monitors
Executable file
8
.config/hypr/scripts/monitors
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
# MONITORS=$(hyprctl monitors -j | jq -r '.[] | .name')
|
||||
# echo "$MONITORS"
|
||||
|
||||
export MONITOR1="DP-1"
|
||||
export MONITOR2="DP-3"
|
||||
export MONITOR3="HDMI-A-1"
|
|
@ -4,25 +4,18 @@ windowrulev2 = workspace 21,silent,class:^(Spotify)$
|
|||
windowrulev2 = workspace 21,class:^(YouTube Music)$
|
||||
windowrulev2 = workspace 18,class:^(steam)$
|
||||
windowrulev2 = workspace 16,class:^(com.github.wwmm.easyeffects)$
|
||||
windowrulev2 = workspace 12,class:^(GitKraken)$
|
||||
windowrulev2 = workspace 26,class:^(nm-connection-editor)$
|
||||
windowrulev2 = workspace 2,class:^(VSCodium)$
|
||||
windowrulev2 = workspace 2,class:^(neovide)$
|
||||
windowrulev2 = tile,class:^(neovide)$
|
||||
windowrulev2 = workspace 2,class:^(codium-url-handler)$
|
||||
windowrulev2 = workspace 2,class:^(jetbrains-idea)$
|
||||
windowrulev2 = workspace 2,class:^(jetbrains-studio)$
|
||||
windowrulev2 = workspace 9,class:^(virt-manager)$
|
||||
windowrulev2 = workspace 23 silent,class:^(thunderbird)$
|
||||
windowrulev2 = workspace 18,class:^(com-atlauncher-App)$
|
||||
windowrulev2 = workspace 18,class:^(heroic)$
|
||||
windowrulev2 = workspace 14,class:^(nemo)$
|
||||
windowrulev2 = workspace 8,class:^(cemu)$
|
||||
windowrulev2 = workspace 8,class:^(info.cemu.Cemu)$
|
||||
windowrulev2 = workspace 8,class:^(dolphin-emu)$
|
||||
windowrulev2 = workspace 24 silent,class:^(btop-kitty)$
|
||||
windowrulev2 = workspace 24 silent,class:^(nvtop-kitty)$
|
||||
windowrulev2 = workspace 10,class:^(obsidian)$
|
||||
windowrulev2 = workspace 10,class:^(libreoffice.*)$
|
||||
windowrulev2 = workspace 10,class:^(soffice)$
|
||||
windowrulev2 = workspace 17,class:^(com.obsproject.Studio)$
|
||||
|
@ -61,9 +54,6 @@ windowrule = center 1, ^(yazi-geeqie)$
|
|||
windowrule = float, ^(kitty-yazi)$
|
||||
windowrule = size 80% 80%,^(kitty-yazi)$
|
||||
windowrule = center 1, ^(kitty-yazi)$
|
||||
# windowrule = float, ^(nemo)$
|
||||
# windowrule = size 80% 80%,^(nemo)$
|
||||
# windowrule = center 1, ^(nemo)$
|
||||
windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noanim,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = nofocus,class:^(xwaylandvideobridge)$
|
||||
|
|
Loading…
Add table
Reference in a new issue