From 1b2d31728e3ce134a36539e78fcb4673bcf0923a Mon Sep 17 00:00:00 2001 From: huyjaky Date: Mon, 4 Nov 2024 13:33:15 +0700 Subject: [PATCH] custom-hypr - synchronously multiple call --- .config/hypr/custom/animation.conf | 14 ------- .config/hypr/custom/execs.conf | 1 + .config/hypr/custom/fusion.conf | 1 - .config/hypr/custom/keybinding.conf | 1 + .config/hypr/keybindings.conf | 6 +-- .../scripts/{movetoworkspace.sh => test.sh} | 0 .config/hypr/scripts/windowtoleft.sh | 37 +++++++++---------- .config/hypr/scripts/windowtoright.sh | 37 +++++++++---------- .config/hypr/scripts/workspaceV2descrease.sh | 18 ++++++--- .config/hypr/scripts/workspaceV2inscrease.sh | 19 +++++++--- .config/kitty/kitty.conf | 10 +++-- 11 files changed, 75 insertions(+), 69 deletions(-) delete mode 100644 .config/hypr/custom/animation.conf rename .config/hypr/scripts/{movetoworkspace.sh => test.sh} (100%) diff --git a/.config/hypr/custom/animation.conf b/.config/hypr/custom/animation.conf deleted file mode 100644 index 7b7e274..0000000 --- a/.config/hypr/custom/animation.conf +++ /dev/null @@ -1,14 +0,0 @@ -# animations { -# enabled = true - -# # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more - -# bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - -# animation = windows, 1, 7, myBezier -# animation = windowsOut, 1, 7, default, popin 80% -# animation = border, 1, 10, default -# animation = borderangle, 1, 8, default -# animation = fade, 1, 7, default -# animation = workspaces, 1, 6, default -# } diff --git a/.config/hypr/custom/execs.conf b/.config/hypr/custom/execs.conf index f8abb96..b8acfe3 100644 --- a/.config/hypr/custom/execs.conf +++ b/.config/hypr/custom/execs.conf @@ -8,5 +8,6 @@ exec-once = fcitx5 exec-once = waybar -c ~/.config/waybar/primary_screen/config.jsonc exec-once = waybar -c ~/.config/waybar/secondary_screen/config.jsonc + exec = gsettings set org.gnome.desktop.interface icon-theme 'Nordzy' exec = hyprctl setcursor Gruvbox-Retro 20 diff --git a/.config/hypr/custom/fusion.conf b/.config/hypr/custom/fusion.conf index 3cc3673..a774acb 100644 --- a/.config/hypr/custom/fusion.conf +++ b/.config/hypr/custom/fusion.conf @@ -4,4 +4,3 @@ source = ~/.config/hypr/custom/execs.conf source = ~/.config/hypr/custom/keybinding.conf source = ~/.config/hypr/custom/windowrules.conf source = ~/.config/hypr/custom/env.conf -source = ~/.config/hypr/custom/animation.conf diff --git a/.config/hypr/custom/keybinding.conf b/.config/hypr/custom/keybinding.conf index 6ed3981..b08bfe1 100644 --- a/.config/hypr/custom/keybinding.conf +++ b/.config/hypr/custom/keybinding.conf @@ -56,6 +56,7 @@ bind = Alt, V, exec, vesktop --no-sandbox --ozone-platform=wayland --ozone-platf bind = SUPER, SUPER_L, exec, pkill -x rofi || $scrPath/rofilaunch.sh d # launch application launcher +bind = SUPER, L, exec, swaylock # launch lock screen bind = Ctrl+SUPER, Ctrl+SUPER_L, exec, rofi diff --git a/.config/hypr/keybindings.conf b/.config/hypr/keybindings.conf index 0c31b6b..fba03bf 100644 --- a/.config/hypr/keybindings.conf +++ b/.config/hypr/keybindings.conf @@ -40,9 +40,9 @@ bind = $mainMod, Tab, exec, pkill -x rofi || $scrPath/rofilaunch.sh w # launch w bind = $mainMod+Shift, E, exec, pkill -x rofi || $scrPath/rofilaunch.sh f # launch file explorer # Audio control -bindl = , F10, exec, $scrPath/volumecontrol.sh -o m # toggle audio mute -bindel = , F11, exec, $scrPath/volumecontrol.sh -o d # decrease volume -bindel = , F12, exec, $scrPath/volumecontrol.sh -o i # increase volume +# bindl = , F10, exec, $scrPath/volumecontrol.sh -o m # toggle audio mute +# bindel = , F11, exec, $scrPath/volumecontrol.sh -o d # decrease volume +# bindel = , F12, exec, $scrPath/volumecontrol.sh -o i # increase volume bindl = , XF86AudioMute, exec, $scrPath/volumecontrol.sh -o m # toggle audio mute bindl = , XF86AudioMicMute, exec, $scrPath/volumecontrol.sh -i m # toggle microphone mute bindel = , XF86AudioLowerVolume, exec, $scrPath/volumecontrol.sh -o d # decrease volume diff --git a/.config/hypr/scripts/movetoworkspace.sh b/.config/hypr/scripts/test.sh similarity index 100% rename from .config/hypr/scripts/movetoworkspace.sh rename to .config/hypr/scripts/test.sh diff --git a/.config/hypr/scripts/windowtoleft.sh b/.config/hypr/scripts/windowtoleft.sh index 1c7d2f5..36395b2 100644 --- a/.config/hypr/scripts/windowtoleft.sh +++ b/.config/hypr/scripts/windowtoleft.sh @@ -13,23 +13,30 @@ window_state=$(echo "$window_info" | grep 'fullscreen:' | awk '{print $2}') current_workspace=$(hyprctl activeworkspace | grep 'workspace' | awk '{print $3}') window_width=$(echo "$window_info" | grep 'size:' | awk '{print $2}' | cut -d',' -f1) -echo $window_stat -echo $window_x_position -echo $window_width - hyprctl dispatch fullscreenstate 0 # minimize trước khi di chuyển +move(){ + # hyprctl dispatch movetoworkspace $((window_at_workspace-1)) \ + # && hyprctl dispatch focusmonitor 0 \ + # && hyprctl dispatch workspace $((current_workspace-2)) \ + # && hyprctl dispatch focusmonitor 1 + + hyprctl --batch " + dispatch movetoworkspace $((window_at_workspace-1)) ; + dispatch focusmonitor 0 ; + dispatch workspace $((current_workspace-2)) ; + dispatch focusmonitor 1 + " + exit 0 +} + # NOTE: Di chuyển cửa sổ nếu vị trí X vượt qua ngưỡng if [ $window_x_position -eq 14 ] && [ $window_state -eq 1 ]; then if [ $current_workspace -eq 1 ]; then exit 1 fi - hyprctl dispatch movetoworkspace $((window_at_workspace-1)) \ - && hyprctl dispatch focusmonitor 0 \ - && hyprctl dispatch workspace $((current_workspace-2)) \ - && hyprctl dispatch focusmonitor 1 - exit 0 + move fi if [ $window_x_position -eq 14 ] && [ $window_width -eq 1892 ]; then @@ -37,11 +44,7 @@ if [ $window_x_position -eq 14 ] && [ $window_width -eq 1892 ]; then if [ $current_workspace -eq 1 ]; then exit 1 fi - hyprctl dispatch movetoworkspace $((window_at_workspace-1)) \ - && hyprctl dispatch focusmonitor 0 \ - && hyprctl dispatch workspace $((current_workspace-2)) \ - && hyprctl dispatch focusmonitor 1 - exit 0 + move fi @@ -50,11 +53,7 @@ if [ $window_x_position -eq 14 ]; then if [ $current_workspace -eq 1 ]; then exit 1 fi - hyprctl dispatch movetoworkspace $((window_at_workspace-1)) \ - && hyprctl dispatch focusmonitor 0 \ - && hyprctl dispatch workspace $((current_workspace-2)) \ - && hyprctl dispatch focusmonitor 1 - exit 0 + move fi # Nếu không thoả điều kiện di chuyển, di chuyển cửa sổ sang phải diff --git a/.config/hypr/scripts/windowtoright.sh b/.config/hypr/scripts/windowtoright.sh index 503c7ee..cd03e94 100644 --- a/.config/hypr/scripts/windowtoright.sh +++ b/.config/hypr/scripts/windowtoright.sh @@ -12,23 +12,30 @@ window_state=$(echo "$window_info" | grep 'fullscreen:' | awk '{print $2}') current_workspace=$(hyprctl activeworkspace | grep 'workspace' | awk '{print $3}') window_width=$(echo "$window_info" | grep 'size:' | awk '{print $2}' | cut -d',' -f1) -echo $window_stat -echo $window_x_position -echo $window_width - hyprctl dispatch fullscreenstate 0 # minimize trước khi di chuyển +move(){ + # hyprctl dispatch movetoworkspace $((window_at_workspace+1)) \ + # && hyprctl dispatch focusmonitor 1 \ + # && hyprctl dispatch workspace $((current_workspace+2)) \ + # && hyprctl dispatch focusmonitor 0 + + hyprctl --batch " + dispatch movetoworkspace $((window_at_workspace+1)) ; + dispatch focusmonitor 1 ; + dispatch workspace $((current_workspace+2)) ; + dispatch focusmonitor 0 + " + exit 0 +} + # NOTE: Di chuyển cửa sổ nếu vị trí X vượt qua ngưỡng if [ $window_x_position -eq 1934 ] && [ $window_state -eq 1 ]; then if [ $current_workspace -eq 8 ]; then exit 1 fi - hyprctl dispatch movetoworkspace $((window_at_workspace+1)) \ - && hyprctl dispatch focusmonitor 1 \ - && hyprctl dispatch workspace $((current_workspace+2)) \ - && hyprctl dispatch focusmonitor 0 - exit 0 + move fi if [ $window_x_position -eq 1934 ] && [ $window_width -eq 1892 ]; then @@ -36,11 +43,7 @@ if [ $window_x_position -eq 1934 ] && [ $window_width -eq 1892 ]; then if [ $current_workspace -eq 8 ]; then exit 1 fi - hyprctl dispatch movetoworkspace $((window_at_workspace+1)) \ - && hyprctl dispatch focusmonitor 1 \ - && hyprctl dispatch workspace $((current_workspace+2)) \ - && hyprctl dispatch focusmonitor 0 - exit 0 + move fi @@ -49,11 +52,7 @@ if [ $window_x_position -eq 2990 ]; then if [ $current_workspace -eq 8 ]; then exit 1 fi - hyprctl dispatch movetoworkspace $((window_at_workspace+1)) \ - && hyprctl dispatch focusmonitor 1 \ - && hyprctl dispatch workspace $((current_workspace+2)) \ - && hyprctl dispatch focusmonitor 0 - exit 0 + move fi # Nếu không thoả điều kiện di chuyển, di chuyển cửa sổ sang phải diff --git a/.config/hypr/scripts/workspaceV2descrease.sh b/.config/hypr/scripts/workspaceV2descrease.sh index f7233d4..70ba792 100644 --- a/.config/hypr/scripts/workspaceV2descrease.sh +++ b/.config/hypr/scripts/workspaceV2descrease.sh @@ -25,10 +25,18 @@ if [ "$primary_monitor_workspace" -le 0 ] || [ "$secondary_monitor_workspace" -g exit 1 fi +# hyprctl dispatch focusmonitor 0 \ +# &&hyprctl dispatch workspace $primary_monitor_workspace \ +# &&hyprctl dispatch focusmonitor 1 \ +# &&hyprctl dispatch workspace $secondary_monitor_workspace \ +# &&hyprctl dispatch focusmonitor $current_monitor + +hyprctl --batch " + dispatch focusmonitor 0 ; + dispatch workspace $primary_monitor_workspace ; + dispatch dispatch focusmonitor 1 ; + dispatch workspace $secondary_monitor_workspace ; + dispatch focusmonitor $current_monitor +" -hyprctl dispatch focusmonitor 0 \ -&&hyprctl dispatch workspace $primary_monitor_workspace \ -&&hyprctl dispatch focusmonitor 1 \ -&&hyprctl dispatch workspace $secondary_monitor_workspace \ -&&hyprctl dispatch focusmonitor $current_monitor exit 0 diff --git a/.config/hypr/scripts/workspaceV2inscrease.sh b/.config/hypr/scripts/workspaceV2inscrease.sh index 50bf5a6..b507d38 100644 --- a/.config/hypr/scripts/workspaceV2inscrease.sh +++ b/.config/hypr/scripts/workspaceV2inscrease.sh @@ -26,9 +26,18 @@ if [ "$primary_monitor_workspace" -le 0 ] || [ "$secondary_monitor_workspace" -g exit 1 fi -hyprctl dispatch focusmonitor 0 \ -&&hyprctl dispatch workspace $primary_monitor_workspace \ -&&hyprctl dispatch focusmonitor 1 \ -&&hyprctl dispatch workspace $secondary_monitor_workspace \ -&&hyprctl dispatch focusmonitor $current_monitor +# hyprctl dispatch focusmonitor 0 \ +# &&hyprctl dispatch workspace $primary_monitor_workspace \ +# &&hyprctl dispatch focusmonitor 1 \ +# &&hyprctl dispatch workspace $secondary_monitor_workspace \ +# &&hyprctl dispatch focusmonitor $current_monitor + +hyprctl --batch " + dispatch focusmonitor 0 ; + dispatch workspace $primary_monitor_workspace ; + dispatch dispatch focusmonitor 1 ; + dispatch workspace $secondary_monitor_workspace ; + dispatch focusmonitor $current_monitor +" + exit 0 diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index a7b9163..2adb008 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -8,15 +8,19 @@ italic_font VictorMono NF SemiBold Italic font_size 14 -background_image ~/Pictures/ImgsDownloadsFromBr/BgKittyGif/convert.png -background_image_layout cscaled -background_tint 0.988 +# background_image ~/Pictures/ImgsDownloadsFromBr/BgKittyGif/convert.png +# background_image_layout cscaled +# background_tint 0.988 +background_opacity 0.9 input_delay 0 repaint_delay 0 sync_to_monitor yes wayland_enable_ime no +# cursor lirke neovide +cursor_trail 3 + enable_audio_bell no # Disable tab bar