From aa7beb9d88ece969103b86063cd7559fb293b6c2 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 7 Jun 2024 16:33:38 +0900 Subject: Waybar CSS styles clean up Added Kill active window --- config/hypr/scripts/KeyHints.sh | 2 +- config/hypr/scripts/KillActiveProcess.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 config/hypr/scripts/KillActiveProcess.sh (limited to 'config/hypr/scripts') 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 -- cgit v1.2.3 From b6cd460aa15602319bf8227735f8dc242d0d1bae Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sat, 8 Jun 2024 07:40:42 +0900 Subject: setting a variable for QuickEdit (SUPER E) kitty background will now change depending on dark or light theme --- config/hypr/UserScripts/QuickEdit.sh | 24 ++++++++++++++---------- config/hypr/scripts/DarkLight.sh | 16 ++++++++++++++++ config/kitty/kitty.conf | 12 ++++++++---- config/wallust/templates/colors-kitty.conf | 23 +++++++++++++++-------- 4 files changed, 53 insertions(+), 22 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/UserScripts/QuickEdit.sh b/config/hypr/UserScripts/QuickEdit.sh index af5c65d2..da6a8931 100755 --- a/config/hypr/UserScripts/QuickEdit.sh +++ b/config/hypr/UserScripts/QuickEdit.sh @@ -1,6 +1,10 @@ #!/bin/bash # Rofi menu for Quick Edit / View of Settings (SUPER E) +# define your preferred text editor and terminal to use +editor=nano +tty=kitty + configs="$HOME/.config/hypr/configs" UserConfigs="$HOME/.config/hypr/UserConfigs" @@ -21,34 +25,34 @@ main() { choice=$(menu | rofi -i -dmenu -config ~/.config/rofi/config-compact.rasi | cut -d. -f1) case $choice in 1) - kitty -e nano "$UserConfigs/ENVariables.conf" + $tty $editor "$UserConfigs/ENVariables.conf" ;; 2) - kitty -e nano "$UserConfigs/WindowRules.conf" + $tty $editor "$UserConfigs/WindowRules.conf" ;; 3) - kitty -e nano "$UserConfigs/Startup_Apps.conf" + $tty $editor "$UserConfigs/Startup_Apps.conf" ;; 4) - kitty -e nano "$UserConfigs/UserKeybinds.conf" + $tty $editor "$UserConfigs/UserKeybinds.conf" ;; 5) - kitty -e nano "$UserConfigs/Monitors.conf" + $tty $editor "$UserConfigs/Monitors.conf" ;; 6) - kitty -e nano "$UserConfigs/Laptops.conf" + $tty $editor "$UserConfigs/Laptops.conf" ;; 7) - kitty -e nano "$UserConfigs/UserSettings.conf" + $tty $editor "$UserConfigs/UserSettings.conf" ;; 8) - kitty -e nano "$UserConfigs/WorkspaceRules.conf" + $tty $editor "$UserConfigs/WorkspaceRules.conf" ;; 9) - kitty -e nano "$configs/Settings.conf" + $tty $editor "$configs/Settings.conf" ;; 10) - kitty -e nano "$configs/Keybinds.conf" + $tty $editor "$configs/Keybinds.conf" ;; *) ;; 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/kitty/kitty.conf b/config/kitty/kitty.conf index 1437ce07..f8255096 100644 --- a/config/kitty/kitty.conf +++ b/config/kitty/kitty.conf @@ -4,7 +4,7 @@ bold_font auto italic_font auto bold_italic_font auto -background_opacity 0.7 +background_opacity 0.5 confirm_os_window_close 0 scrollback_lines 2000 @@ -12,7 +12,11 @@ wheel_scroll_min_lines 1 enable_audio_bell no -selection_foreground #000000 -selection_background #F5FBFF +selection_foreground none +selection_background none -window_padding_width 4 \ No newline at end of file +window_padding_width 4 + +foreground #dddddd +background #000000 +cursor #dddddd \ No newline at end of file diff --git a/config/wallust/templates/colors-kitty.conf b/config/wallust/templates/colors-kitty.conf index b88fb4c1..92ceb48c 100644 --- a/config/wallust/templates/colors-kitty.conf +++ b/config/wallust/templates/colors-kitty.conf @@ -1,19 +1,26 @@ font_family Fira Code SemiBold -font_size 13.0 -bold_font auto -italic_font auto -bold_italic_font auto +font_size 16.0 +bold_font auto +italic_font auto +bold_italic_font auto +background_opacity 0.5 confirm_os_window_close 0 +scrollback_lines 2000 +wheel_scroll_min_lines 1 + +enable_audio_bell no + +window_padding_width 4 + +selection_foreground none +selection_background none + foreground {{foreground}} background {{background}} -background_opacity 0.7 cursor {{cursor}} -selection_foreground #000000 -selection_background #F5FBFF - active_tab_foreground {{background}} active_tab_background {{foreground}} inactive_tab_foreground {{foreground}} -- cgit v1.2.3 From a1e56128aa7c16d9d147270ad59e7d57fa0597cf Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 9 Jun 2024 08:10:54 +0900 Subject: updated disabling touchpad script --- config/hypr/UserConfigs/Laptops.conf | 8 ++++++++ config/hypr/scripts/TouchPad.sh | 37 ++++++++++++++++++++---------------- 2 files changed, 29 insertions(+), 16 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/UserConfigs/Laptops.conf b/config/hypr/UserConfigs/Laptops.conf index 2f1f2077..1a1226a9 100644 --- a/config/hypr/UserConfigs/Laptops.conf +++ b/config/hypr/UserConfigs/Laptops.conf @@ -7,6 +7,9 @@ $mainMod = SUPER $scriptsDir = $HOME/.config/hypr/scripts $UserConfigs = $HOME/.config/hypr/UserConfigs +# for disabling Touchpad. hyprctl devices to get device name. +$Touchpad_Device=asue1209:00-04f3:319f-touchpad + binde = , xf86KbdBrightnessDown, exec, $scriptsDir/BrightnessKbd.sh --dec #Keyboard brightness Down binde = , xf86KbdBrightnessUp, exec, $scriptsDir/BrightnessKbd.sh --inc #Keyboard brightness up bind = , xf86Launch1, exec, rog-control-center # ASUS Armory crate button @@ -23,6 +26,11 @@ bind = $mainMod CTRL, F6, exec, $scriptsDir/ScreenShot.sh --in5 # Screenshot in bind = $mainMod ALT, F6, exec, $scriptsDir/ScreenShot.sh --in10 # Screenshot in 10 secs bind = ALT, F6, exec, $scriptsDir/ScreenShot.sh --active # Screenshot active window +$TOUCHPAD_ENABLED = true +device { + name = $Touchpad_Device + enabled = $TOUCHPAD_ENABLED +} # Below are useful when you are connecting your laptop in external display # Suggest you edit below for your laptop display # From WIKI This is to disable laptop monitor when lid is closed. 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 -- cgit v1.2.3