Moves from i3 to hypr
This commit is contained in:
parent
6f069d32e1
commit
a186edca69
380 changed files with 23450 additions and 27796 deletions
16
.config/hypr/scripts/AirplaneMode.sh
Executable file
16
.config/hypr/scripts/AirplaneMode.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Airplane Mode. Turning on or off all wifi using rfkill.
|
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
|
||||
# Check if any wireless device is blocked
|
||||
wifi_blocked=$(rfkill list wifi | grep -o "Soft blocked: yes")
|
||||
|
||||
if [ -n "$wifi_blocked" ]; then
|
||||
rfkill unblock wifi
|
||||
notify-send -u low -i "$notif" " Airplane" " mode: OFF"
|
||||
else
|
||||
rfkill block wifi
|
||||
notify-send -u low -i "$notif" " Airplane" " mode: ON"
|
||||
fi
|
||||
74
.config/hypr/scripts/Brightness.sh
Executable file
74
.config/hypr/scripts/Brightness.sh
Executable file
|
|
@ -0,0 +1,74 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Script for Monitor backlights (if supported) using brightnessctl
|
||||
|
||||
iDIR="$HOME/.config/swaync/icons"
|
||||
notification_timeout=1000
|
||||
step=10 # INCREASE/DECREASE BY THIS VALUE
|
||||
|
||||
# Get brightness
|
||||
get_backlight() {
|
||||
brightnessctl -m | cut -d, -f4 | sed 's/%//'
|
||||
}
|
||||
|
||||
# Get icons
|
||||
get_icon() {
|
||||
current=$(get_backlight)
|
||||
if [ "$current" -le "20" ]; then
|
||||
icon="$iDIR/brightness-20.png"
|
||||
elif [ "$current" -le "40" ]; then
|
||||
icon="$iDIR/brightness-40.png"
|
||||
elif [ "$current" -le "60" ]; then
|
||||
icon="$iDIR/brightness-60.png"
|
||||
elif [ "$current" -le "80" ]; then
|
||||
icon="$iDIR/brightness-80.png"
|
||||
else
|
||||
icon="$iDIR/brightness-100.png"
|
||||
fi
|
||||
}
|
||||
|
||||
# Notify
|
||||
notify_user() {
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i $icon "Screen" "Brightness:$current%"
|
||||
}
|
||||
|
||||
# Change brightness
|
||||
change_backlight() {
|
||||
local current_brightness
|
||||
current_brightness=$(get_backlight)
|
||||
|
||||
# Calculate new brightness
|
||||
if [[ "$1" == "+${step}%" ]]; then
|
||||
new_brightness=$((current_brightness + step))
|
||||
elif [[ "$1" == "${step}%-" ]]; then
|
||||
new_brightness=$((current_brightness - step))
|
||||
fi
|
||||
|
||||
# Ensure new brightness is within valid range
|
||||
if (( new_brightness < 5 )); then
|
||||
new_brightness=5
|
||||
elif (( new_brightness > 100 )); then
|
||||
new_brightness=100
|
||||
fi
|
||||
|
||||
brightnessctl set "${new_brightness}%"
|
||||
get_icon
|
||||
current=$new_brightness
|
||||
notify_user
|
||||
}
|
||||
|
||||
# Execute accordingly
|
||||
case "$1" in
|
||||
"--get")
|
||||
get_backlight
|
||||
;;
|
||||
"--inc")
|
||||
change_backlight "+${step}%"
|
||||
;;
|
||||
"--dec")
|
||||
change_backlight "${step}%-"
|
||||
;;
|
||||
*)
|
||||
get_backlight
|
||||
;;
|
||||
esac
|
||||
51
.config/hypr/scripts/BrightnessKbd.sh
Executable file
51
.config/hypr/scripts/BrightnessKbd.sh
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Script for keyboard backlights (if supported) using brightnessctl
|
||||
|
||||
iDIR="$HOME/.config/swaync/icons"
|
||||
|
||||
# Get keyboard brightness
|
||||
get_kbd_backlight() {
|
||||
echo $(brightnessctl -d '*::kbd_backlight' -m | cut -d, -f4)
|
||||
}
|
||||
|
||||
# Get icons
|
||||
get_icon() {
|
||||
current=$(get_kbd_backlight | sed 's/%//')
|
||||
if [ "$current" -le "20" ]; then
|
||||
icon="$iDIR/brightness-20.png"
|
||||
elif [ "$current" -le "40" ]; then
|
||||
icon="$iDIR/brightness-40.png"
|
||||
elif [ "$current" -le "60" ]; then
|
||||
icon="$iDIR/brightness-60.png"
|
||||
elif [ "$current" -le "80" ]; then
|
||||
icon="$iDIR/brightness-80.png"
|
||||
else
|
||||
icon="$iDIR/brightness-100.png"
|
||||
fi
|
||||
}
|
||||
# Notify
|
||||
notify_user() {
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Keyboard" "Brightness:$current%"
|
||||
}
|
||||
|
||||
# Change brightness
|
||||
change_kbd_backlight() {
|
||||
brightnessctl -d *::kbd_backlight set "$1" && get_icon && notify_user
|
||||
}
|
||||
|
||||
# Execute accordingly
|
||||
case "$1" in
|
||||
"--get")
|
||||
get_kbd_backlight
|
||||
;;
|
||||
"--inc")
|
||||
change_kbd_backlight "+30%"
|
||||
;;
|
||||
"--dec")
|
||||
change_kbd_backlight "30%-"
|
||||
;;
|
||||
*)
|
||||
get_kbd_backlight
|
||||
;;
|
||||
esac
|
||||
17
.config/hypr/scripts/ChangeBlur.sh
Executable file
17
.config/hypr/scripts/ChangeBlur.sh
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Script for changing blurs on the fly
|
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
|
||||
STATE=$(hyprctl -j getoption decoration:blur:passes | jq ".int")
|
||||
|
||||
if [ "${STATE}" == "2" ]; then
|
||||
hyprctl keyword decoration:blur:size 2
|
||||
hyprctl keyword decoration:blur:passes 1
|
||||
notify-send -e -u low -i "$notif" " Less Blur"
|
||||
else
|
||||
hyprctl keyword decoration:blur:size 5
|
||||
hyprctl keyword decoration:blur:passes 2
|
||||
notify-send -e -u low -i "$notif" " Normal Blur"
|
||||
fi
|
||||
30
.config/hypr/scripts/ChangeLayout.sh
Executable file
30
.config/hypr/scripts/ChangeLayout.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# for changing Hyprland Layouts (Master or Dwindle) on the fly
|
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
|
||||
LAYOUT=$(hyprctl -j getoption general:layout | jq '.str' | sed 's/"//g')
|
||||
|
||||
case $LAYOUT in
|
||||
"master")
|
||||
hyprctl keyword general:layout dwindle
|
||||
hyprctl keyword unbind SUPER,J
|
||||
hyprctl keyword unbind SUPER,K
|
||||
hyprctl keyword bind SUPER,J,cyclenext
|
||||
hyprctl keyword bind SUPER,K,cyclenext,prev
|
||||
hyprctl keyword bind SUPER,O,togglesplit
|
||||
notify-send -e -u low -i "$notif" " Dwindle Layout"
|
||||
;;
|
||||
"dwindle")
|
||||
hyprctl keyword general:layout master
|
||||
hyprctl keyword unbind SUPER,J
|
||||
hyprctl keyword unbind SUPER,K
|
||||
hyprctl keyword unbind SUPER,O
|
||||
hyprctl keyword bind SUPER,J,layoutmsg,cyclenext
|
||||
hyprctl keyword bind SUPER,K,layoutmsg,cycleprev
|
||||
notify-send -e -u low -i "$notif" " Master Layout"
|
||||
;;
|
||||
*) ;;
|
||||
|
||||
esac
|
||||
45
.config/hypr/scripts/ClipManager.sh
Executable file
45
.config/hypr/scripts/ClipManager.sh
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Clipboard Manager. This script uses cliphist, rofi, and wl-copy.
|
||||
|
||||
# Actions:
|
||||
# CTRL Del to delete an entry
|
||||
# ALT Del to wipe clipboard contents
|
||||
|
||||
# Check if rofi is already running
|
||||
if pidof rofi > /dev/null; then
|
||||
pkill rofi
|
||||
fi
|
||||
|
||||
while true; do
|
||||
result=$(
|
||||
rofi -i -dmenu \
|
||||
-kb-custom-1 "Control-Delete" \
|
||||
-kb-custom-2 "Alt-Delete" \
|
||||
-config ~/.config/rofi/config-clipboard.rasi < <(cliphist list)
|
||||
)
|
||||
|
||||
case "$?" in
|
||||
1)
|
||||
exit
|
||||
;;
|
||||
0)
|
||||
case "$result" in
|
||||
"")
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
cliphist decode <<<"$result" | wl-copy
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
10)
|
||||
cliphist delete <<<"$result"
|
||||
;;
|
||||
11)
|
||||
cliphist wipe
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
252
.config/hypr/scripts/DarkLight.sh
Executable file
252
.config/hypr/scripts/DarkLight.sh
Executable file
|
|
@ -0,0 +1,252 @@
|
|||
#!/bin/bash
|
||||
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# For Dark and Light switching
|
||||
# Note: Scripts are looking for keywords Light or Dark except for wallpapers as the are in a separate folders
|
||||
|
||||
# Paths
|
||||
wallpaper_base_path="$HOME/Pictures/wallpapers/Dynamic-Wallpapers"
|
||||
dark_wallpapers="$wallpaper_base_path/Dark"
|
||||
light_wallpapers="$wallpaper_base_path/Light"
|
||||
hypr_config_path="$HOME/.config/hypr"
|
||||
swaync_style="$HOME/.config/swaync/style.css"
|
||||
ags_style="$HOME/.config/ags/user/style.css"
|
||||
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"
|
||||
|
||||
# kill swaybg if running
|
||||
pkill swaybg
|
||||
|
||||
# Initialize swww if needed
|
||||
swww query || swww-daemon --format xrgb
|
||||
|
||||
# Set swww options
|
||||
swww="swww img"
|
||||
effect="--transition-bezier .43,1.19,1,.4 --transition-fps 60 --transition-type grow --transition-pos 0.925,0.977 --transition-duration 2"
|
||||
|
||||
# Determine current theme mode
|
||||
if [ "$(cat $HOME/.cache/.theme_mode)" = "Light" ]; then
|
||||
next_mode="Dark"
|
||||
# Logic for Dark mode
|
||||
wallpaper_path="$dark_wallpapers"
|
||||
else
|
||||
next_mode="Light"
|
||||
# Logic for Light mode
|
||||
wallpaper_path="$light_wallpapers"
|
||||
fi
|
||||
|
||||
# Function to update theme mode for the next cycle
|
||||
update_theme_mode() {
|
||||
echo "$next_mode" > ~/.cache/.theme_mode
|
||||
}
|
||||
|
||||
# Function to notify user
|
||||
notify_user() {
|
||||
notify-send -u low -i "$notif" " Switching to" " $1 mode"
|
||||
}
|
||||
|
||||
# Use sed to replace the palette setting in the wallust config file
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
sed -i 's/^palette = .*/palette = "'"$pallete_dark"'"/' "$wallust_config"
|
||||
else
|
||||
sed -i 's/^palette = .*/palette = "'"$pallete_light"'"/' "$wallust_config"
|
||||
fi
|
||||
|
||||
# Function to set Waybar style
|
||||
set_waybar_style() {
|
||||
theme="$1"
|
||||
waybar_styles="$HOME/.config/waybar/style"
|
||||
waybar_style_link="$HOME/.config/waybar/style.css"
|
||||
style_prefix="\\[${theme}\\].*\\.css$"
|
||||
|
||||
style_file=$(find "$waybar_styles" -maxdepth 1 -type f -regex ".*$style_prefix" | shuf -n 1)
|
||||
|
||||
if [ -n "$style_file" ]; then
|
||||
ln -sf "$style_file" "$waybar_style_link"
|
||||
else
|
||||
echo "Style file not found for $theme theme."
|
||||
fi
|
||||
}
|
||||
|
||||
# Call the function after determining the mode
|
||||
set_waybar_style "$next_mode"
|
||||
notify_user "$next_mode"
|
||||
|
||||
|
||||
# swaync color change
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.8);/' "${swaync_style}"
|
||||
sed -i '/@define-color noti-bg-alt/s/#.*;/#111111;/' "${swaync_style}"
|
||||
else
|
||||
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.9);/' "${swaync_style}"
|
||||
sed -i '/@define-color noti-bg-alt/s/#.*;/#F0F0F0;/' "${swaync_style}"
|
||||
fi
|
||||
|
||||
# ags color change
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.4);/' "${ags_style}"
|
||||
sed -i '/@define-color text-color/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.7);/' "${ags_style}"
|
||||
sed -i '/@define-color noti-bg-alt/s/#.*;/#111111;/' "${ags_style}"
|
||||
else
|
||||
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.4);/' "${ags_style}"
|
||||
sed -i '/@define-color text-color/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.7);/' "${ags_style}"
|
||||
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
|
||||
|
||||
for pid in $(pidof kitty); do
|
||||
kill -SIGUSR1 "$pid"
|
||||
done
|
||||
|
||||
|
||||
# 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)"
|
||||
else
|
||||
next_wallpaper="$(find "${light_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)"
|
||||
fi
|
||||
|
||||
# Update wallpaper using swww command
|
||||
$swww "${next_wallpaper}" $effect
|
||||
|
||||
|
||||
# Set Kvantum Manager theme & QT5/QT6 settings
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
kvantum_theme="catppuccin-mocha-blue"
|
||||
#qt5ct_color_scheme="$HOME/.config/qt5ct/colors/Catppuccin-Mocha.conf"
|
||||
#qt6ct_color_scheme="$HOME/.config/qt6ct/colors/Catppuccin-Mocha.conf"
|
||||
else
|
||||
kvantum_theme="catppuccin-latte-blue"
|
||||
#qt5ct_color_scheme="$HOME/.config/qt5ct/colors/Catppuccin-Latte.conf"
|
||||
#qt6ct_color_scheme="$HOME/.config/qt6ct/colors/Catppuccin-Latte.conf"
|
||||
fi
|
||||
|
||||
sed -i "s|^color_scheme_path=.*$|color_scheme_path=$qt5ct_color_scheme|" "$HOME/.config/qt5ct/qt5ct.conf"
|
||||
sed -i "s|^color_scheme_path=.*$|color_scheme_path=$qt6ct_color_scheme|" "$HOME/.config/qt6ct/qt6ct.conf"
|
||||
kvantummanager --set "$kvantum_theme"
|
||||
|
||||
|
||||
# set the rofi color for background
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
sed -i '24s/.*/background: rgba(0,0,0,0.7);/' $wallust_rofi
|
||||
else
|
||||
sed -i '24s/.*/background: rgba(255,255,255,0.9);/' $wallust_rofi
|
||||
fi
|
||||
|
||||
|
||||
# GTK themes and icons switching
|
||||
set_custom_gtk_theme() {
|
||||
mode=$1
|
||||
gtk_themes_directory="$HOME/.themes"
|
||||
icon_directory="$HOME/.icons"
|
||||
color_setting="org.gnome.desktop.interface color-scheme"
|
||||
theme_setting="org.gnome.desktop.interface gtk-theme"
|
||||
icon_setting="org.gnome.desktop.interface icon-theme"
|
||||
|
||||
if [ "$mode" == "Light" ]; then
|
||||
search_keywords="*Light*"
|
||||
gsettings set $color_setting 'prefer-light'
|
||||
elif [ "$mode" == "Dark" ]; then
|
||||
search_keywords="*Dark*"
|
||||
gsettings set $color_setting 'prefer-dark'
|
||||
else
|
||||
echo "Invalid mode provided."
|
||||
return 1
|
||||
fi
|
||||
|
||||
themes=()
|
||||
icons=()
|
||||
|
||||
while IFS= read -r -d '' theme_search; do
|
||||
themes+=("$(basename "$theme_search")")
|
||||
done < <(find "$gtk_themes_directory" -maxdepth 1 -type d -iname "$search_keywords" -print0)
|
||||
|
||||
while IFS= read -r -d '' icon_search; do
|
||||
icons+=("$(basename "$icon_search")")
|
||||
done < <(find "$icon_directory" -maxdepth 1 -type d -iname "$search_keywords" -print0)
|
||||
|
||||
if [ ${#themes[@]} -gt 0 ]; then
|
||||
if [ "$mode" == "Dark" ]; then
|
||||
selected_theme=${themes[RANDOM % ${#themes[@]}]}
|
||||
else
|
||||
selected_theme=${themes[$RANDOM % ${#themes[@]}]}
|
||||
fi
|
||||
echo "Selected GTK theme for $mode mode: $selected_theme"
|
||||
gsettings set $theme_setting "$selected_theme"
|
||||
|
||||
# Flatpak GTK apps (themes)
|
||||
if command -v flatpak &> /dev/null; then
|
||||
flatpak --user override --filesystem=$HOME/.themes
|
||||
sleep 0.5
|
||||
flatpak --user override --env=GTK_THEME="$selected_theme"
|
||||
fi
|
||||
else
|
||||
echo "No $mode GTK theme found"
|
||||
fi
|
||||
|
||||
if [ ${#icons[@]} -gt 0 ]; then
|
||||
if [ "$mode" == "Dark" ]; then
|
||||
selected_icon=${icons[RANDOM % ${#icons[@]}]}
|
||||
else
|
||||
selected_icon=${icons[$RANDOM % ${#icons[@]}]}
|
||||
fi
|
||||
echo "Selected icon theme for $mode mode: $selected_icon"
|
||||
gsettings set $icon_setting "$selected_icon"
|
||||
|
||||
## QT5ct icon_theme
|
||||
sed -i "s|^icon_theme=.*$|icon_theme=$selected_icon|" "$HOME/.config/qt5ct/qt5ct.conf"
|
||||
sed -i "s|^icon_theme=.*$|icon_theme=$selected_icon|" "$HOME/.config/qt6ct/qt6ct.conf"
|
||||
|
||||
# Flatpak GTK apps (icons)
|
||||
if command -v flatpak &> /dev/null; then
|
||||
flatpak --user override --filesystem=$HOME/.icons
|
||||
sleep 0.5
|
||||
flatpak --user override --env=ICON_THEME="$selected_icon"
|
||||
fi
|
||||
else
|
||||
echo "No $mode icon theme found"
|
||||
fi
|
||||
}
|
||||
|
||||
# Call the function to set GTK theme and icon theme based on mode
|
||||
set_custom_gtk_theme "$next_mode"
|
||||
|
||||
# Update theme mode for the next cycle
|
||||
update_theme_mode
|
||||
|
||||
|
||||
${SCRIPTSDIR}/WallustSwww.sh &&
|
||||
|
||||
# some process to kill
|
||||
_ps=(waybar rofi swaync ags swaybg)
|
||||
for _prs in "${_ps[@]}"; do
|
||||
if pidof "${_prs}" >/dev/null; then
|
||||
pkill "${_prs}"
|
||||
fi
|
||||
done
|
||||
|
||||
sleep 2
|
||||
${SCRIPTSDIR}/Refresh.sh
|
||||
|
||||
sleep 0.3
|
||||
# Display notifications for theme and icon changes
|
||||
notify-send -u normal -i "$notif" " Themes switched to:" " $next_mode Mode"
|
||||
|
||||
exit 0
|
||||
|
||||
33
.config/hypr/scripts/GameMode.sh
Executable file
33
.config/hypr/scripts/GameMode.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Game Mode. Turning off all animations
|
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
|
||||
|
||||
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
|
||||
if [ "$HYPRGAMEMODE" = 1 ] ; then
|
||||
hyprctl --batch "\
|
||||
keyword animations:enabled 0;\
|
||||
keyword decoration:drop_shadow 0;\
|
||||
keyword decoration:blur:passes 0;\
|
||||
keyword general:gaps_in 0;\
|
||||
keyword general:gaps_out 0;\
|
||||
keyword general:border_size 1;\
|
||||
keyword decoration:rounding 0"
|
||||
|
||||
hyprctl keyword "windowrule opacity 1 override 1 override 1 override, ^(.*)$"
|
||||
swww kill
|
||||
notify-send -e -u low -i "$notif" " Gamemode:" " enabled"
|
||||
exit
|
||||
else
|
||||
swww-daemon --format xrgb && swww img "$HOME/.config/rofi/.current_wallpaper" &
|
||||
sleep 0.1
|
||||
${SCRIPTSDIR}/WallustSwww.sh
|
||||
sleep 0.5
|
||||
${SCRIPTSDIR}/Refresh.sh
|
||||
notify-send -e -u normal -i "$notif" " Gamemode:" " disabled"
|
||||
exit
|
||||
fi
|
||||
hyprctl reload
|
||||
23
.config/hypr/scripts/Hypridle.sh
Executable file
23
.config/hypr/scripts/Hypridle.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# This is for custom version of waybar idle_inhibitor which activates / deactivates hypridle instead
|
||||
|
||||
PROCESS="hypridle"
|
||||
|
||||
if [[ "$1" == "status" ]]; then
|
||||
sleep 1
|
||||
if pgrep -x "$PROCESS" >/dev/null; then
|
||||
echo '{"text": "RUNNING", "class": "active", "tooltip": "idle_inhibitor NOT ACTIVE\nLeft Click: Activate\nRight Click: Lock Screen"}'
|
||||
else
|
||||
echo '{"text": "NOT RUNNING", "class": "notactive", "tooltip": "idle_inhibitor is ACTIVE\nLeft Click: Deactivate\nRight Click: Lock Screen"}'
|
||||
fi
|
||||
elif [[ "$1" == "toggle" ]]; then
|
||||
if pgrep -x "$PROCESS" >/dev/null; then
|
||||
pkill "$PROCESS"
|
||||
else
|
||||
"$PROCESS"
|
||||
fi
|
||||
else
|
||||
echo "Usage: $0 {status|toggle}"
|
||||
exit 1
|
||||
fi
|
||||
34
.config/hypr/scripts/KeyBinds.sh
Executable file
34
.config/hypr/scripts/KeyBinds.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Searchable enabled keybinds using rofi
|
||||
|
||||
# Kill yad to not interfere with this binds
|
||||
pkill yad || true
|
||||
|
||||
# Check if rofi is already running
|
||||
if pidof rofi > /dev/null; then
|
||||
pkill rofi
|
||||
fi
|
||||
|
||||
# Define the config files
|
||||
KEYBINDS_CONF="$HOME/.config/hypr/configs/Keybinds.conf"
|
||||
USER_KEYBINDS_CONF="$HOME/.config/hypr/UserConfigs/UserKeybinds.conf"
|
||||
LAPTOP_CONF="$HOME/.config/hypr/UserConfigs/Laptop.conf"
|
||||
|
||||
# Combine the contents of the keybinds files and filter for keybinds
|
||||
KEYBINDS=$(cat "$KEYBINDS_CONF" "$USER_KEYBINDS_CONF" | grep -E '^(bind|bindl|binde|bindm)')
|
||||
|
||||
# Check if Laptop.conf exists and add its keybinds if present
|
||||
if [[ -f "$LAPTOP_CONF" ]]; then
|
||||
LAPTOP_BINDS=$(grep -E '^(bind|bindl|binde|bindm)' "$LAPTOP_CONF")
|
||||
KEYBINDS+=$'\n'"$LAPTOP_BINDS"
|
||||
fi
|
||||
|
||||
# check for any keybinds to display
|
||||
if [[ -z "$KEYBINDS" ]]; then
|
||||
echo "No keybinds found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use rofi to display the keybinds
|
||||
echo "$KEYBINDS" | rofi -dmenu -i -p "Keybinds" -config ~/.config/rofi/config-keybinds.rasi
|
||||
89
.config/hypr/scripts/KeyHints.sh
Executable file
89
.config/hypr/scripts/KeyHints.sh
Executable file
|
|
@ -0,0 +1,89 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Keyhints. Idea got from Garuda Hyprland
|
||||
|
||||
# GDK BACKEND. Change to either wayland or x11 if having issues
|
||||
BACKEND=wayland
|
||||
|
||||
# Check if rofi is running and kill it if it is
|
||||
if pgrep -x "rofi" > /dev/null; then
|
||||
pkill rofi
|
||||
fi
|
||||
|
||||
# Detect monitor resolution and scale
|
||||
x_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .width')
|
||||
y_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .height')
|
||||
hypr_scale=$(hyprctl -j monitors | jq '.[] | select (.focused == true) | .scale' | sed 's/\.//')
|
||||
|
||||
# Calculate width and height based on percentages and monitor resolution
|
||||
width=$((x_mon * hypr_scale / 100))
|
||||
height=$((y_mon * hypr_scale / 100))
|
||||
|
||||
# Set maximum width and height
|
||||
max_width=1200
|
||||
max_height=1000
|
||||
|
||||
# Set percentage of screen size for dynamic adjustment
|
||||
percentage_width=70
|
||||
percentage_height=70
|
||||
|
||||
# Calculate dynamic width and height
|
||||
dynamic_width=$((width * percentage_width / 100))
|
||||
dynamic_height=$((height * percentage_height / 100))
|
||||
|
||||
# Limit width and height to maximum values
|
||||
dynamic_width=$(($dynamic_width > $max_width ? $max_width : $dynamic_width))
|
||||
dynamic_height=$(($dynamic_height > $max_height ? $max_height : $dynamic_height))
|
||||
|
||||
# Launch yad with calculated width and height
|
||||
GDK_BACKEND=$BACKEND yad --width=$dynamic_width --height=$dynamic_height \
|
||||
--center \
|
||||
--title="Keybindings" \
|
||||
--no-buttons \
|
||||
--list \
|
||||
--column=Key: \
|
||||
--column=Description: \
|
||||
--column=Command: \
|
||||
--timeout-indicator=bottom \
|
||||
"ESC" "close this app" "" "=" "SUPER KEY (Windows Key)" "(SUPER KEY)" \
|
||||
" enter" "Terminal" "(kitty)" \
|
||||
" SHIFT enter" "DropDown Terminal" "(kitty-pyprland)" \
|
||||
" SHIFT K" "Searchable Keybinds" "(Keybinds)" \
|
||||
" A" "Desktop Overview" "(AGS Overview)" \
|
||||
" D" "Application Launcher" "(rofi-wayland)" \
|
||||
" T" "Open File Manager" "(Thunar)" \
|
||||
" S" "Google Search using rofi" "(rofi)" \
|
||||
" Q" "close active window" "(not kill)" \
|
||||
" Shift Q " "kills an active window" "(kill)" \
|
||||
" Z" "Desktop Zoom" "(pyprland)" \
|
||||
" Alt V" "Clipboard Manager" "(cliphist)" \
|
||||
" W" "Choose wallpaper" "(Wallpaper Menu)" \
|
||||
" Shift W" "Choose wallpaper effects" "(imagemagick + swww)" \
|
||||
"CTRL ALT W" "Random wallpaper" "(via swww)" \
|
||||
" B" "Hide/UnHide Waybar" "waybar" \
|
||||
" CTRL B" "Choose waybar styles" "(waybar styles)" \
|
||||
" ALT B" "Choose waybar layout" "(waybar layout)" \
|
||||
" ALT R" "Reload Waybar swaync Rofi" "CHECK NOTIFICATION FIRST!!!" \
|
||||
" SHIFT N" "Launch Notification Panel" "swaync Notification Center" \
|
||||
" Print" "screenshot" "(grim)" \
|
||||
" Shift Print" "screenshot region" "(grim + slurp)" \
|
||||
" Shift S" "screenshot region" "(swappy)" \
|
||||
" CTRL Print" "screenshot timer 5 secs " "(grim)" \
|
||||
" CTRL SHIFT Print" "screenshot timer 10 secs " "(grim)" \
|
||||
"ALT Print" "Screenshot active window" "active window only" \
|
||||
"CTRL ALT P" "power-menu" "(wlogout)" \
|
||||
"CTRL ALT L" "screen lock" "(hyprlock)" \
|
||||
"CTRL ALT Del" "Hyprland Exit" "(SAVE YOUR WORK!!!)" \
|
||||
" F" "Fullscreen" "Toggles to full screen" \
|
||||
" CTL F" "Fake Fullscreen" "Toggles to fake full screen" \
|
||||
" ALT L" "Toggle Dwindle | Master Layout" "Hyprland Layout" \
|
||||
" Shift F" "Toggle float" "single window" \
|
||||
" ALT F" "Toggle all windows to float" "all windows" \
|
||||
" Shift B" "Toggle Blur" "normal or less blur" \
|
||||
" SHIFT G" "Gamemode! All animations OFF or ON" "toggle" \
|
||||
" ALT E" "Rofi Emoticons" "Emoticon" \
|
||||
" ALT V" "Clipboard Manager" "cliphist" \
|
||||
" H" "Launch this app" "" \
|
||||
" E" "View or EDIT Keybinds, Settings, Monitor" "" \
|
||||
"" "" "" \
|
||||
"More tips:" "https://github.com/JaKooLit/Hyprland-Dots/wiki" ""\
|
||||
11
.config/hypr/scripts/KillActiveProcess.sh
Executable file
11
.config/hypr/scripts/KillActiveProcess.sh
Executable file
|
|
@ -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
|
||||
7
.config/hypr/scripts/LockScreen.sh
Executable file
7
.config/hypr/scripts/LockScreen.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
|
||||
# For Hyprlock
|
||||
|
||||
pidof hyprlock || hyprlock -q
|
||||
|
||||
61
.config/hypr/scripts/MediaCtrl.sh
Executable file
61
.config/hypr/scripts/MediaCtrl.sh
Executable file
|
|
@ -0,0 +1,61 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Playerctl
|
||||
|
||||
music_icon="$HOME/.config/swaync/icons/music.png"
|
||||
|
||||
# Play the next track
|
||||
play_next() {
|
||||
playerctl next
|
||||
show_music_notification
|
||||
}
|
||||
|
||||
# Play the previous track
|
||||
play_previous() {
|
||||
playerctl previous
|
||||
show_music_notification
|
||||
}
|
||||
|
||||
# Toggle play/pause
|
||||
toggle_play_pause() {
|
||||
playerctl play-pause
|
||||
show_music_notification
|
||||
}
|
||||
|
||||
# Stop playback
|
||||
stop_playback() {
|
||||
playerctl stop
|
||||
notify-send -e -u low -i $music_icon " Playback:" " Stopped"
|
||||
}
|
||||
|
||||
# Display notification with song information
|
||||
show_music_notification() {
|
||||
status=$(playerctl status)
|
||||
if [[ "$status" == "Playing" ]]; then
|
||||
song_title=$(playerctl metadata title)
|
||||
song_artist=$(playerctl metadata artist)
|
||||
notify-send -e -u low -i $music_icon "Now Playing:" "$song_title by $song_artist"
|
||||
elif [[ "$status" == "Paused" ]]; then
|
||||
notify-send -e -u low -i $music_icon " Playback:" " Paused"
|
||||
fi
|
||||
}
|
||||
|
||||
# Get media control action from command line argument
|
||||
case "$1" in
|
||||
"--nxt")
|
||||
play_next
|
||||
;;
|
||||
"--prv")
|
||||
play_previous
|
||||
;;
|
||||
"--pause")
|
||||
toggle_play_pause
|
||||
;;
|
||||
"--stop")
|
||||
stop_playback
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 [--nxt|--prv|--pause|--stop]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
21
.config/hypr/scripts/Polkit-NixOS.sh
Executable file
21
.config/hypr/scripts/Polkit-NixOS.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# For NixOS starting of polkit-gnome. Dec 2023, the settings stated in NixOS wiki does not work so have to manual start it
|
||||
|
||||
# Find all polkit-gnome executables in the Nix store
|
||||
polkit_gnome_paths=$(find /nix/store -name 'polkit-gnome-authentication-agent-1' -type f 2>/dev/null)
|
||||
|
||||
for polkit_gnome_path in $polkit_gnome_paths; do
|
||||
# Extract the directory containing the executable
|
||||
polkit_gnome_dir=$(dirname "$polkit_gnome_path")
|
||||
|
||||
# Check if the executable is valid and exists
|
||||
if [ -x "$polkit_gnome_dir/polkit-gnome-authentication-agent-1" ]; then
|
||||
# Start the Polkit-GNOME Authentication Agent
|
||||
"$polkit_gnome_dir/polkit-gnome-authentication-agent-1" &
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
# If no valid executable is found, report an error
|
||||
echo "No valid Polkit-GNOME Authentication Agent executable found."
|
||||
33
.config/hypr/scripts/Polkit.sh
Executable file
33
.config/hypr/scripts/Polkit.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# This is for polkits, it will start from top and will stop if the top is executed
|
||||
|
||||
# Polkit possible paths files to check
|
||||
polkit=(
|
||||
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
|
||||
"/usr/libexec/hyprpolkitagent"
|
||||
"/usr/lib/hyprpolkitagent"
|
||||
"/usr/lib/polkit-kde-authentication-agent-1"
|
||||
"/usr/lib/polkit-gnome-authentication-agent-1"
|
||||
"/usr/libexec/polkit-gnome-authentication-agent-1"
|
||||
"/usr/libexec/polkit-mate-authentication-agent-1"
|
||||
"/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1"
|
||||
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"
|
||||
)
|
||||
|
||||
executed=false # Flag to track if a file has been executed
|
||||
|
||||
# Loop through the list of files
|
||||
for file in "${polkit[@]}"; do
|
||||
if [ -e "$file" ]; then
|
||||
echo "File $file found, executing command..."
|
||||
exec "$file"
|
||||
executed=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# If none of the files were found, you can add a fallback command here
|
||||
if [ "$executed" == false ]; then
|
||||
echo "None of the specified files were found. Install a Polkit"
|
||||
fi
|
||||
16
.config/hypr/scripts/PortalHyprland.sh
Executable file
16
.config/hypr/scripts/PortalHyprland.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# For manually starting xdg-desktop-portal-hyprland
|
||||
|
||||
sleep 1
|
||||
killall xdg-desktop-portal-hyprland
|
||||
killall xdg-desktop-portal-wlr
|
||||
killall xdg-desktop-portal-gnome
|
||||
killall xdg-desktop-portal
|
||||
sleep 1
|
||||
/usr/lib/xdg-desktop-portal-hyprland &
|
||||
/usr/libexec/xdg-desktop-portal-hyprland &
|
||||
sleep 2
|
||||
/usr/lib/xdg-desktop-portal &
|
||||
/usr/libexec/xdg-desktop-portal &
|
||||
|
||||
57
.config/hypr/scripts/Refresh.sh
Executable file
57
.config/hypr/scripts/Refresh.sh
Executable file
|
|
@ -0,0 +1,57 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Scripts for refreshing ags, waybar, rofi, swaync, wallust
|
||||
|
||||
SCRIPTSDIR=$HOME/.config/hypr/scripts
|
||||
UserScripts=$HOME/.config/hypr/UserScripts
|
||||
|
||||
# Define file_exists function
|
||||
file_exists() {
|
||||
if [ -e "$1" ]; then
|
||||
return 0 # File exists
|
||||
else
|
||||
return 1 # File does not exist
|
||||
fi
|
||||
}
|
||||
|
||||
# Kill already running processes
|
||||
_ps=(waybar rofi swaync ags)
|
||||
for _prs in "${_ps[@]}"; do
|
||||
if pidof "${_prs}" >/dev/null; then
|
||||
pkill "${_prs}"
|
||||
fi
|
||||
done
|
||||
|
||||
killall -SIGUSR2 waybar # added since wallust sometimes not applying
|
||||
|
||||
# quit ags
|
||||
ags -q
|
||||
|
||||
# relaunch ags
|
||||
ags &
|
||||
|
||||
# Kill waybar & swaync (yet again) # added since wallust sometimes not applying
|
||||
_ps2=(waybar swaync)
|
||||
for _prs2 in "${_ps2[@]}"; do
|
||||
if pidof "${_prs2}" >/dev/null; then
|
||||
killall "${_prs2}"
|
||||
fi
|
||||
done
|
||||
|
||||
# relaunch swaync
|
||||
sleep 0.5
|
||||
swaync > /dev/null 2>&1 &
|
||||
|
||||
#Restart waybar
|
||||
sleep 1
|
||||
waybar &
|
||||
|
||||
# Relaunching rainbow borders if the script exists
|
||||
sleep 1
|
||||
if file_exists "${UserScripts}/RainbowBorders.sh"; then
|
||||
${UserScripts}/RainbowBorders.sh &
|
||||
fi
|
||||
|
||||
|
||||
|
||||
exit 0
|
||||
41
.config/hypr/scripts/RefreshNoWaybar.sh
Executable file
41
.config/hypr/scripts/RefreshNoWaybar.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
|
||||
# Modified version of Refresh.sh but waybar wont refresh
|
||||
# Used by automatic wallpaper change
|
||||
# Modified inorder to refresh rofi background, Wallust, SwayNC only
|
||||
|
||||
SCRIPTSDIR=$HOME/.config/hypr/scripts
|
||||
UserScripts=$HOME/.config/hypr/UserScripts
|
||||
|
||||
# Define file_exists function
|
||||
file_exists() {
|
||||
if [ -e "$1" ]; then
|
||||
return 0 # File exists
|
||||
else
|
||||
return 1 # File does not exist
|
||||
fi
|
||||
}
|
||||
|
||||
# Kill already running processes
|
||||
_ps=(rofi)
|
||||
for _prs in "${_ps[@]}"; do
|
||||
if pidof "${_prs}" >/dev/null; then
|
||||
pkill "${_prs}"
|
||||
fi
|
||||
done
|
||||
|
||||
# quit ags
|
||||
ags -q
|
||||
|
||||
# Wallust refresh
|
||||
${SCRIPTSDIR}/WallustSwww.sh &
|
||||
|
||||
# Relaunching rainbow borders if the script exists
|
||||
sleep 1
|
||||
if file_exists "${UserScripts}/RainbowBorders.sh"; then
|
||||
${UserScripts}/RainbowBorders.sh &
|
||||
fi
|
||||
|
||||
|
||||
exit 0
|
||||
4955
.config/hypr/scripts/RofiEmoji.sh
Executable file
4955
.config/hypr/scripts/RofiEmoji.sh
Executable file
File diff suppressed because it is too large
Load diff
17
.config/hypr/scripts/RofiSearch.sh
Executable file
17
.config/hypr/scripts/RofiSearch.sh
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Modified Script for Google Search
|
||||
# Original Submitted by https://github.com/LeventKaanOguz
|
||||
|
||||
# Opens rofi in dmenu mod and waits for input. Then pushes the input to the query of the URL.
|
||||
|
||||
rofi_config="$HOME/.config/rofi/config-search.rasi"
|
||||
|
||||
# Kill Rofi if already running before execution
|
||||
if pgrep -x "rofi" >/dev/null; then
|
||||
pkill rofi
|
||||
#exit 0
|
||||
fi
|
||||
|
||||
# Open rofi with a dmenu and pass the selected item to xdg-open for Google search
|
||||
echo "" | rofi -dmenu -config "$rofi_config" -p "Search:" | xargs -I{} xdg-open "https://www.google.com/search?q={}"
|
||||
|
||||
156
.config/hypr/scripts/ScreenShot.sh
Executable file
156
.config/hypr/scripts/ScreenShot.sh
Executable file
|
|
@ -0,0 +1,156 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Screenshots scripts
|
||||
|
||||
iDIR="$HOME/.config/swaync/icons"
|
||||
sDIR="$HOME/.config/hypr/scripts"
|
||||
|
||||
time=$(date "+%d-%b_%H-%M-%S")
|
||||
dir="$(xdg-user-dir)/Pictures/Screenshots"
|
||||
file="Screenshot_${time}_${RANDOM}.png"
|
||||
|
||||
active_window_class=$(hyprctl -j activewindow | jq -r '(.class)')
|
||||
active_window_file="Screenshot_${time}_${active_window_class}.png"
|
||||
active_window_path="${dir}/${active_window_file}"
|
||||
|
||||
notify_cmd_base="notify-send -t 10000 -A action1=Open -A action2=Delete -h string:x-canonical-private-synchronous:shot-notify"
|
||||
#notify_swappy="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png"
|
||||
notify_cmd_shot="${notify_cmd_base} -i ${iDIR}/picture.png "
|
||||
notify_cmd_shot_win="${notify_cmd_base} -i ${iDIR}/picture.png "
|
||||
|
||||
# notify and view screenshot
|
||||
notify_view() {
|
||||
if [[ "$1" == "active" ]]; then
|
||||
if [[ -e "${active_window_path}" ]]; then
|
||||
"${sDIR}/Sounds.sh" --screenshot
|
||||
resp=$(timeout 5 ${notify_cmd_shot_win} " Screenshot of:" " ${active_window_class} Saved.")
|
||||
case "$resp" in
|
||||
action1)
|
||||
xdg-open "${active_window_path}" &
|
||||
;;
|
||||
action2)
|
||||
rm "${active_window_path}" &
|
||||
;;
|
||||
esac
|
||||
else
|
||||
${notify_cmd_shot} " Screenshot of:" " ${active_window_class} NOT Saved."
|
||||
"${sDIR}/Sounds.sh" --error
|
||||
fi
|
||||
|
||||
elif [[ "$1" == "swappy" ]]; then
|
||||
"${sDIR}/Sounds.sh" --screenshot
|
||||
resp=$(${notify_cmd_shot} " Screenshot:" " Captured by Swappy")
|
||||
case "$resp" in
|
||||
action1)
|
||||
swappy -f - <"$tmpfile"
|
||||
;;
|
||||
action2)
|
||||
rm "$tmpfile"
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
local check_file="${dir}/${file}"
|
||||
if [[ -e "$check_file" ]]; then
|
||||
"${sDIR}/Sounds.sh" --screenshot
|
||||
resp=$(timeout 5 ${notify_cmd_shot} " Screenshot" " Saved")
|
||||
case "$resp" in
|
||||
action1)
|
||||
xdg-open "${check_file}" &
|
||||
;;
|
||||
action2)
|
||||
rm "${check_file}" &
|
||||
;;
|
||||
esac
|
||||
else
|
||||
${notify_cmd_shot} " Screenshot" " NOT Saved"
|
||||
"${sDIR}/Sounds.sh" --error
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
# countdown
|
||||
countdown() {
|
||||
for sec in $(seq $1 -1 1); do
|
||||
notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR"/timer.png " Taking shot" " in: $sec secs"
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
# take shots
|
||||
shotnow() {
|
||||
cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
sleep 2
|
||||
notify_view
|
||||
}
|
||||
|
||||
shot5() {
|
||||
countdown '5'
|
||||
sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
sleep 1
|
||||
notify_view
|
||||
}
|
||||
|
||||
shot10() {
|
||||
countdown '10'
|
||||
sleep 1 && cd ${dir} && grim - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shotwin() {
|
||||
w_pos=$(hyprctl activewindow | grep 'at:' | cut -d':' -f2 | tr -d ' ' | tail -n1)
|
||||
w_size=$(hyprctl activewindow | grep 'size:' | cut -d':' -f2 | tr -d ' ' | tail -n1 | sed s/,/x/g)
|
||||
cd ${dir} && grim -g "$w_pos $w_size" - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shotarea() {
|
||||
tmpfile=$(mktemp)
|
||||
grim -g "$(slurp)" - >"$tmpfile"
|
||||
if [[ -s "$tmpfile" ]]; then
|
||||
wl-copy <"$tmpfile"
|
||||
mv "$tmpfile" "$dir/$file"
|
||||
fi
|
||||
notify_view
|
||||
}
|
||||
|
||||
shotactive() {
|
||||
active_window_class=$(hyprctl -j activewindow | jq -r '(.class)')
|
||||
active_window_file="Screenshot_${time}_${active_window_class}.png"
|
||||
active_window_path="${dir}/${active_window_file}"
|
||||
|
||||
hyprctl -j activewindow | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | grim -g - "${active_window_path}"
|
||||
sleep 1
|
||||
notify_view "active"
|
||||
}
|
||||
|
||||
shotswappy() {
|
||||
tmpfile=$(mktemp)
|
||||
grim -g "$(slurp)" - >"$tmpfile" && notify_view "swappy"
|
||||
}
|
||||
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
mkdir -p "$dir"
|
||||
fi
|
||||
|
||||
if [[ "$1" == "--now" ]]; then
|
||||
shotnow
|
||||
elif [[ "$1" == "--in5" ]]; then
|
||||
shot5
|
||||
elif [[ "$1" == "--in10" ]]; then
|
||||
shot10
|
||||
elif [[ "$1" == "--win" ]]; then
|
||||
shotwin
|
||||
elif [[ "$1" == "--area" ]]; then
|
||||
shotarea
|
||||
elif [[ "$1" == "--active" ]]; then
|
||||
shotactive
|
||||
elif [[ "$1" == "--swappy" ]]; then
|
||||
shotswappy
|
||||
else
|
||||
echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
77
.config/hypr/scripts/Sounds.sh
Executable file
77
.config/hypr/scripts/Sounds.sh
Executable file
|
|
@ -0,0 +1,77 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# This script is used to play system sounds.
|
||||
# Script is used by Volume.Sh and ScreenShots.sh
|
||||
|
||||
theme="freedesktop" # Set the theme for the system sounds.
|
||||
mute=false # Set to true to mute the system sounds.
|
||||
|
||||
# Mute individual sounds here.
|
||||
muteScreenshots=false
|
||||
muteVolume=false
|
||||
|
||||
# Exit if the system sounds are muted.
|
||||
if [[ "$mute" = true ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Choose the sound to play.
|
||||
if [[ "$1" == "--screenshot" ]]; then
|
||||
if [[ "$muteScreenshots" = true ]]; then
|
||||
exit 0
|
||||
fi
|
||||
soundoption="screen-capture.*"
|
||||
elif [[ "$1" == "--volume" ]]; then
|
||||
if [[ "$muteVolume" = true ]]; then
|
||||
exit 0
|
||||
fi
|
||||
soundoption="audio-volume-change.*"
|
||||
elif [[ "$1" == "--error" ]]; then
|
||||
if [[ "$muteScreenshots" = true ]]; then
|
||||
exit 0
|
||||
fi
|
||||
soundoption="dialog-error.*"
|
||||
else
|
||||
echo -e "Available sounds: --screenshot, --volume, --error"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Set the directory defaults for system sounds.
|
||||
if [ -d "/run/current-system/sw/share/sounds" ]; then
|
||||
systemDIR="/run/current-system/sw/share/sounds" # NixOS
|
||||
else
|
||||
systemDIR="/usr/share/sounds"
|
||||
fi
|
||||
userDIR="$HOME/.local/share/sounds"
|
||||
defaultTheme="freedesktop"
|
||||
|
||||
# Prefer the user's theme, but use the system's if it doesn't exist.
|
||||
sDIR="$systemDIR/$defaultTheme"
|
||||
if [ -d "$userDIR/$theme" ]; then
|
||||
sDIR="$userDIR/$theme"
|
||||
elif [ -d "$systemDIR/$theme" ]; then
|
||||
sDIR="$systemDIR/$theme"
|
||||
fi
|
||||
|
||||
# Get the theme that it inherits.
|
||||
iTheme=$(cat "$sDIR/index.theme" | grep -i "inherits" | cut -d "=" -f 2)
|
||||
iDIR="$sDIR/../$iTheme"
|
||||
|
||||
# Find the sound file and play it.
|
||||
sound_file=$(find $sDIR/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
sound_file=$(find $iDIR/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
sound_file=$(find $userDIR/$defaultTheme/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
sound_file=$(find $systemDIR/$defaultTheme/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
echo "Error: Sound file not found."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# pipewire priority, fallback pulseaudio
|
||||
pw-play "$sound_file" || pa-play "$sound_file"
|
||||
104
.config/hypr/scripts/SwitchKeyboardLayout.sh
Executable file
104
.config/hypr/scripts/SwitchKeyboardLayout.sh
Executable file
|
|
@ -0,0 +1,104 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# This is for changing kb_layouts. Set kb_layouts in $settings_file
|
||||
|
||||
layout_file="$HOME/.cache/kb_layout"
|
||||
settings_file="$HOME/.config/hypr/UserConfigs/UserSettings.conf"
|
||||
notif_icon="$HOME/.config/swaync/images/bell.png"
|
||||
|
||||
# Refined ignore list with patterns or specific device names
|
||||
ignore_patterns=(
|
||||
"--(avrcp)"
|
||||
"Bluetooth Speaker"
|
||||
"Other Device
|
||||
Name"
|
||||
)
|
||||
|
||||
|
||||
# Create layout file with default layout if it does not exist
|
||||
if [ ! -f "$layout_file" ]; then
|
||||
echo "Creating layout file..."
|
||||
default_layout=$(grep 'kb_layout = ' "$settings_file" | cut -d '=' -f 2 | tr -d '[:space:]' | cut -d ',' -f 1 2>/dev/null)
|
||||
default_layout=${default_layout:-"us"} # Default to 'us' layout
|
||||
echo "$default_layout" > "$layout_file"
|
||||
echo "Default layout set to $default_layout"
|
||||
fi
|
||||
|
||||
current_layout=$(cat "$layout_file")
|
||||
echo "Current layout: $current_layout"
|
||||
|
||||
# Read available layouts from settings file
|
||||
if [ -f "$settings_file" ]; then
|
||||
kb_layout_line=$(grep 'kb_layout = ' "$settings_file" | cut -d '=' -f 2)
|
||||
# Remove leading and trailing spaces around each layout
|
||||
kb_layout_line=$(echo "$kb_layout_line" | tr -d '[:space:]')
|
||||
IFS=',' read -r -a layout_mapping <<< "$kb_layout_line"
|
||||
else
|
||||
echo "Settings file not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
layout_count=${#layout_mapping[@]}
|
||||
echo "Number of layouts: $layout_count"
|
||||
|
||||
# Find current layout index and calculate next layout
|
||||
for ((i = 0; i < layout_count; i++)); do
|
||||
if [ "$current_layout" == "${layout_mapping[i]}" ]; then
|
||||
current_index=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
next_index=$(( (current_index + 1) % layout_count ))
|
||||
new_layout="${layout_mapping[next_index]}"
|
||||
echo "Next layout: $new_layout"
|
||||
|
||||
# Function to get keyboard names
|
||||
get_keyboard_names() {
|
||||
hyprctl devices -j | jq -r '.keyboards[].name'
|
||||
}
|
||||
|
||||
# Function to check if a device matches any ignore pattern
|
||||
is_ignored() {
|
||||
local device_name=$1
|
||||
for pattern in "${ignore_patterns[@]}"; do
|
||||
if [[ "$device_name" == *"$pattern"* ]]; then
|
||||
return 0 # Device matches ignore pattern
|
||||
fi
|
||||
done
|
||||
return 1 # Device does not match any ignore pattern
|
||||
}
|
||||
|
||||
# Function to change keyboard layout
|
||||
change_layout() {
|
||||
local error_found=false
|
||||
|
||||
while read -r name; do
|
||||
if is_ignored "$name"; then
|
||||
echo "Skipping ignored device: $name"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Switching layout for $name to $new_layout..."
|
||||
hyprctl switchxkblayout "$name" "$next_index"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error while switching layout for $name." >&2
|
||||
error_found=true
|
||||
fi
|
||||
done <<< "$(get_keyboard_names)"
|
||||
|
||||
$error_found && return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
# Execute layout change and notify
|
||||
if ! change_layout; then
|
||||
notify-send -u low -t 2000 'kb_layout' " Error:" " Layout change failed"
|
||||
echo "Layout change failed." >&2
|
||||
exit 1
|
||||
else
|
||||
notify-send -u low -i "$notif_icon" " kb_layout: $new_layout"
|
||||
echo "Layout change notification sent."
|
||||
fi
|
||||
|
||||
echo "$new_layout" > "$layout_file"
|
||||
32
.config/hypr/scripts/TouchPad.sh
Executable file
32
.config/hypr/scripts/TouchPad.sh
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# For disabling touchpad.
|
||||
# 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
|
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
|
||||
export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
|
||||
|
||||
enable_touchpad() {
|
||||
printf "true" >"$STATUS_FILE"
|
||||
notify-send -u low -i $notif " Enabling" " touchpad"
|
||||
hyprctl keyword '$TOUCHPAD_ENABLED' "true" -r
|
||||
}
|
||||
|
||||
disable_touchpad() {
|
||||
printf "false" >"$STATUS_FILE"
|
||||
notify-send -u low -i $notif " Disabling" " touchpad"
|
||||
hyprctl keyword '$TOUCHPAD_ENABLED' "false" -r
|
||||
}
|
||||
|
||||
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
|
||||
33
.config/hypr/scripts/UptimeNixOS.sh
Executable file
33
.config/hypr/scripts/UptimeNixOS.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
# Script parses /proc/uptime to get the system uptime
|
||||
# and prints it in a human-readable format
|
||||
# This is a workaround for system where `uptime` command is taken from coreutils
|
||||
# where `uptime -p` is not supported
|
||||
|
||||
if [[ -r /proc/uptime ]]; then
|
||||
s=$(< /proc/uptime)
|
||||
s=${s/.*}
|
||||
else
|
||||
echo "Error UptimeNixOS.sh: Uptime could not be determined." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
d="$((s / 60 / 60 / 24)) days"
|
||||
h="$((s / 60 / 60 % 24)) hours"
|
||||
m="$((s / 60 % 60)) minutes"
|
||||
|
||||
# Remove plural if < 2.
|
||||
((${d/ *} == 1)) && d=${d/s}
|
||||
((${h/ *} == 1)) && h=${h/s}
|
||||
((${m/ *} == 1)) && m=${m/s}
|
||||
|
||||
# Hide empty fields.
|
||||
((${d/ *} == 0)) && unset d
|
||||
((${h/ *} == 0)) && unset h
|
||||
((${m/ *} == 0)) && unset m
|
||||
|
||||
uptime=${d:+$d, }${h:+$h, }$m
|
||||
uptime=${uptime%', '}
|
||||
uptime=${uptime:-$s seconds}
|
||||
|
||||
echo "up $uptime"
|
||||
143
.config/hypr/scripts/Volume.sh
Executable file
143
.config/hypr/scripts/Volume.sh
Executable file
|
|
@ -0,0 +1,143 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Scripts for volume controls for audio and mic
|
||||
|
||||
iDIR="$HOME/.config/swaync/icons"
|
||||
sDIR="$HOME/.config/hypr/scripts"
|
||||
|
||||
# Get Volume
|
||||
get_volume() {
|
||||
volume=$(pamixer --get-volume)
|
||||
if [[ "$volume" -eq "0" ]]; then
|
||||
echo "Muted"
|
||||
else
|
||||
echo "$volume %"
|
||||
fi
|
||||
}
|
||||
|
||||
# Get icons
|
||||
get_icon() {
|
||||
current=$(get_volume)
|
||||
if [[ "$current" == "Muted" ]]; then
|
||||
echo "$iDIR/volume-mute.png"
|
||||
elif [[ "${current%\%}" -le 30 ]]; then
|
||||
echo "$iDIR/volume-low.png"
|
||||
elif [[ "${current%\%}" -le 60 ]]; then
|
||||
echo "$iDIR/volume-mid.png"
|
||||
else
|
||||
echo "$iDIR/volume-high.png"
|
||||
fi
|
||||
}
|
||||
|
||||
# Notify
|
||||
notify_user() {
|
||||
if [[ "$(get_volume)" == "Muted" ]]; then
|
||||
notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" " Volume:" " Muted"
|
||||
else
|
||||
notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" " Volume Level:" " $(get_volume)" &&
|
||||
"$sDIR/Sounds.sh" --volume
|
||||
fi
|
||||
}
|
||||
|
||||
# Increase Volume
|
||||
inc_volume() {
|
||||
if [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
toggle_mute
|
||||
else
|
||||
pamixer -i 5 --allow-boost --set-limit 150 && notify_user
|
||||
fi
|
||||
}
|
||||
|
||||
# Decrease Volume
|
||||
dec_volume() {
|
||||
if [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
toggle_mute
|
||||
else
|
||||
pamixer -d 5 && notify_user
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggle Mute
|
||||
toggle_mute() {
|
||||
if [ "$(pamixer --get-mute)" == "false" ]; then
|
||||
pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" " Mute"
|
||||
elif [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
pamixer -u && notify-send -e -u low -i "$(get_icon)" " Volume:" " Switched ON"
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggle Mic
|
||||
toggle_mic() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "false" ]; then
|
||||
pamixer --default-source -m && notify-send -e -u low -i "$iDIR/microphone-mute.png" " Microphone:" " Switched OFF"
|
||||
elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
pamixer -u --default-source u && notify-send -e -u low -i "$iDIR/microphone.png" " Microphone:" " Switched ON"
|
||||
fi
|
||||
}
|
||||
# Get Mic Icon
|
||||
get_mic_icon() {
|
||||
current=$(pamixer --default-source --get-volume)
|
||||
if [[ "$current" -eq "0" ]]; then
|
||||
echo "$iDIR/microphone-mute.png"
|
||||
else
|
||||
echo "$iDIR/microphone.png"
|
||||
fi
|
||||
}
|
||||
|
||||
# Get Microphone Volume
|
||||
get_mic_volume() {
|
||||
volume=$(pamixer --default-source --get-volume)
|
||||
if [[ "$volume" -eq "0" ]]; then
|
||||
echo "Muted"
|
||||
else
|
||||
echo "$volume %"
|
||||
fi
|
||||
}
|
||||
|
||||
# Notify for Microphone
|
||||
notify_mic_user() {
|
||||
volume=$(get_mic_volume)
|
||||
icon=$(get_mic_icon)
|
||||
notify-send -e -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -u low -i "$icon" " Mic Level:" " $volume"
|
||||
}
|
||||
|
||||
# Increase MIC Volume
|
||||
inc_mic_volume() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
toggle_mic
|
||||
else
|
||||
pamixer --default-source -i 5 && notify_mic_user
|
||||
fi
|
||||
}
|
||||
|
||||
# Decrease MIC Volume
|
||||
dec_mic_volume() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
toggle-mic
|
||||
else
|
||||
pamixer --default-source -d 5 && notify_mic_user
|
||||
fi
|
||||
}
|
||||
|
||||
# Execute accordingly
|
||||
if [[ "$1" == "--get" ]]; then
|
||||
get_volume
|
||||
elif [[ "$1" == "--inc" ]]; then
|
||||
inc_volume
|
||||
elif [[ "$1" == "--dec" ]]; then
|
||||
dec_volume
|
||||
elif [[ "$1" == "--toggle" ]]; then
|
||||
toggle_mute
|
||||
elif [[ "$1" == "--toggle-mic" ]]; then
|
||||
toggle_mic
|
||||
elif [[ "$1" == "--get-icon" ]]; then
|
||||
get_icon
|
||||
elif [[ "$1" == "--get-mic-icon" ]]; then
|
||||
get_mic_icon
|
||||
elif [[ "$1" == "--mic-inc" ]]; then
|
||||
inc_mic_volume
|
||||
elif [[ "$1" == "--mic-dec" ]]; then
|
||||
dec_mic_volume
|
||||
else
|
||||
get_volume
|
||||
fi
|
||||
39
.config/hypr/scripts/WallustSwww.sh
Executable file
39
.config/hypr/scripts/WallustSwww.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Wallust Colors for current wallpaper
|
||||
|
||||
# Define the path to the swww cache directory
|
||||
cache_dir="$HOME/.cache/swww/"
|
||||
|
||||
# Get a list of monitor outputs
|
||||
monitor_outputs=($(ls "$cache_dir"))
|
||||
|
||||
# Initialize a flag to determine if the ln command was executed
|
||||
ln_success=false
|
||||
|
||||
# Get current focused monitor
|
||||
current_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}')
|
||||
echo $current_monitor
|
||||
# Construct the full path to the cache file
|
||||
cache_file="$cache_dir$current_monitor"
|
||||
echo $cache_file
|
||||
# Check if the cache file exists for the current monitor output
|
||||
if [ -f "$cache_file" ]; then
|
||||
# Get the wallpaper path from the cache file
|
||||
wallpaper_path=$(grep -v 'Lanczos3' "$cache_file" | head -n 1)
|
||||
echo $wallpaper_path
|
||||
# symlink the wallpaper to the location Rofi can access
|
||||
if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then
|
||||
ln_success=true # Set the flag to true upon successful execution
|
||||
fi
|
||||
# copy the wallpaper for wallpaper effects
|
||||
cp -r "$wallpaper_path" "$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
|
||||
fi
|
||||
|
||||
# Check the flag before executing further commands
|
||||
if [ "$ln_success" = true ]; then
|
||||
# execute wallust
|
||||
echo 'about to execute wallust'
|
||||
# execute wallust skipping tty and terminal changes
|
||||
wallust run "$wallpaper_path" -s &
|
||||
fi
|
||||
38
.config/hypr/scripts/WaybarCava.sh
Executable file
38
.config/hypr/scripts/WaybarCava.sh
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Not my own work. This was added through Github PR. Credit to original author
|
||||
|
||||
#----- Optimized bars animation without much CPU usage increase --------
|
||||
bar="▁▂▃▄▅▆▇█"
|
||||
dict="s/;//g"
|
||||
|
||||
# Calculate the length of the bar outside the loop
|
||||
bar_length=${#bar}
|
||||
|
||||
# Create dictionary to replace char with bar
|
||||
for ((i = 0; i < bar_length; i++)); do
|
||||
dict+=";s/$i/${bar:$i:1}/g"
|
||||
done
|
||||
|
||||
# Create cava config
|
||||
config_file="/tmp/bar_cava_config"
|
||||
cat >"$config_file" <<EOF
|
||||
[general]
|
||||
bars = 10
|
||||
|
||||
[input]
|
||||
method = pulse
|
||||
source = auto
|
||||
|
||||
[output]
|
||||
method = raw
|
||||
raw_target = /dev/stdout
|
||||
data_format = ascii
|
||||
ascii_max_range = 7
|
||||
EOF
|
||||
|
||||
# Kill cava if it's already running
|
||||
pkill -f "cava -p $config_file"
|
||||
|
||||
# Read stdout from cava and perform substitution in a single sed command
|
||||
cava -p "$config_file" | sed -u "$dict"
|
||||
55
.config/hypr/scripts/WaybarLayout.sh
Executable file
55
.config/hypr/scripts/WaybarLayout.sh
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Script for waybar layout or configs
|
||||
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Define directories
|
||||
waybar_layouts="$HOME/.config/waybar/configs"
|
||||
waybar_config="$HOME/.config/waybar/config"
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
rofi_config="$HOME/.config/rofi/config-waybar-layout.rasi"
|
||||
|
||||
# Function to display menu options
|
||||
menu() {
|
||||
options=()
|
||||
while IFS= read -r file; do
|
||||
options+=("$(basename "$file")")
|
||||
done < <(find "$waybar_layouts" -maxdepth 1 -type f -exec basename {} \; | sort)
|
||||
|
||||
printf '%s\n' "${options[@]}"
|
||||
}
|
||||
|
||||
# Apply selected configuration
|
||||
apply_config() {
|
||||
ln -sf "$waybar_layouts/$1" "$waybar_config"
|
||||
#restart_waybar_if_needed
|
||||
"${SCRIPTSDIR}/Refresh.sh" &
|
||||
}
|
||||
|
||||
# Main function
|
||||
main() {
|
||||
choice=$(menu | rofi -i -dmenu -config "$rofi_config")
|
||||
|
||||
if [[ -z "$choice" ]]; then
|
||||
echo "No option selected. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case $choice in
|
||||
"no panel")
|
||||
pgrep -x "waybar" && pkill waybar || true
|
||||
;;
|
||||
*)
|
||||
apply_config "$choice"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Kill Rofi if already running before execution
|
||||
if pgrep -x "rofi" >/dev/null; then
|
||||
pkill rofi
|
||||
#exit 0
|
||||
fi
|
||||
|
||||
main
|
||||
49
.config/hypr/scripts/WaybarStyles.sh
Executable file
49
.config/hypr/scripts/WaybarStyles.sh
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Script for waybar styles
|
||||
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Define directories
|
||||
waybar_styles="$HOME/.config/waybar/style"
|
||||
waybar_style="$HOME/.config/waybar/style.css"
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
rofi_config="$HOME/.config/rofi/config-waybar-style.rasi"
|
||||
|
||||
# Function to display menu options
|
||||
menu() {
|
||||
options=()
|
||||
while IFS= read -r file; do
|
||||
if [ -f "$waybar_styles/$file" ]; then
|
||||
options+=("$(basename "$file" .css)")
|
||||
fi
|
||||
done < <(find "$waybar_styles" -maxdepth 1 -type f -name '*.css' -exec basename {} \; | sort)
|
||||
|
||||
printf '%s\n' "${options[@]}"
|
||||
}
|
||||
|
||||
# Apply selected style
|
||||
apply_style() {
|
||||
ln -sf "$waybar_styles/$1.css" "$waybar_style"
|
||||
"${SCRIPTSDIR}/Refresh.sh" &
|
||||
}
|
||||
|
||||
# Main function
|
||||
main() {
|
||||
choice=$(menu | rofi -i -dmenu -config "$rofi_config")
|
||||
|
||||
if [[ -z "$choice" ]]; then
|
||||
echo "No option selected. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
apply_style "$choice"
|
||||
}
|
||||
|
||||
# Kill Rofi if already running before execution
|
||||
if pgrep -x "rofi" >/dev/null; then
|
||||
pkill rofi
|
||||
#exit 0
|
||||
fi
|
||||
|
||||
main
|
||||
57
.config/hypr/scripts/Wlogout.sh
Executable file
57
.config/hypr/scripts/Wlogout.sh
Executable file
|
|
@ -0,0 +1,57 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# wlogout (Power, Screen Lock, Suspend, etc)
|
||||
|
||||
# Set variables for parameters. First numbers corresponts to Monitor Resolution
|
||||
# i.e 2160 means 2160p
|
||||
A_2160=700
|
||||
B_2160=700
|
||||
A_1600=650
|
||||
B_1600=650
|
||||
A_1440=450
|
||||
B_1440=450
|
||||
A_1080=350
|
||||
B_1080=350
|
||||
A_720=50
|
||||
B_720=50
|
||||
|
||||
# Check if wlogout is already running
|
||||
if pgrep -x "wlogout" > /dev/null; then
|
||||
pkill -x "wlogout"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Detect monitor resolution and scaling factor
|
||||
resolution=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .height / .scale' | awk -F'.' '{print $1}')
|
||||
hypr_scale=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .scale')
|
||||
|
||||
# Set parameters based on screen resolution and scaling factor
|
||||
if ((resolution >= 2160)); then
|
||||
T_val=$(awk "BEGIN {printf \"%.0f\", $A_2160 * 2160 * $hypr_scale / $resolution}")
|
||||
B_val=$(awk "BEGIN {printf \"%.0f\", $B_2160 * 2160 * $hypr_scale / $resolution}")
|
||||
echo "Setting parameters for resolution >= 4k"
|
||||
wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
|
||||
elif ((resolution >= 1600 && resolution < 2160)); then
|
||||
T_val=$(awk "BEGIN {printf \"%.0f\", $A_1600 * 1600 * $hypr_scale / $resolution}")
|
||||
B_val=$(awk "BEGIN {printf \"%.0f\", $B_1600 * 1600 * $hypr_scale / $resolution}")
|
||||
echo "Setting parameters for resolution >= 2.5k and < 4k"
|
||||
wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
|
||||
elif ((resolution >= 1440 && resolution < 1600)); then
|
||||
T_val=$(awk "BEGIN {printf \"%.0f\", $A_1440 * 1440 * $hypr_scale / $resolution}")
|
||||
B_val=$(awk "BEGIN {printf \"%.0f\", $B_1440 * 1440 * $hypr_scale / $resolution}")
|
||||
echo "Setting parameters for resolution >= 2k and < 2.5k"
|
||||
wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
|
||||
elif ((resolution >= 1080 && resolution < 1440)); then
|
||||
T_val=$(awk "BEGIN {printf \"%.0f\", $A_1080 * 1080 * $hypr_scale / $resolution}")
|
||||
B_val=$(awk "BEGIN {printf \"%.0f\", $B_1080 * 1080 * $hypr_scale / $resolution}")
|
||||
echo "Setting parameters for resolution >= 1080p and < 2k"
|
||||
wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
|
||||
elif ((resolution >= 720 && resolution < 1080)); then
|
||||
T_val=$(awk "BEGIN {printf \"%.0f\", $A_720 * 720 * $hypr_scale / $resolution}")
|
||||
B_val=$(awk "BEGIN {printf \"%.0f\", $B_720 * 720 * $hypr_scale / $resolution}")
|
||||
echo "Setting parameters for resolution >= 720p and < 1080p"
|
||||
wlogout --protocol layer-shell -b 3 -T $T_val -B $B_val &
|
||||
else
|
||||
echo "Setting default parameters"
|
||||
wlogout &
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue