diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2024-06-11 04:15:57 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-11 04:15:57 +0900 |
| commit | 22b85572e891b874011893f62d4eaf94f20486df (patch) | |
| tree | 3452d4164a8964cd85fe57de2bd128baeb0ee2ff /config/hypr/scripts | |
| parent | c4ee8142bf7e8d89602cb7712da10888a54d438b (diff) | |
| parent | ed21639feebd8e3b6a6a4c2a59686f777b9688b9 (diff) | |
Merge pull request #338 from JaKooLit/development
Development to Main including pre-release
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/DarkLight.sh | 16 | ||||
| -rwxr-xr-x | config/hypr/scripts/KeyHints.sh | 2 | ||||
| -rwxr-xr-x | config/hypr/scripts/KillActiveProcess.sh | 11 | ||||
| -rwxr-xr-x | config/hypr/scripts/TouchPad.sh | 37 |
4 files changed, 49 insertions, 17 deletions
diff --git a/config/hypr/scripts/DarkLight.sh b/config/hypr/scripts/DarkLight.sh index e6f212f6..77426902 100755 --- a/config/hypr/scripts/DarkLight.sh +++ b/config/hypr/scripts/DarkLight.sh @@ -14,6 +14,8 @@ SCRIPTSDIR="$HOME/.config/hypr/scripts" notif="$HOME/.config/swaync/images/bell.png" wallust_rofi="$HOME/.config/wallust/templates/colors-rofi.rasi" +kitty_conf="$HOME/.config/kitty/kitty.conf" + wallust_config="$HOME/.config/wallust/wallust.toml" pallete_dark="dark16" pallete_light="light16" @@ -97,6 +99,20 @@ else sed -i '/@define-color noti-bg-alt/s/#.*;/#F0F0F0;/' "${ags_style}" fi +# kitty background color change +if [ "$next_mode" = "Dark" ]; then + sed -i '/^foreground /s/^foreground .*/foreground #dddddd/' "${kitty_conf}" + sed -i '/^background /s/^background .*/background #000000/' "${kitty_conf}" + sed -i '/^cursor /s/^cursor .*/cursor #dddddd/' "${kitty_conf}" +else + sed -i '/^foreground /s/^foreground .*/foreground #000000/' "${kitty_conf}" + sed -i '/^background /s/^background .*/background #dddddd/' "${kitty_conf}" + sed -i '/^cursor /s/^cursor .*/cursor #000000/' "${kitty_conf}" +fi + + + + # Set Dynamic Wallpaper for Dark or Light Mode if [ "$next_mode" = "Dark" ]; then next_wallpaper="$(find "${dark_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)" diff --git a/config/hypr/scripts/KeyHints.sh b/config/hypr/scripts/KeyHints.sh index 612038d2..85fb1dc6 100755 --- a/config/hypr/scripts/KeyHints.sh +++ b/config/hypr/scripts/KeyHints.sh @@ -45,7 +45,7 @@ yad --width=$dynamic_width --height=$dynamic_height \ " T" "Open File Manager" "(Thunar)" \ " S" "Google Search" "(rofi)" \ " Q" "close active window" "(not kill)" \ -" Shift Q " "closes a specified window" "(window)" \ +" Shift Q " "kills an active window" "(kill)" \ " Z" "Desktop Zoom" "(pyprland)" \ " Alt V" "Clipboard Manager" "(cliphist)" \ " W" "Choose wallpaper" "(Wallpaper Menu)" \ diff --git a/config/hypr/scripts/KillActiveProcess.sh b/config/hypr/scripts/KillActiveProcess.sh new file mode 100755 index 00000000..bee146d7 --- /dev/null +++ b/config/hypr/scripts/KillActiveProcess.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## + +# Copied from Discord post. Thanks to @Zorg + + +# Get id of an active window +active_pid=$(hyprctl activewindow | grep -o 'pid: [0-9]*' | cut -d' ' -f2) + +# Close active window +kill $active_pid
\ No newline at end of file diff --git a/config/hypr/scripts/TouchPad.sh b/config/hypr/scripts/TouchPad.sh index e94ee068..228e4ca2 100755 --- a/config/hypr/scripts/TouchPad.sh +++ b/config/hypr/scripts/TouchPad.sh @@ -1,27 +1,32 @@ #!/bin/bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # For disabling touchpad. -# Edit the Touchpad_Device according to your system +# Edit the Touchpad_Device on ~/.config/hypr/UserConfigs/Laptops.conf according to your system # use hyprctl devices to get your system touchpad device name +# source https://github.com/hyprwm/Hyprland/discussions/4283?sort=new#discussioncomment-8648109 - -Touchpad_Device="asue1209:00-04f3:319f-touchpad" notif="$HOME/.config/swaync/images/bell.png" -XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)} -STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status" +export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status" -toggle_touchpad() { - if [ ! -f "$STATUS_FILE" ] || [ "$(cat "$STATUS_FILE")" = "false" ]; then - echo "true" > "$STATUS_FILE" - action="enabled" - else - echo "false" > "$STATUS_FILE" - action="disabled" - fi +enable_touchpad() { + printf "true" >"$STATUS_FILE" + notify-send -u low -i $notif "Enabling touchpad" + hyprctl keyword '$TOUCHPAD_ENABLED' "true" -r +} - notify-send -u low -i "$notif" "Touchpad $action" - hyprctl keyword "device[$Touchpad_Device]:enabled" "$(cat "$STATUS_FILE")" +disable_touchpad() { + printf "false" >"$STATUS_FILE" + notify-send -u low -i $notif "Disabling touchpad" + hyprctl keyword '$TOUCHPAD_ENABLED' "false" -r } -toggle_touchpad +if ! [ -f "$STATUS_FILE" ]; then + enable_touchpad +else + if [ $(cat "$STATUS_FILE") = "true" ]; then + disable_touchpad + elif [ $(cat "$STATUS_FILE") = "false" ]; then + enable_touchpad + fi +fi |
