Initial commit
This commit is contained in:
16
scripts/AirplaneMode.sh
Executable file
16
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/ja.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
|
||||
31
scripts/Animations.sh
Executable file
31
scripts/Animations.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# For applying Animations from different users
|
||||
|
||||
# Check if rofi is already running
|
||||
if pidof rofi > /dev/null; then
|
||||
pkill rofi
|
||||
fi
|
||||
|
||||
# Variables
|
||||
iDIR="$HOME/.config/swaync/images"
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
animations_dir="$HOME/.config/hypr/animations"
|
||||
UserConfigs="$HOME/.config/hypr/UserConfigs"
|
||||
rofi_theme="$HOME/.config/rofi/config-Animations.rasi"
|
||||
msg='❗NOTE:❗ This will copy animations into UserAnimations.conf'
|
||||
# list of animation files, sorted alphabetically with numbers first
|
||||
animations_list=$(find -L "$animations_dir" -maxdepth 1 -type f | sed 's/.*\///' | sed 's/\.conf$//' | sort -V)
|
||||
|
||||
# Rofi Menu
|
||||
chosen_file=$(echo "$animations_list" | rofi -i -dmenu -config $rofi_theme -mesg "$msg")
|
||||
|
||||
# Check if a file was selected
|
||||
if [[ -n "$chosen_file" ]]; then
|
||||
full_path="$animations_dir/$chosen_file.conf"
|
||||
cp "$full_path" "$UserConfigs/UserAnimations.conf"
|
||||
notify-send -u low -i "$iDIR/ja.png" "$chosen_file" "Hyprland Animation Loaded"
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
"$SCRIPTSDIR/RefreshNoWaybar.sh"
|
||||
9
scripts/Battery.sh
Normal file
9
scripts/Battery.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in {0..3}; do
|
||||
if [ -f /sys/class/power_supply/BAT$i/capacity ]; then
|
||||
battery_level=$(cat /sys/class/power_supply/BAT$i/status)
|
||||
battery_capacity=$(cat /sys/class/power_supply/BAT$i/capacity)
|
||||
echo "Battery: $battery_capacity% ($battery_level)"
|
||||
fi
|
||||
done
|
||||
69
scripts/Brightness.sh
Executable file
69
scripts/Brightness.sh
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/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 current brightness as an integer (without %)
|
||||
get_brightness() {
|
||||
brightnessctl -m | cut -d, -f4 | tr -d '%'
|
||||
}
|
||||
|
||||
# Determine the icon based on brightness level
|
||||
get_icon_path() {
|
||||
local brightness=$1
|
||||
local level=$(( (brightness + 19) / 20 * 20 )) # Round up to next 20
|
||||
if (( level > 100 )); then
|
||||
level=100
|
||||
fi
|
||||
echo "$iDIR/brightness-${level}.png"
|
||||
}
|
||||
|
||||
# Send notification
|
||||
send_notification() {
|
||||
local brightness=$1
|
||||
local icon_path=$2
|
||||
|
||||
notify-send -e \
|
||||
-h string:x-canonical-private-synchronous:brightness_notif \
|
||||
-h int:value:"$brightness" \
|
||||
-u low \
|
||||
-i "$icon_path" \
|
||||
"Screen" "Brightness: ${brightness}%"
|
||||
}
|
||||
|
||||
# Change brightness and notify
|
||||
change_brightness() {
|
||||
local delta=$1
|
||||
local current new icon
|
||||
|
||||
current=$(get_brightness)
|
||||
new=$((current + delta))
|
||||
|
||||
# Clamp between 5 and 100
|
||||
(( new < 5 )) && new=5
|
||||
(( new > 100 )) && new=100
|
||||
|
||||
brightnessctl set "${new}%"
|
||||
|
||||
icon=$(get_icon_path "$new")
|
||||
send_notification "$new" "$icon"
|
||||
}
|
||||
|
||||
# Main
|
||||
case "$1" in
|
||||
"--get")
|
||||
get_brightness
|
||||
;;
|
||||
"--inc")
|
||||
change_brightness "$step"
|
||||
;;
|
||||
"--dec")
|
||||
change_brightness "-$step"
|
||||
;;
|
||||
*)
|
||||
get_brightness
|
||||
;;
|
||||
esac
|
||||
51
scripts/BrightnessKbd.sh
Executable file
51
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 -h boolean:SWAYNC_BYPASS_DND:true -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
scripts/ChangeBlur.sh
Executable file
17
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"
|
||||
|
||||
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/note.png" " Less Blur"
|
||||
else
|
||||
hyprctl keyword decoration:blur:size 5
|
||||
hyprctl keyword decoration:blur:passes 2
|
||||
notify-send -e -u low -i "$notif/ja.png" " Normal Blur"
|
||||
fi
|
||||
30
scripts/ChangeLayout.sh
Executable file
30
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/ja.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
|
||||
49
scripts/ClipManager.sh
Executable file
49
scripts/ClipManager.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Clipboard Manager. This script uses cliphist, rofi, and wl-copy.
|
||||
|
||||
# Variables
|
||||
rofi_theme="$HOME/.config/rofi/config-clipboard.rasi"
|
||||
msg='👀 **note** CTRL DEL = cliphist del (entry) or ALT DEL - cliphist wipe (all)'
|
||||
# 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 $rofi_theme < <(cliphist list) \
|
||||
-mesg "$msg"
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
254
scripts/DarkLight.sh
Executable file
254
scripts/DarkLight.sh
Executable file
@@ -0,0 +1,254 @@
|
||||
#!/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 directories
|
||||
|
||||
# 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"
|
||||
|
||||
# intial kill process
|
||||
for pid in waybar rofi swaync ags swaybg; do
|
||||
killall -SIGUSR1 "$pid"
|
||||
done
|
||||
|
||||
|
||||
# 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" > "$HOME/.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 -L "$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 command -v ags >/dev/null 2>&1; then
|
||||
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
|
||||
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_kitty in $(pidof kitty); do
|
||||
kill -SIGUSR1 "$pid_kitty"
|
||||
done
|
||||
|
||||
# Set Dynamic Wallpaper for Dark or Light Mode
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
next_wallpaper="$(find -L "${dark_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)"
|
||||
else
|
||||
next_wallpaper="$(find -L "${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 '/^background:/s/.*/background: rgba(0,0,0,0.7);/' $wallust_rofi
|
||||
else
|
||||
sed -i '/^background:/s/.*/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 &&
|
||||
|
||||
sleep 2
|
||||
# kill process
|
||||
for pid1 in waybar rofi swaync ags swaybg; do
|
||||
killall "$pid1"
|
||||
done
|
||||
|
||||
sleep 1
|
||||
${SCRIPTSDIR}/Refresh.sh
|
||||
|
||||
sleep 0.5
|
||||
# Display notifications for theme and icon changes
|
||||
notify-send -u low -i "$notif" " Themes switched to:" " $next_mode Mode"
|
||||
|
||||
exit 0
|
||||
|
||||
40
scripts/Distro_update.sh
Executable file
40
scripts/Distro_update.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Simple bash script to check and will try to update your system
|
||||
|
||||
# Local Paths
|
||||
iDIR="$HOME/.config/swaync/images"
|
||||
|
||||
# Check for required tools (kitty)
|
||||
if ! command -v kitty &> /dev/null; then
|
||||
notify-send -i "$iDIR/error.png" "Need Kitty:" "Kitty terminal not found. Please install Kitty terminal."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Detect distribution and update accordingly
|
||||
if command -v paru &> /dev/null || command -v yay &> /dev/null; then
|
||||
# Arch-based
|
||||
if command -v paru &> /dev/null; then
|
||||
kitty -T update paru -Syu
|
||||
notify-send -i "$iDIR/ja.png" -u low 'Arch-based system' 'has been updated.'
|
||||
else
|
||||
kitty -T update yay -Syu
|
||||
notify-send -i "$iDIR/ja.png" -u low 'Arch-based system' 'has been updated.'
|
||||
fi
|
||||
elif command -v dnf &> /dev/null; then
|
||||
# Fedora-based
|
||||
kitty -T update sudo dnf update --refresh -y
|
||||
notify-send -i "$iDIR/ja.png" -u low 'Fedora system' 'has been updated.'
|
||||
elif command -v apt &> /dev/null; then
|
||||
# Debian-based (Debian, Ubuntu, etc.)
|
||||
kitty -T update sudo apt update && sudo apt upgrade -y
|
||||
notify-send -i "$iDIR/ja.png" -u low 'Debian/Ubuntu system' 'has been updated.'
|
||||
elif command -v zypper &> /dev/null; then
|
||||
# openSUSE-based
|
||||
kitty -T update sudo zypper dup -y
|
||||
notify-send -i "$iDIR/ja.png" -u low 'openSUSE system' 'has been updated.'
|
||||
else
|
||||
# Unsupported distro
|
||||
notify-send -i "$iDIR/error.png" -u critical "Unsupported system" "This script does not support your distribution."
|
||||
exit 1
|
||||
fi
|
||||
380
scripts/Dropterminal.sh
Executable file
380
scripts/Dropterminal.sh
Executable file
@@ -0,0 +1,380 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
#
|
||||
# Made and brought to by Kiran George
|
||||
# /* -- ✨ https://github.com/SherLock707 ✨ -- */ ##
|
||||
# Dropdown Terminal
|
||||
# Usage: ./Dropdown.sh [-d] <terminal_command>
|
||||
# Example: ./Dropdown.sh foot
|
||||
# ./Dropdown.sh -d foot (with debug output)
|
||||
# ./Dropdown.sh "kitty -e zsh"
|
||||
# ./Dropdown.sh "alacritty --working-directory /home/user"
|
||||
|
||||
DEBUG=false
|
||||
SPECIAL_WS="special:scratchpad"
|
||||
ADDR_FILE="/tmp/dropdown_terminal_addr"
|
||||
|
||||
# Dropdown size and position configuration (percentages)
|
||||
WIDTH_PERCENT=50 # Width as percentage of screen width
|
||||
HEIGHT_PERCENT=50 # Height as percentage of screen height
|
||||
Y_PERCENT=5 # Y position as percentage from top (X is auto-centered)
|
||||
|
||||
# Animation settings
|
||||
ANIMATION_DURATION=100 # milliseconds
|
||||
SLIDE_STEPS=5
|
||||
SLIDE_DELAY=5 # milliseconds between steps
|
||||
|
||||
# Parse arguments
|
||||
if [ "$1" = "-d" ]; then
|
||||
DEBUG=true
|
||||
shift
|
||||
fi
|
||||
|
||||
TERMINAL_CMD="$1"
|
||||
|
||||
# Debug echo function
|
||||
debug_echo() {
|
||||
if [ "$DEBUG" = true ]; then
|
||||
echo "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
# Validate input
|
||||
if [ -z "$TERMINAL_CMD" ]; then
|
||||
echo "Missing terminal command. Usage: $0 [-d] <terminal_command>"
|
||||
echo "Examples:"
|
||||
echo " $0 foot"
|
||||
echo " $0 -d foot (with debug output)"
|
||||
echo " $0 'kitty -e zsh'"
|
||||
echo " $0 'alacritty --working-directory /home/user'"
|
||||
echo ""
|
||||
echo "Edit the script to modify size and position:"
|
||||
echo " WIDTH_PERCENT - Width as percentage of screen (default: 50)"
|
||||
echo " HEIGHT_PERCENT - Height as percentage of screen (default: 50)"
|
||||
echo " Y_PERCENT - Y position from top as percentage (default: 5)"
|
||||
echo " Note: X position is automatically centered"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Function to get window geometry
|
||||
get_window_geometry() {
|
||||
local addr="$1"
|
||||
hyprctl clients -j | jq -r --arg ADDR "$addr" '.[] | select(.address == $ADDR) | "\(.at[0]) \(.at[1]) \(.size[0]) \(.size[1])"'
|
||||
}
|
||||
|
||||
# Function to animate window slide down (show)
|
||||
animate_slide_down() {
|
||||
local addr="$1"
|
||||
local target_x="$2"
|
||||
local target_y="$3"
|
||||
local width="$4"
|
||||
local height="$5"
|
||||
|
||||
debug_echo "Animating slide down for window $addr to position $target_x,$target_y"
|
||||
|
||||
# Start position (above screen)
|
||||
local start_y=$((target_y - height - 50))
|
||||
|
||||
# Calculate step size
|
||||
local step_y=$(((target_y - start_y) / SLIDE_STEPS))
|
||||
|
||||
# Move window to start position instantly (off-screen)
|
||||
hyprctl dispatch movewindowpixel "exact $target_x $start_y,address:$addr" >/dev/null 2>&1
|
||||
sleep 0.05
|
||||
|
||||
# Animate slide down
|
||||
for i in $(seq 1 $SLIDE_STEPS); do
|
||||
local current_y=$((start_y + (step_y * i)))
|
||||
hyprctl dispatch movewindowpixel "exact $target_x $current_y,address:$addr" >/dev/null 2>&1
|
||||
sleep 0.03
|
||||
done
|
||||
|
||||
# Ensure final position is exact
|
||||
hyprctl dispatch movewindowpixel "exact $target_x $target_y,address:$addr" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Function to animate window slide up (hide)
|
||||
animate_slide_up() {
|
||||
local addr="$1"
|
||||
local start_x="$2"
|
||||
local start_y="$3"
|
||||
local width="$4"
|
||||
local height="$5"
|
||||
|
||||
debug_echo "Animating slide up for window $addr from position $start_x,$start_y"
|
||||
|
||||
# End position (above screen)
|
||||
local end_y=$((start_y - height - 50))
|
||||
|
||||
# Calculate step size
|
||||
local step_y=$(((start_y - end_y) / SLIDE_STEPS))
|
||||
|
||||
# Animate slide up
|
||||
for i in $(seq 1 $SLIDE_STEPS); do
|
||||
local current_y=$((start_y - (step_y * i)))
|
||||
hyprctl dispatch movewindowpixel "exact $start_x $current_y,address:$addr" >/dev/null 2>&1
|
||||
sleep 0.03
|
||||
done
|
||||
|
||||
debug_echo "Slide up animation completed"
|
||||
}
|
||||
|
||||
# Function to get monitor info including scale and name of focused monitor
|
||||
get_monitor_info() {
|
||||
local monitor_data=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.x) \(.y) \(.width) \(.height) \(.scale) \(.name)"')
|
||||
if [ -z "$monitor_data" ] || [[ "$monitor_data" =~ ^null ]]; then
|
||||
debug_echo "Error: Could not get focused monitor information"
|
||||
return 1
|
||||
fi
|
||||
echo "$monitor_data"
|
||||
}
|
||||
|
||||
# Function to calculate dropdown position with proper scaling and centering
|
||||
calculate_dropdown_position() {
|
||||
local monitor_info=$(get_monitor_info)
|
||||
|
||||
if [ $? -ne 0 ] || [ -z "$monitor_info" ]; then
|
||||
debug_echo "Error: Failed to get monitor info, using fallback values"
|
||||
echo "100 100 800 600 fallback-monitor"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local mon_x=$(echo $monitor_info | cut -d' ' -f1)
|
||||
local mon_y=$(echo $monitor_info | cut -d' ' -f2)
|
||||
local mon_width=$(echo $monitor_info | cut -d' ' -f3)
|
||||
local mon_height=$(echo $monitor_info | cut -d' ' -f4)
|
||||
local mon_scale=$(echo $monitor_info | cut -d' ' -f5)
|
||||
local mon_name=$(echo $monitor_info | cut -d' ' -f6)
|
||||
|
||||
debug_echo "Monitor info: x=$mon_x, y=$mon_y, width=$mon_width, height=$mon_height, scale=$mon_scale"
|
||||
|
||||
# Validate scale value and provide fallback
|
||||
if [ -z "$mon_scale" ] || [ "$mon_scale" = "null" ] || [ "$mon_scale" = "0" ]; then
|
||||
debug_echo "Invalid scale value, using 1.0 as fallback"
|
||||
mon_scale="1.0"
|
||||
fi
|
||||
|
||||
# Calculate logical dimensions by dividing physical dimensions by scale
|
||||
local logical_width logical_height
|
||||
if command -v bc >/dev/null 2>&1; then
|
||||
# Use bc for precise floating point calculation
|
||||
logical_width=$(echo "scale=0; $mon_width / $mon_scale" | bc | cut -d'.' -f1)
|
||||
logical_height=$(echo "scale=0; $mon_height / $mon_scale" | bc | cut -d'.' -f1)
|
||||
else
|
||||
# Fallback to integer math (multiply by 100 for precision, then divide)
|
||||
local scale_int=$(echo "$mon_scale" | sed 's/\.//' | sed 's/^0*//')
|
||||
if [ -z "$scale_int" ]; then scale_int=100; fi
|
||||
|
||||
logical_width=$(((mon_width * 100) / scale_int))
|
||||
logical_height=$(((mon_height * 100) / scale_int))
|
||||
fi
|
||||
|
||||
# Ensure we have valid integer values
|
||||
if ! [[ "$logical_width" =~ ^-?[0-9]+$ ]]; then logical_width=$mon_width; fi
|
||||
if ! [[ "$logical_height" =~ ^-?[0-9]+$ ]]; then logical_height=$mon_height; fi
|
||||
|
||||
debug_echo "Physical resolution: ${mon_width}x${mon_height}"
|
||||
debug_echo "Logical resolution: ${logical_width}x${logical_height} (physical ÷ scale)"
|
||||
|
||||
# Calculate window dimensions based on LOGICAL space percentages
|
||||
local width=$((logical_width * WIDTH_PERCENT / 100))
|
||||
local height=$((logical_height * HEIGHT_PERCENT / 100))
|
||||
|
||||
# Calculate Y position from top based on percentage of LOGICAL height
|
||||
local y_offset=$((logical_height * Y_PERCENT / 100))
|
||||
|
||||
# Calculate centered X position in LOGICAL space
|
||||
local x_offset=$(((logical_width - width) / 2))
|
||||
|
||||
# Apply monitor offset to get final positions in logical coordinates
|
||||
local final_x=$((mon_x + x_offset))
|
||||
local final_y=$((mon_y + y_offset))
|
||||
|
||||
debug_echo "Window size: ${width}x${height} (logical pixels)"
|
||||
debug_echo "Final position: x=$final_x, y=$final_y (logical coordinates)"
|
||||
debug_echo "Hyprland will scale these to physical coordinates automatically"
|
||||
|
||||
echo "$final_x $final_y $width $height $mon_name"
|
||||
}
|
||||
|
||||
# Get the current workspace
|
||||
CURRENT_WS=$(hyprctl activeworkspace -j | jq -r '.id')
|
||||
|
||||
# Function to get stored terminal address
|
||||
get_terminal_address() {
|
||||
if [ -f "$ADDR_FILE" ] && [ -s "$ADDR_FILE" ]; then
|
||||
cut -d' ' -f1 "$ADDR_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to get stored monitor name
|
||||
get_terminal_monitor() {
|
||||
if [ -f "$ADDR_FILE" ] && [ -s "$ADDR_FILE" ]; then
|
||||
cut -d' ' -f2- "$ADDR_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to check if terminal exists
|
||||
terminal_exists() {
|
||||
local addr=$(get_terminal_address)
|
||||
if [ -n "$addr" ]; then
|
||||
hyprctl clients -j | jq -e --arg ADDR "$addr" 'any(.[]; .address == $ADDR)' >/dev/null 2>&1
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to check if terminal is in special workspace
|
||||
terminal_in_special() {
|
||||
local addr=$(get_terminal_address)
|
||||
if [ -n "$addr" ]; then
|
||||
hyprctl clients -j | jq -e --arg ADDR "$addr" 'any(.[]; .address == $ADDR and .workspace.name == "special:scratchpad")' >/dev/null 2>&1
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to spawn terminal and capture its address
|
||||
spawn_terminal() {
|
||||
debug_echo "Creating new dropdown terminal with command: $TERMINAL_CMD"
|
||||
|
||||
# Calculate dropdown position for later use
|
||||
local pos_info=$(calculate_dropdown_position)
|
||||
if [ $? -ne 0 ]; then
|
||||
debug_echo "Warning: Using fallback positioning"
|
||||
fi
|
||||
|
||||
local target_x=$(echo $pos_info | cut -d' ' -f1)
|
||||
local target_y=$(echo $pos_info | cut -d' ' -f2)
|
||||
local width=$(echo $pos_info | cut -d' ' -f3)
|
||||
local height=$(echo $pos_info | cut -d' ' -f4)
|
||||
local monitor_name=$(echo $pos_info | cut -d' ' -f5)
|
||||
|
||||
debug_echo "Target position: ${target_x},${target_y}, size: ${width}x${height}"
|
||||
|
||||
# Get window count before spawning
|
||||
local windows_before=$(hyprctl clients -j)
|
||||
local count_before=$(echo "$windows_before" | jq 'length')
|
||||
|
||||
# Launch terminal directly in special workspace to avoid visible spawn
|
||||
hyprctl dispatch exec "[float; size $width $height; workspace special:scratchpad silent] $TERMINAL_CMD"
|
||||
|
||||
# Wait for window to appear
|
||||
sleep 0.1
|
||||
|
||||
# Get windows after spawning
|
||||
local windows_after=$(hyprctl clients -j)
|
||||
local count_after=$(echo "$windows_after" | jq 'length')
|
||||
|
||||
local new_addr=""
|
||||
|
||||
if [ "$count_after" -gt "$count_before" ]; then
|
||||
# Find the new window by comparing before/after lists
|
||||
new_addr=$(comm -13 \
|
||||
<(echo "$windows_before" | jq -r '.[].address' | sort) \
|
||||
<(echo "$windows_after" | jq -r '.[].address' | sort) \
|
||||
| head -1)
|
||||
fi
|
||||
|
||||
# Fallback: try to find by the most recently mapped window
|
||||
if [ -z "$new_addr" ] || [ "$new_addr" = "null" ]; then
|
||||
new_addr=$(hyprctl clients -j | jq -r 'sort_by(.focusHistoryID) | .[-1] | .address')
|
||||
fi
|
||||
|
||||
if [ -n "$new_addr" ] && [ "$new_addr" != "null" ]; then
|
||||
# Store the address and monitor name
|
||||
echo "$new_addr $monitor_name" > "$ADDR_FILE"
|
||||
debug_echo "Terminal created with address: $new_addr in special workspace on monitor $monitor_name"
|
||||
|
||||
# Small delay to ensure it's properly in special workspace
|
||||
sleep 0.2
|
||||
|
||||
# Now bring it back with the same animation as subsequent shows
|
||||
# Use movetoworkspacesilent to avoid affecting workspace history
|
||||
hyprctl dispatch movetoworkspacesilent "$CURRENT_WS,address:$new_addr"
|
||||
hyprctl dispatch pin "address:$new_addr"
|
||||
animate_slide_down "$new_addr" "$target_x" "$target_y" "$width" "$height"
|
||||
|
||||
return 0
|
||||
fi
|
||||
|
||||
debug_echo "Failed to get terminal address"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Main logic
|
||||
if terminal_exists; then
|
||||
TERMINAL_ADDR=$(get_terminal_address)
|
||||
debug_echo "Found existing terminal: $TERMINAL_ADDR"
|
||||
focused_monitor=$(get_monitor_info | awk '{print $6}')
|
||||
dropdown_monitor=$(get_terminal_monitor)
|
||||
if [ "$focused_monitor" != "$dropdown_monitor" ]; then
|
||||
debug_echo "Monitor focus changed: moving dropdown to $focused_monitor"
|
||||
# Calculate new position for focused monitor
|
||||
pos_info=$(calculate_dropdown_position)
|
||||
target_x=$(echo $pos_info | cut -d' ' -f1)
|
||||
target_y=$(echo $pos_info | cut -d' ' -f2)
|
||||
width=$(echo $pos_info | cut -d' ' -f3)
|
||||
height=$(echo $pos_info | cut -d' ' -f4)
|
||||
monitor_name=$(echo $pos_info | cut -d' ' -f5)
|
||||
# Move and resize window
|
||||
hyprctl dispatch movewindowpixel "exact $target_x $target_y,address:$TERMINAL_ADDR"
|
||||
hyprctl dispatch resizewindowpixel "exact $width $height,address:$TERMINAL_ADDR"
|
||||
# Update ADDR_FILE
|
||||
echo "$TERMINAL_ADDR $monitor_name" > "$ADDR_FILE"
|
||||
fi
|
||||
|
||||
if terminal_in_special; then
|
||||
debug_echo "Bringing terminal from scratchpad with slide down animation"
|
||||
|
||||
# Calculate target position
|
||||
pos_info=$(calculate_dropdown_position)
|
||||
target_x=$(echo $pos_info | cut -d' ' -f1)
|
||||
target_y=$(echo $pos_info | cut -d' ' -f2)
|
||||
width=$(echo $pos_info | cut -d' ' -f3)
|
||||
height=$(echo $pos_info | cut -d' ' -f4)
|
||||
|
||||
# Use movetoworkspacesilent to avoid affecting workspace history
|
||||
hyprctl dispatch movetoworkspacesilent "$CURRENT_WS,address:$TERMINAL_ADDR"
|
||||
hyprctl dispatch pin "address:$TERMINAL_ADDR"
|
||||
|
||||
# Set size and animate slide down
|
||||
hyprctl dispatch resizewindowpixel "exact $width $height,address:$TERMINAL_ADDR"
|
||||
animate_slide_down "$TERMINAL_ADDR" "$target_x" "$target_y" "$width" "$height"
|
||||
|
||||
hyprctl dispatch focuswindow "address:$TERMINAL_ADDR"
|
||||
else
|
||||
debug_echo "Hiding terminal to scratchpad with slide up animation"
|
||||
|
||||
# Get current geometry for animation
|
||||
geometry=$(get_window_geometry "$TERMINAL_ADDR")
|
||||
if [ -n "$geometry" ]; then
|
||||
curr_x=$(echo $geometry | cut -d' ' -f1)
|
||||
curr_y=$(echo $geometry | cut -d' ' -f2)
|
||||
curr_width=$(echo $geometry | cut -d' ' -f3)
|
||||
curr_height=$(echo $geometry | cut -d' ' -f4)
|
||||
|
||||
debug_echo "Current geometry: ${curr_x},${curr_y} ${curr_width}x${curr_height}"
|
||||
|
||||
# Animate slide up first
|
||||
animate_slide_up "$TERMINAL_ADDR" "$curr_x" "$curr_y" "$curr_width" "$curr_height"
|
||||
|
||||
# Small delay then move to special workspace and unpin
|
||||
sleep 0.1
|
||||
hyprctl dispatch pin "address:$TERMINAL_ADDR" # Unpin (toggle)
|
||||
hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR"
|
||||
else
|
||||
debug_echo "Could not get window geometry, moving to scratchpad without animation"
|
||||
hyprctl dispatch pin "address:$TERMINAL_ADDR"
|
||||
hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
debug_echo "No existing terminal found, creating new one"
|
||||
if spawn_terminal; then
|
||||
TERMINAL_ADDR=$(get_terminal_address)
|
||||
if [ -n "$TERMINAL_ADDR" ]; then
|
||||
hyprctl dispatch focuswindow "address:$TERMINAL_ADDR"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
34
scripts/GameMode.sh
Executable file
34
scripts/GameMode.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Game Mode. Turning off all animations
|
||||
|
||||
notif="$HOME/.config/swaync/images/ja.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:shadow:enabled 0;\
|
||||
keyword decoration:blur:enabled 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
|
||||
hyprctl reload
|
||||
${SCRIPTSDIR}/Refresh.sh
|
||||
notify-send -e -u normal -i "$notif" " Gamemode:" " disabled"
|
||||
exit
|
||||
fi
|
||||
hyprctl reload
|
||||
23
scripts/Hypridle.sh
Executable file
23
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
|
||||
99
scripts/Hyprsunset.sh
Executable file
99
scripts/Hyprsunset.sh
Executable file
@@ -0,0 +1,99 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Hyprsunset toggle + Waybar status helper
|
||||
# Phase 1: manual toggle only (no scheduling)
|
||||
# Icons:
|
||||
# - Off: bright sun
|
||||
# - On: sunset icon if available, otherwise a blue sun
|
||||
#
|
||||
# Customize via env vars:
|
||||
# HYPERSUNSET_TEMP default 4500 (K)
|
||||
# HYPERSUNSET_ICON_MODE sunset|blue (default: sunset)
|
||||
|
||||
STATE_FILE="$HOME/.cache/.hyprsunset_state"
|
||||
TARGET_TEMP="${HYPERSUNSET_TEMP:-4500}"
|
||||
ICON_MODE="${HYPERSUNSET_ICON_MODE:-sunset}"
|
||||
|
||||
ensure_state() {
|
||||
[[ -f "$STATE_FILE" ]] || echo "off" > "$STATE_FILE"
|
||||
}
|
||||
|
||||
# Render icons using pango markup to allow colorization
|
||||
icon_off() {
|
||||
# universally available sun symbol
|
||||
printf "☀"
|
||||
}
|
||||
|
||||
icon_on() {
|
||||
case "$ICON_MODE" in
|
||||
sunset)
|
||||
# sunset emoji (falls back to tofu if no emoji font)
|
||||
printf "🌇"
|
||||
;;
|
||||
blue)
|
||||
# no color in text; rely on CSS .on to style if desired
|
||||
printf "☀"
|
||||
;;
|
||||
*)
|
||||
printf "☀"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
cmd_toggle() {
|
||||
ensure_state
|
||||
state="$(cat "$STATE_FILE" || echo off)"
|
||||
|
||||
# Always stop any running hyprsunset first to avoid CTM manager conflicts
|
||||
if pgrep -x hyprsunset >/dev/null 2>&1; then
|
||||
pkill -x hyprsunset || true
|
||||
# give it a moment to release the CTM manager
|
||||
sleep 0.2
|
||||
fi
|
||||
|
||||
if [[ "$state" == "on" ]]; then
|
||||
# Turning OFF: set identity and exit
|
||||
if command -v hyprsunset >/dev/null 2>&1; then
|
||||
nohup hyprsunset -i >/dev/null 2>&1 &
|
||||
# if hyprsunset persists, stop it shortly after applying identity
|
||||
sleep 0.3 && pkill -x hyprsunset || true
|
||||
fi
|
||||
echo off > "$STATE_FILE"
|
||||
notify-send -u low "Hyprsunset: Disabled" || true
|
||||
else
|
||||
# Turning ON: start hyprsunset at target temp in background
|
||||
if command -v hyprsunset >/dev/null 2>&1; then
|
||||
nohup hyprsunset -t "$TARGET_TEMP" >/dev/null 2>&1 &
|
||||
fi
|
||||
echo on > "$STATE_FILE"
|
||||
notify-send -u low "Hyprsunset: Enabled" "${TARGET_TEMP}K" || true
|
||||
fi
|
||||
}
|
||||
|
||||
cmd_status() {
|
||||
ensure_state
|
||||
# Prefer live process detection; fall back to state file
|
||||
if pgrep -x hyprsunset >/dev/null 2>&1; then
|
||||
onoff="on"
|
||||
else
|
||||
onoff="$(cat "$STATE_FILE" || echo off)"
|
||||
fi
|
||||
|
||||
if [[ "$onoff" == "on" ]]; then
|
||||
txt="<span size='18pt'>$(icon_on)</span>"
|
||||
cls="on"
|
||||
tip="Night light on @ ${TARGET_TEMP}K"
|
||||
else
|
||||
txt="<span size='16pt'>$(icon_off)</span>"
|
||||
cls="off"
|
||||
tip="Night light off"
|
||||
fi
|
||||
printf '{"text":"%s","class":"%s","tooltip":"%s"}\n' "$txt" "$cls" "$tip"
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
toggle) cmd_toggle ;;
|
||||
status) cmd_status ;;
|
||||
*) echo "usage: $0 [toggle|status]" >&2; exit 2 ;;
|
||||
esac
|
||||
39
scripts/KeyBinds.sh
Executable file
39
scripts/KeyBinds.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/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/Laptops.conf"
|
||||
rofi_theme="$HOME/.config/rofi/config-keybinds.rasi"
|
||||
msg='☣️ NOTE ☣️: Clicking with Mouse or Pressing ENTER will have NO function'
|
||||
|
||||
# combine the contents of the keybinds files and filter for keybinds
|
||||
keybinds=$(cat "$keybinds_conf" "$user_keybinds_conf" | grep -E '^bind')
|
||||
|
||||
# check if laptop.conf exists and add its keybinds if present
|
||||
if [[ -f "$laptop_conf" ]]; then
|
||||
laptop_binds=$(grep -E '^bind' "$laptop_conf")
|
||||
keybinds+=$'\n'"$laptop_binds"
|
||||
fi
|
||||
|
||||
# check for any keybinds to display
|
||||
if [[ -z "$keybinds" ]]; then
|
||||
echo "no keybinds found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# replace $mainmod with super in the displayed keybinds for rofi
|
||||
display_keybinds=$(echo "$keybinds" | sed 's/\$mainMod/SUPER/g')
|
||||
|
||||
# use rofi to display the keybinds with the modified content
|
||||
echo "$display_keybinds" | rofi -dmenu -i -config "$rofi_theme" -mesg "$msg"
|
||||
72
scripts/KeyHints.sh
Executable file
72
scripts/KeyHints.sh
Executable file
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
|
||||
# GDK BACKEND. Change to either wayland or x11 if having issues
|
||||
BACKEND=wayland
|
||||
|
||||
# Check if rofi or yad is running and kill them if they are
|
||||
if pidof rofi > /dev/null; then
|
||||
pkill rofi
|
||||
fi
|
||||
|
||||
if pidof yad > /dev/null; then
|
||||
pkill yad
|
||||
fi
|
||||
|
||||
# Launch yad with calculated width and height
|
||||
GDK_BACKEND=$BACKEND yad \
|
||||
--center \
|
||||
--title="KooL Quick Cheat Sheet" \
|
||||
--no-buttons \
|
||||
--list \
|
||||
--column=Key: \
|
||||
--column=Description: \
|
||||
--column=Command: \
|
||||
--timeout-indicator=bottom \
|
||||
"ESC" "close this app" "" " = " "SUPER KEY (Windows Key Button)" "(SUPER KEY)" \
|
||||
" SHIFT K" "Searchable Keybinds" "(Search all Keybinds via rofi)" \
|
||||
" SHIFT E" "KooL Hyprland Settings Menu" "" \
|
||||
"" "" "" \
|
||||
" enter" "Terminal" "(kitty)" \
|
||||
" SHIFT enter" "DropDown Terminal" " Q to close" \
|
||||
" B" "Launch Browser" "(Default browser)" \
|
||||
" A" "Desktop Overview" "(AGS - if opted to install)" \
|
||||
" D" "Application Launcher" "(rofi-wayland)" \
|
||||
" E" "Open File Manager" "(Thunar)" \
|
||||
" S" "Google Search using rofi" "(rofi)" \
|
||||
" Q" "close active window" "(not kill)" \
|
||||
" Shift Q " "kills an active window" "(kill)" \
|
||||
" ALT mouse scroll up/down " "Desktop Zoom" "Desktop Magnifier" \
|
||||
" Alt V" "Clipboard Manager" "(cliphist)" \
|
||||
" W" "Choose wallpaper" "(Wallpaper Menu)" \
|
||||
" Shift W" "Choose wallpaper effects" "(imagemagick + swww)" \
|
||||
"CTRL ALT W" "Random wallpaper" "(via swww)" \
|
||||
" CTRL ALT 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" "(NOTE: Hyprland Will exit immediately)" \
|
||||
" SHIFT F" "Fullscreen" "Toggles to full screen" \
|
||||
" CTL F" "Fake Fullscreen" "Toggles to fake full screen" \
|
||||
" ALT L" "Toggle Dwindle | Master Layout" "Hyprland Layout" \
|
||||
" SPACEBAR" "Toggle float" "single window" \
|
||||
" ALT SPACEBAR" "Toggle all windows to float" "all windows" \
|
||||
" ALT O" "Toggle Blur" "normal or less blur" \
|
||||
" CTRL O" "Toggle Opaque ON or OFF" "on active window only" \
|
||||
" Shift A" "Animations Menu" "Choose Animations via rofi" \
|
||||
" CTRL R" "Rofi Themes Menu" "Choose Rofi Themes via rofi" \
|
||||
" CTRL Shift R" "Rofi Themes Menu v2" "Choose Rofi Themes via Theme Selector (modified)" \
|
||||
" SHIFT G" "Gamemode! All animations OFF or ON" "toggle" \
|
||||
" ALT E" "Rofi Emoticons" "Emoticon" \
|
||||
" H" "Launch this Quick Cheat Sheet" "" \
|
||||
"" "" "" \
|
||||
"More tips:" "https://github.com/JaKooLit/Hyprland-Dots/wiki" ""\
|
||||
11
scripts/KillActiveProcess.sh
Executable file
11
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
|
||||
136
scripts/Kitty_themes.sh
Executable file
136
scripts/Kitty_themes.sh
Executable file
@@ -0,0 +1,136 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
|
||||
# Kitty Themes Source https://github.com/dexpota/kitty-themes #
|
||||
|
||||
# Define directories and variables
|
||||
kitty_themes_DiR="$HOME/.config/kitty/kitty-themes" # Kitty Themes Directory
|
||||
kitty_config="$HOME/.config/kitty/kitty.conf"
|
||||
iDIR="$HOME/.config/swaync/images" # For notifications
|
||||
rofi_theme_for_this_script="$HOME/.config/rofi/config-kitty-theme.rasi"
|
||||
|
||||
# --- Helper Functions ---
|
||||
notify_user() {
|
||||
notify-send -u low -i "$1" "$2" "$3"
|
||||
}
|
||||
|
||||
# Function to apply the selected kitty theme
|
||||
apply_kitty_theme_to_config() {
|
||||
local theme_name_to_apply="$1"
|
||||
if [ -z "$theme_name_to_apply" ]; then
|
||||
echo "Error: No theme name provided to apply_kitty_theme_to_config." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
local theme_file_path_to_apply="$kitty_themes_DiR/$theme_name_to_apply.conf"
|
||||
if [ ! -f "$theme_file_path_to_apply" ]; then
|
||||
notify_user "$iDIR/error.png" "Error" "Theme file not found: $theme_name_to_apply.conf"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local temp_kitty_config_file
|
||||
temp_kitty_config_file=$(mktemp)
|
||||
cp "$kitty_config" "$temp_kitty_config_file"
|
||||
|
||||
if grep -q -E '^[#[:space:]]*include\s+\./kitty-themes/.*\.conf' "$temp_kitty_config_file"; then
|
||||
sed -i -E "s|^([#[:space:]]*include\s+\./kitty-themes/).*\.conf|include ./kitty-themes/$theme_name_to_apply.conf|g" "$temp_kitty_config_file"
|
||||
else
|
||||
if [ -s "$temp_kitty_config_file" ] && [ "$(tail -c1 "$temp_kitty_config_file")" != "" ]; then
|
||||
echo >>"$temp_kitty_config_file"
|
||||
fi
|
||||
echo "include ./kitty-themes/$theme_name_to_apply.conf" >>"$temp_kitty_config_file"
|
||||
fi
|
||||
|
||||
cp "$temp_kitty_config_file" "$kitty_config"
|
||||
rm "$temp_kitty_config_file"
|
||||
|
||||
for pid_kitty in $(pidof kitty); do
|
||||
if [ -n "$pid_kitty" ]; then
|
||||
kill -SIGUSR1 "$pid_kitty"
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
# --- Main Script Execution ---
|
||||
|
||||
if [ ! -d "$kitty_themes_DiR" ]; then
|
||||
notify_user "$iDIR/error.png" "E-R-R-O-R" "Kitty Themes directory not found: $kitty_themes_DiR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$rofi_theme_for_this_script" ]; then
|
||||
notify_user "$iDIR/error.png" "Rofi Config Missing" "Rofi theme for Kitty selector not found at: $rofi_theme_for_this_script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
original_kitty_config_content_backup=$(cat "$kitty_config")
|
||||
|
||||
mapfile -t available_theme_names < <(find "$kitty_themes_DiR" -maxdepth 1 -name "*.conf" -type f -printf "%f\n" | sed 's/\.conf$//' | sort)
|
||||
|
||||
if [ ${#available_theme_names[@]} -eq 0 ]; then
|
||||
notify_user "$iDIR/error.png" "No Kitty Themes" "No .conf files found in $kitty_themes_DiR."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
current_selection_index=0
|
||||
current_active_theme_name=$(awk -F'include ./kitty-themes/|\\.conf' '/^[[:space:]]*include \.\/kitty-themes\/.*\.conf/{print $2; exit}' "$kitty_config")
|
||||
|
||||
if [ -n "$current_active_theme_name" ]; then
|
||||
for i in "${!available_theme_names[@]}"; do
|
||||
if [[ "${available_theme_names[$i]}" == "$current_active_theme_name" ]]; then
|
||||
current_selection_index=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
while true; do
|
||||
theme_to_preview_now="${available_theme_names[$current_selection_index]}"
|
||||
|
||||
if ! apply_kitty_theme_to_config "$theme_to_preview_now"; then
|
||||
echo "$original_kitty_config_content_backup" >"$kitty_config"
|
||||
for pid_kitty in $(pidof kitty); do if [ -n "$pid_kitty" ]; then kill -SIGUSR1 "$pid_kitty"; fi; done
|
||||
notify_user "$iDIR/error.png" "Preview Error" "Failed to apply $theme_to_preview_now. Reverted."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rofi_input_list=""
|
||||
for theme_name_in_list in "${available_theme_names[@]}"; do
|
||||
rofi_input_list+="$theme_name_in_list\n"
|
||||
done
|
||||
rofi_input_list_trimmed="${rofi_input_list%\\n}"
|
||||
|
||||
chosen_index_from_rofi=$(echo -e "$rofi_input_list_trimmed" |
|
||||
rofi -dmenu -i \
|
||||
-format 'i' \
|
||||
-p "Kitty Theme" \
|
||||
-mesg "Preview: ${theme_to_preview_now} | Enter: Preview | Ctrl+S: Apply & Exit | Esc: Cancel" \
|
||||
-config "$rofi_theme_for_this_script" \
|
||||
-selected-row "$current_selection_index" \
|
||||
-kb-custom-1 "Control+s") # MODIFIED HERE: Changed to Control+s for custom action 1
|
||||
|
||||
rofi_exit_code=$?
|
||||
|
||||
if [ $rofi_exit_code -eq 0 ]; then
|
||||
if [[ "$chosen_index_from_rofi" =~ ^[0-9]+$ ]] && [ "$chosen_index_from_rofi" -lt "${#available_theme_names[@]}" ]; then
|
||||
current_selection_index="$chosen_index_from_rofi"
|
||||
else
|
||||
:
|
||||
fi
|
||||
elif [ $rofi_exit_code -eq 1 ]; then
|
||||
notify_user "$iDIR/note.png" "Kitty Theme" "Selection cancelled. Reverting to original theme."
|
||||
echo "$original_kitty_config_content_backup" >"$kitty_config"
|
||||
for pid_kitty in $(pidof kitty); do if [ -n "$pid_kitty" ]; then kill -SIGUSR1 "$pid_kitty"; fi; done
|
||||
break
|
||||
elif [ $rofi_exit_code -eq 10 ]; then # This is the exit code for -kb-custom-1
|
||||
notify_user "$iDIR/ja.png" "Kitty Theme Applied" "$theme_to_preview_now"
|
||||
break
|
||||
else
|
||||
notify_user "$iDIR/error.png" "Rofi Error" "Unexpected Rofi exit ($rofi_exit_code). Reverting."
|
||||
echo "$original_kitty_config_content_backup" >"$kitty_config"
|
||||
for pid_kitty in $(pidof kitty); do if [ -n "$pid_kitty" ]; then kill -SIGUSR1 "$pid_kitty"; fi; done
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
73
scripts/KooLsDotsUpdate.sh
Executable file
73
scripts/KooLsDotsUpdate.sh
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# simple bash script to check if update is available by comparing local version and github version
|
||||
|
||||
# Local Paths
|
||||
local_dir="$HOME/.config/hypr"
|
||||
iDIR="$HOME/.config/swaync/images/"
|
||||
local_version=$(ls $local_dir/v* 2>/dev/null | sort -V | tail -n 1 | sed 's/.*v\(.*\)/\1/')
|
||||
KooL_Dots_DIR="$HOME/Hyprland-Dots"
|
||||
|
||||
# exit if cannot find local version
|
||||
if [ -z "$local_version" ]; then
|
||||
notify-send -i "$iDIR/error.png" "ERROR "!?!?!!"" "Unable to find KooL's dots version . exiting.... "
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# GitHub URL - KooL's dots
|
||||
branch="main"
|
||||
github_url="https://github.com/JaKooLit/Hyprland-Dots/tree/$branch/config/hypr/"
|
||||
|
||||
# Fetch the version from GitHub URL - KooL's dots
|
||||
github_version=$(curl -s $github_url | grep -o 'v[0-9]\+\.[0-9]\+\.[0-9]\+' | sort -V | tail -n 1 | sed 's/v//')
|
||||
|
||||
# Cant find GitHub URL - KooL's dots version
|
||||
if [ -z "$github_version" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Comparing local and github versions
|
||||
if [ "$(echo -e "$github_version\n$local_version" | sort -V | head -n 1)" = "$github_version" ]; then
|
||||
notify-send -i "$iDIR/note.png" "KooL Hyprland:" "No update available"
|
||||
exit 0
|
||||
else
|
||||
# update available
|
||||
notify_cmd_base="notify-send -t 10000 -A action1=Update -A action2=NO -h string:x-canonical-private-synchronous:shot-notify"
|
||||
notify_cmd_shot="${notify_cmd_base} -i $iDIR/ja.png"
|
||||
|
||||
response=$($notify_cmd_shot "KooL Hyprland:" "Update available! Update now?")
|
||||
|
||||
case "$response" in
|
||||
"action1")
|
||||
if [ -d $KooL_Dots_DIR ]; then
|
||||
if ! command -v kitty &> /dev/null; then
|
||||
notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Kitty terminal not found. Please install Kitty terminal."
|
||||
exit 1
|
||||
fi
|
||||
kitty -e bash -c "
|
||||
cd $KooL_Dots_DIR &&
|
||||
git stash &&
|
||||
git pull &&
|
||||
./copy.sh &&
|
||||
notify-send -u critical -i "$iDIR/ja.png" 'Update Completed:' 'Kindly log out and relogin to take effect'
|
||||
"
|
||||
|
||||
else
|
||||
if ! command -v kitty &> /dev/null; then
|
||||
notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Kitty terminal not found. Please install Kitty terminal."
|
||||
exit 1
|
||||
fi
|
||||
kitty -e bash -c "
|
||||
git clone --depth=1 https://github.com/JaKooLit/Hyprland-Dots.git $KooL_Dots_DIR &&
|
||||
cd $KooL_Dots_DIR &&
|
||||
chmod +x copy.sh &&
|
||||
./copy.sh &&
|
||||
notify-send -u critical -i "$iDIR/ja.png" 'Update Completed:' 'Kindly log out and relogin to take effect'
|
||||
"
|
||||
fi
|
||||
;;
|
||||
"action2")
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
117
scripts/Kool_Quick_Settings.sh
Executable file
117
scripts/Kool_Quick_Settings.sh
Executable file
@@ -0,0 +1,117 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Rofi menu for KooL Hyprland Quick Settings (SUPER SHIFT E)
|
||||
|
||||
# Modify this config file for default terminal and EDITOR
|
||||
config_file="$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf"
|
||||
|
||||
tmp_config_file=$(mktemp)
|
||||
sed 's/^\$//g; s/ = /=/g' "$config_file" > "$tmp_config_file"
|
||||
source "$tmp_config_file"
|
||||
# ##################################### #
|
||||
|
||||
# variables
|
||||
configs="$HOME/.config/hypr/configs"
|
||||
UserConfigs="$HOME/.config/hypr/UserConfigs"
|
||||
rofi_theme="$HOME/.config/rofi/config-edit.rasi"
|
||||
msg=' ⁉️ Choose what to do ⁉️'
|
||||
iDIR="$HOME/.config/swaync/images"
|
||||
scriptsDir="$HOME/.config/hypr/scripts"
|
||||
UserScripts="$HOME/.config/hypr/UserScripts"
|
||||
|
||||
# Function to display the menu options without numbers
|
||||
menu() {
|
||||
cat <<EOF
|
||||
view/edit User Defaults
|
||||
view/edit ENV variables
|
||||
view/edit Window Rules
|
||||
view/edit User Keybinds
|
||||
view/edit User Settings
|
||||
view/edit Startup Apps
|
||||
view/edit Decorations
|
||||
view/edit Animations
|
||||
view/edit Laptop Keybinds
|
||||
view/edit Default Keybinds
|
||||
Choose Kitty Terminal Theme
|
||||
Configure Monitors (nwg-displays)
|
||||
Configure Workspace Rules (nwg-displays)
|
||||
GTK Settings (nwg-look)
|
||||
QT Apps Settings (qt6ct)
|
||||
QT Apps Settings (qt5ct)
|
||||
Choose Hyprland Animations
|
||||
Choose Monitor Profiles
|
||||
Choose Rofi Themes
|
||||
Search for Keybinds
|
||||
Toggle Game Mode
|
||||
Switch Dark-Light Theme
|
||||
EOF
|
||||
}
|
||||
|
||||
# Main function to handle menu selection
|
||||
main() {
|
||||
choice=$(menu | rofi -i -dmenu -config $rofi_theme -mesg "$msg")
|
||||
|
||||
# Map choices to corresponding files
|
||||
case "$choice" in
|
||||
"view/edit User Defaults") file="$UserConfigs/01-UserDefaults.conf" ;;
|
||||
"view/edit ENV variables") file="$UserConfigs/ENVariables.conf" ;;
|
||||
"view/edit Window Rules") file="$UserConfigs/WindowRules.conf" ;;
|
||||
"view/edit User Keybinds") file="$UserConfigs/UserKeybinds.conf" ;;
|
||||
"view/edit User Settings") file="$UserConfigs/UserSettings.conf" ;;
|
||||
"view/edit Startup Apps") file="$UserConfigs/Startup_Apps.conf" ;;
|
||||
"view/edit Decorations") file="$UserConfigs/UserDecorations.conf" ;;
|
||||
"view/edit Animations") file="$UserConfigs/UserAnimations.conf" ;;
|
||||
"view/edit Laptop Keybinds") file="$UserConfigs/Laptops.conf" ;;
|
||||
"view/edit Default Keybinds") file="$configs/Keybinds.conf" ;;
|
||||
"Choose Kitty Terminal Theme") $scriptsDir/Kitty_themes.sh ;;
|
||||
"Configure Monitors (nwg-displays)")
|
||||
if ! command -v nwg-displays &>/dev/null; then
|
||||
notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install nwg-displays first"
|
||||
exit 1
|
||||
fi
|
||||
nwg-displays ;;
|
||||
"Configure Workspace Rules (nwg-displays)")
|
||||
if ! command -v nwg-displays &>/dev/null; then
|
||||
notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install nwg-displays first"
|
||||
exit 1
|
||||
fi
|
||||
nwg-displays ;;
|
||||
"GTK Settings (nwg-look)")
|
||||
if ! command -v nwg-look &>/dev/null; then
|
||||
notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install nwg-look first"
|
||||
exit 1
|
||||
fi
|
||||
nwg-look ;;
|
||||
"QT Apps Settings (qt6ct)")
|
||||
if ! command -v qt6ct &>/dev/null; then
|
||||
notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install qt6ct first"
|
||||
exit 1
|
||||
fi
|
||||
qt6ct ;;
|
||||
"QT Apps Settings (qt5ct)")
|
||||
if ! command -v qt5ct &>/dev/null; then
|
||||
notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install qt5ct first"
|
||||
exit 1
|
||||
fi
|
||||
qt5ct ;;
|
||||
"Choose Hyprland Animations") $scriptsDir/Animations.sh ;;
|
||||
"Choose Monitor Profiles") $scriptsDir/MonitorProfiles.sh ;;
|
||||
"Choose Rofi Themes") $scriptsDir/RofiThemeSelector.sh ;;
|
||||
"Search for Keybinds") $scriptsDir/KeyBinds.sh ;;
|
||||
"Toggle Game Mode") $scriptsDir/GameMode.sh ;;
|
||||
"Switch Dark-Light Theme") $scriptsDir/DarkLight.sh ;;
|
||||
*) return ;; # Do nothing for invalid choices
|
||||
esac
|
||||
|
||||
# Open the selected file in the terminal with the text editor
|
||||
if [ -n "$file" ]; then
|
||||
$term -e $edit "$file"
|
||||
fi
|
||||
}
|
||||
|
||||
# Check if rofi is already running
|
||||
if pidof rofi > /dev/null; then
|
||||
pkill rofi
|
||||
fi
|
||||
|
||||
main
|
||||
7
scripts/LockScreen.sh
Executable file
7
scripts/LockScreen.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
|
||||
# For Hyprlock
|
||||
#pidof hyprlock || hyprlock -q
|
||||
|
||||
loginctl lock-session
|
||||
62
scripts/MediaCtrl.sh
Executable file
62
scripts/MediaCtrl.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/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
|
||||
sleep 0.1
|
||||
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
|
||||
42
scripts/MonitorProfiles.sh
Executable file
42
scripts/MonitorProfiles.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# For applying Pre-configured Monitor Profiles
|
||||
|
||||
# Check if rofi is already running
|
||||
if pidof rofi > /dev/null; then
|
||||
pkill rofi
|
||||
fi
|
||||
|
||||
# Variables
|
||||
iDIR="$HOME/.config/swaync/images"
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
monitor_dir="$HOME/.config/hypr/Monitor_Profiles"
|
||||
target="$HOME/.config/hypr/monitors.conf"
|
||||
rofi_theme="$HOME/.config/rofi/config-Monitors.rasi"
|
||||
msg='❗NOTE:❗ This will overwrite $HOME/.config/hypr/monitors.conf'
|
||||
|
||||
# Define the list of files to ignore
|
||||
ignore_files=(
|
||||
"README"
|
||||
)
|
||||
|
||||
# list of Monitor Profiles, sorted alphabetically with numbers first
|
||||
mon_profiles_list=$(find -L "$monitor_dir" -maxdepth 1 -type f | sed 's/.*\///' | sed 's/\.conf$//' | sort -V)
|
||||
|
||||
# Remove ignored files from the list
|
||||
for ignored_file in "${ignore_files[@]}"; do
|
||||
mon_profiles_list=$(echo "$mon_profiles_list" | grep -v -E "^$ignored_file$")
|
||||
done
|
||||
|
||||
# Rofi Menu
|
||||
chosen_file=$(echo "$mon_profiles_list" | rofi -i -dmenu -config $rofi_theme -mesg "$msg")
|
||||
|
||||
if [[ -n "$chosen_file" ]]; then
|
||||
full_path="$monitor_dir/$chosen_file.conf"
|
||||
cp "$full_path" "$target"
|
||||
|
||||
notify-send -u low -i "$iDIR/ja.png" "$chosen_file" "Monitor Profile Loaded"
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
${SCRIPTSDIR}/RefreshNoWaybar.sh &
|
||||
21
scripts/Polkit-NixOS.sh
Executable file
21
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."
|
||||
34
scripts/Polkit.sh
Executable file
34
scripts/Polkit.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# This script starts the first available Polkit agent from a list of possible locations
|
||||
|
||||
# List of potential Polkit agent file paths
|
||||
polkit=(
|
||||
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
|
||||
"/usr/libexec/hyprpolkitagent"
|
||||
"/usr/lib/hyprpolkitagent"
|
||||
"/usr/lib/hyprpolkitagent/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
|
||||
|
||||
# Loop through the list of paths
|
||||
for file in "${polkit[@]}"; do
|
||||
if [ -e "$file" ] && [ ! -d "$file" ]; then
|
||||
echo "Found: $file — executing..."
|
||||
exec "$file"
|
||||
executed=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Fallback message if nothing executed
|
||||
if [ "$executed" == false ]; then
|
||||
echo "No valid Polkit agent found. Please install one."
|
||||
fi
|
||||
16
scripts/PortalHyprland.sh
Executable file
16
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 &
|
||||
|
||||
55
scripts/Refresh.sh
Executable file
55
scripts/Refresh.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/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
|
||||
|
||||
# added since wallust sometimes not applying
|
||||
killall -SIGUSR2 waybar
|
||||
|
||||
# quit ags & relaunch ags
|
||||
#ags -q && ags &
|
||||
|
||||
# quit quickshell & relaunch quickshell
|
||||
#pkill qs && qs &
|
||||
|
||||
# some process to kill
|
||||
for pid in $(pidof waybar rofi swaync ags swaybg); do
|
||||
kill -SIGUSR1 "$pid"
|
||||
done
|
||||
|
||||
#Restart waybar
|
||||
sleep 1
|
||||
waybar &
|
||||
|
||||
# relaunch swaync
|
||||
sleep 0.5
|
||||
swaync > /dev/null 2>&1 &
|
||||
# reload swaync
|
||||
swaync-client --reload-config
|
||||
|
||||
# Relaunching rainbow borders if the script exists
|
||||
sleep 1
|
||||
if file_exists "${UserScripts}/RainbowBorders.sh"; then
|
||||
${UserScripts}/RainbowBorders.sh &
|
||||
fi
|
||||
|
||||
exit 0
|
||||
48
scripts/RefreshNoWaybar.sh
Executable file
48
scripts/RefreshNoWaybar.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/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 & relaunch ags
|
||||
#ags -q && ags &
|
||||
|
||||
# quit quickshell & relaunch quickshell
|
||||
#pkill qs && qs &
|
||||
|
||||
# Wallust refresh (synchronous to ensure colors are ready)
|
||||
${SCRIPTSDIR}/WallustSwww.sh
|
||||
sleep 0.2
|
||||
|
||||
# reload swaync
|
||||
swaync-client --reload-config
|
||||
|
||||
# Relaunching rainbow borders if the script exists
|
||||
sleep 1
|
||||
if file_exists "${UserScripts}/RainbowBorders.sh"; then
|
||||
${UserScripts}/RainbowBorders.sh &
|
||||
fi
|
||||
|
||||
|
||||
exit 0
|
||||
1871
scripts/RofiEmoji.sh
Executable file
1871
scripts/RofiEmoji.sh
Executable file
File diff suppressed because it is too large
Load Diff
36
scripts/RofiSearch.sh
Executable file
36
scripts/RofiSearch.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# For Searching via web browsers
|
||||
|
||||
# Define the path to the config file
|
||||
config_file=$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf
|
||||
|
||||
# Check if the config file exists
|
||||
if [[ ! -f "$config_file" ]]; then
|
||||
echo "Error: Configuration file not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Process the config file in memory, removing the $ and fixing spaces
|
||||
config_content=$(sed 's/\$//g' "$config_file" | sed 's/ = /=/')
|
||||
|
||||
# Source the modified content directly from the variable
|
||||
eval "$config_content"
|
||||
|
||||
# Check if $term is set correctly
|
||||
if [[ -z "$Search_Engine" ]]; then
|
||||
echo "Error: \$Search_Engine is not set in the configuration file!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Rofi theme and message
|
||||
rofi_theme="$HOME/.config/rofi/config-search.rasi"
|
||||
msg='‼️ **note** ‼️ search via default web browser'
|
||||
|
||||
# Kill Rofi if already running before execution
|
||||
if pgrep -x "rofi" >/dev/null; then
|
||||
pkill rofi
|
||||
fi
|
||||
|
||||
# Open Rofi and pass the selected query to xdg-open for Google search
|
||||
echo "" | rofi -dmenu -config "$rofi_theme" -mesg "$msg" | xargs -I{} xdg-open $Search_Engine
|
||||
229
scripts/RofiThemeSelector-modified.sh
Executable file
229
scripts/RofiThemeSelector-modified.sh
Executable file
@@ -0,0 +1,229 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# A modified version of Rofi-Theme-Selector, concentrating only on ~/.local and also, applying only 10 @themes in ~/.config/rofi/config.rasi
|
||||
# as opposed to continous adding of //@theme
|
||||
|
||||
# This code is released in public domain by Dave Davenport <qball@gmpclient.org>
|
||||
|
||||
iDIR="$HOME/.config/swaync/images"
|
||||
|
||||
|
||||
OS="linux"
|
||||
|
||||
ROFI=$(command -v rofi)
|
||||
SED=$(command -v sed)
|
||||
MKTEMP=$(command -v mktemp)
|
||||
NOTIFY_SEND=$(command -v notify-send)
|
||||
|
||||
if [ -z "${SED}" ]
|
||||
then
|
||||
echo "Did not find 'sed', script cannot continue."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${MKTEMP}" ]
|
||||
then
|
||||
echo "Did not find 'mktemp', script cannot continue."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${ROFI}" ]
|
||||
then
|
||||
echo "Did not find rofi, there is no point to continue."
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${NOTIFY_SEND}" ]
|
||||
then
|
||||
echo "Did not find 'notify-send', notifications won't work."
|
||||
fi
|
||||
|
||||
TMP_CONFIG_FILE=$(${MKTEMP}).rasi
|
||||
#rofi_theme_dir="${HOME}/.local/share/rofi/themes"
|
||||
rofi_config_file="${XDG_CONFIG_HOME:-${HOME}/.config}/rofi/config.rasi"
|
||||
|
||||
##
|
||||
# Array with parts to the found themes.
|
||||
# And array with the printable name.
|
||||
##
|
||||
declare -a themes
|
||||
declare -a theme_names
|
||||
|
||||
##
|
||||
# Function that tries to find all installed rofi themes.
|
||||
# This fills in #themes array and formats a displayable string #theme_names
|
||||
##
|
||||
# Find themes in defined directories
|
||||
find_themes() {
|
||||
directories=("$HOME/.local/share/rofi/themes" "$HOME/.config/rofi/themes")
|
||||
|
||||
for TD in "${directories[@]}"; do
|
||||
if [ -d "$TD" ]; then
|
||||
echo "Checking themes in: $TD"
|
||||
for file in "$TD"/*.rasi; do
|
||||
if [ -f "$file" ] && [ ! -L "$file" ]; then
|
||||
themes+=("$file")
|
||||
theme_names+=("$(basename "${file%.*}")")
|
||||
else
|
||||
echo "Skipping symlink: $file"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "Directory does not exist: $TD"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
##
|
||||
# Function to add or update theme in the config.rasi
|
||||
##
|
||||
add_theme_to_config() {
|
||||
local theme_name="$1"
|
||||
local theme_path
|
||||
|
||||
# Determine the correct path for the theme
|
||||
if [[ -f "$HOME/.local/share/rofi/themes/$theme_name.rasi" ]]; then
|
||||
theme_path="$HOME/.local/share/rofi/themes/$theme_name.rasi"
|
||||
elif [[ -f "$HOME/.config/rofi/themes/$theme_name.rasi" ]]; then
|
||||
theme_path="$HOME/.config/rofi/themes/$theme_name.rasi"
|
||||
else
|
||||
echo "Theme not found: $theme_name"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Resolve symlinks if present
|
||||
if [[ -L "$theme_path" ]]; then
|
||||
theme_path=$(readlink -f "$theme_path")
|
||||
fi
|
||||
|
||||
# Convert path to use ~ for home directory
|
||||
theme_path_with_tilde="~${theme_path#$HOME}"
|
||||
|
||||
# Add or update @theme line in config
|
||||
if ! grep -q '^\s*@theme' "$rofi_config_file"; then
|
||||
echo -e "\n\n@theme \"$theme_path_with_tilde\"" >> "$rofi_config_file"
|
||||
echo "Added @theme \"$theme_path_with_tilde\" to $rofi_config_file"
|
||||
else
|
||||
$SED -i "s/^\(\s*@theme.*\)/\/\/\1/" "$rofi_config_file"
|
||||
echo -e "@theme \"$theme_path_with_tilde\"" >> "$rofi_config_file"
|
||||
echo "Updated @theme line to $theme_path_with_tilde"
|
||||
fi
|
||||
|
||||
# Limit the number of @theme lines to a maximum of 9
|
||||
max_lines=9
|
||||
total_lines=$(grep -c '^\s*//@theme' "$rofi_config_file")
|
||||
|
||||
if [ "$total_lines" -gt "$max_lines" ]; then
|
||||
excess=$((total_lines - max_lines))
|
||||
for i in $(seq 1 "$excess"); do
|
||||
$SED -i '0,/^\s*\/\/@theme/ { /^\s*\/\/@theme/ {d; q; }}' "$rofi_config_file"
|
||||
done
|
||||
echo "Removed excess //@theme lines"
|
||||
fi
|
||||
}
|
||||
|
||||
##
|
||||
# Create a copy of rofi config
|
||||
##
|
||||
create_config_copy()
|
||||
{
|
||||
${ROFI} -dump-config > "${TMP_CONFIG_FILE}"
|
||||
# remove theme entry.
|
||||
${SED} -i 's/^\s*theme:\s\+".*"\s*;//g' "${TMP_CONFIG_FILE}"
|
||||
}
|
||||
|
||||
###
|
||||
# Print the list out so it can be displayed by rofi.
|
||||
##
|
||||
create_theme_list()
|
||||
{
|
||||
OLDIFS=${IFS}
|
||||
IFS='|'
|
||||
for themen in ${theme_names[@]}
|
||||
do
|
||||
echo "${themen}"
|
||||
done
|
||||
IFS=${OLDIFS}
|
||||
}
|
||||
|
||||
##
|
||||
# Thee indicate what entry is selected.
|
||||
##
|
||||
declare -i SELECTED
|
||||
|
||||
select_theme()
|
||||
{
|
||||
local MORE_FLAGS=(-dmenu -format i -no-custom -p "Theme" -markup -config "${TMP_CONFIG_FILE}" -i)
|
||||
MORE_FLAGS+=(-kb-custom-1 "Alt-a")
|
||||
MORE_FLAGS+=(-u 2,3 -a 4,5 )
|
||||
local CUR="default"
|
||||
while true
|
||||
do
|
||||
declare -i RTR
|
||||
declare -i RES
|
||||
local MESG="""You can preview themes by hitting <b>Enter</b>.
|
||||
<b>Alt-a</b> to accept the new theme.
|
||||
<b>Escape</b> to cancel
|
||||
Current theme: <b>${CUR}</b>
|
||||
<span weight=\"bold\" size=\"xx-small\">When setting a new theme this will override previous theme settings.
|
||||
Please update your config file if you have local modifications.</span>"""
|
||||
THEME_FLAG=
|
||||
if [ -n "${SELECTED}" ]
|
||||
then
|
||||
THEME_FLAG="-theme ${themes[${SELECTED}]}"
|
||||
fi
|
||||
RES=$( create_theme_list | ${ROFI} ${THEME_FLAG} ${MORE_FLAGS[@]} -cycle -selected-row "${SELECTED}" -mesg "${MESG}")
|
||||
RTR=$?
|
||||
if [ "${RTR}" = 10 ]
|
||||
then
|
||||
return 0;
|
||||
elif [ "${RTR}" = 1 ]
|
||||
then
|
||||
return 1;
|
||||
elif [ "${RTR}" = 65 ]
|
||||
then
|
||||
return 1;
|
||||
fi
|
||||
CUR=${theme_names[${RES}]}
|
||||
SELECTED=${RES}
|
||||
done
|
||||
}
|
||||
|
||||
############################################################################################################
|
||||
# Actual program execution
|
||||
###########################################################################################################
|
||||
##
|
||||
# Find all themes
|
||||
##
|
||||
find_themes
|
||||
|
||||
##
|
||||
# Do check if there are themes.
|
||||
##
|
||||
if [ ${#themes[@]} = 0 ]
|
||||
then
|
||||
${ROFI} -e "No themes found."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
##
|
||||
# Create copy of config to play with in preview
|
||||
##
|
||||
create_config_copy
|
||||
|
||||
##
|
||||
# Show the themes to user.
|
||||
##
|
||||
if select_theme && [ -n "${SELECTED}" ]
|
||||
then
|
||||
# Apply the selected theme
|
||||
add_theme_to_config "${theme_names[${SELECTED}]}"
|
||||
|
||||
# Send notification with the selected theme name
|
||||
selection="${theme_names[${SELECTED}]}"
|
||||
if [ -n "$NOTIFY_SEND" ]; then
|
||||
notify-send -u low -i "$iDIR/ja.png" "Rofi Theme applied:" "$selection"
|
||||
fi
|
||||
fi
|
||||
|
||||
##
|
||||
# Remove temp. config.
|
||||
##
|
||||
rm -- "${TMP_CONFIG_FILE}"
|
||||
154
scripts/RofiThemeSelector.sh
Executable file
154
scripts/RofiThemeSelector.sh
Executable file
@@ -0,0 +1,154 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
|
||||
# Rofi Themes - Script to preview and apply themes by live-reloading the config.
|
||||
|
||||
# --- Configuration ---
|
||||
ROFI_THEMES_DIR_CONFIG="$HOME/.config/rofi/themes"
|
||||
ROFI_THEMES_DIR_LOCAL="$HOME/.local/share/rofi/themes"
|
||||
ROFI_CONFIG_FILE="$HOME/.config/rofi/config.rasi"
|
||||
ROFI_THEME_FOR_THIS_SCRIPT="$HOME/.config/rofi/config-rofi-theme.rasi" # A separate rofi theme for the picker itself
|
||||
IDIR="$HOME/.config/swaync/images" # For notifications
|
||||
|
||||
# --- Helper Functions ---
|
||||
|
||||
# Function to send a notification
|
||||
notify_user() {
|
||||
notify-send -u low -i "$1" "$2" "$3"
|
||||
}
|
||||
|
||||
# Function to apply the selected rofi theme to the main config file
|
||||
apply_rofi_theme_to_config() {
|
||||
local theme_name_to_apply="$1"
|
||||
|
||||
# Find the full path of the theme file
|
||||
local theme_path
|
||||
if [[ -f "$ROFI_THEMES_DIR_CONFIG/$theme_name_to_apply" ]]; then
|
||||
theme_path="$ROFI_THEMES_DIR_CONFIG/$theme_name_to_apply"
|
||||
elif [[ -f "$ROFI_THEMES_DIR_LOCAL/$theme_name_to_apply" ]]; then
|
||||
theme_path="$ROFI_THEMES_DIR_LOCAL/$theme_name_to_apply"
|
||||
else
|
||||
notify_user "$IDIR/error.png" "Error" "Theme file not found: $theme_name_to_apply"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Use ~ for the home directory in the config path
|
||||
local theme_path_with_tilde="~${theme_path#$HOME}"
|
||||
|
||||
# Create a temporary file to safely edit the config
|
||||
local temp_rofi_config_file
|
||||
temp_rofi_config_file=$(mktemp)
|
||||
cp "$ROFI_CONFIG_FILE" "$temp_rofi_config_file"
|
||||
|
||||
# Comment out any existing @theme entry
|
||||
sed -i -E 's/^(\s*@theme)/\\/\\/\1/' "$temp_rofi_config_file"
|
||||
|
||||
# Add the new @theme entry at the end of the file
|
||||
echo "@theme \"$theme_path_with_tilde\"" >>"$temp_rofi_config_file"
|
||||
|
||||
# Overwrite the original config file
|
||||
cp "$temp_rofi_config_file" "$ROFI_CONFIG_FILE"
|
||||
rm "$temp_rofi_config_file"
|
||||
|
||||
# Prune old commented-out theme lines to prevent clutter
|
||||
local max_lines=10
|
||||
local total_lines=$(grep -c '^//\s*@theme' "$ROFI_CONFIG_FILE")
|
||||
if [ "$total_lines" -gt "$max_lines" ]; then
|
||||
local excess=$((total_lines - max_lines))
|
||||
for ((i = 1; i <= excess; i++)); do
|
||||
sed -i '0,/^\s*\/\/@theme/s///' "$ROFI_CONFIG_FILE"
|
||||
done
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# --- Main Script Execution ---
|
||||
|
||||
# Check for required directories and files
|
||||
if [ ! -d "$ROFI_THEMES_DIR_CONFIG" ] && [ ! -d "$ROFI_THEMES_DIR_LOCAL" ]; then
|
||||
notify_user "$IDIR/error.png" "E-R-R-O-R" "No Rofi themes directory found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$ROFI_CONFIG_FILE" ]; then
|
||||
notify_user "$IDIR/error.png" "E-R-R-O-R" "Rofi config file not found: $ROFI_CONFIG_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Backup the original config content
|
||||
original_rofi_config_content_backup=$(cat "$ROFI_CONFIG_FILE")
|
||||
|
||||
# Generate a sorted list of available theme file names
|
||||
mapfile -t available_theme_names < <((
|
||||
find "$ROFI_THEMES_DIR_CONFIG" -maxdepth 1 -name "*.rasi" -type f -printf "%f\n" 2>/dev/null
|
||||
find "$ROFI_THEMES_DIR_LOCAL" -maxdepth 1 -name "*.rasi" -type f -printf "%f\n" 2>/dev/null
|
||||
) | sort -V -u)
|
||||
|
||||
if [ ${#available_theme_names[@]} -eq 0 ]; then
|
||||
notify_user "$IDIR/error.png" "No Rofi Themes" "No .rasi files found in theme directories."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Find the currently active theme to set as the initial selection
|
||||
current_selection_index=0
|
||||
current_active_theme_path=$(grep -oP '^\s*@theme\s*"\K[^"]+' "$ROFI_CONFIG_FILE" | tail -n 1)
|
||||
if [ -n "$current_active_theme_path" ]; then
|
||||
current_active_theme_name=$(basename "$current_active_theme_path")
|
||||
for i in "${!available_theme_names[@]}"; do
|
||||
if [[ "${available_theme_names[$i]}" == "$current_active_theme_name" ]]; then
|
||||
current_selection_index=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Main preview loop
|
||||
while true; do
|
||||
theme_to_preview_now="${available_theme_names[$current_selection_index]}"
|
||||
|
||||
# Apply the theme for preview
|
||||
if ! apply_rofi_theme_to_config "$theme_to_preview_now"; then
|
||||
echo "$original_rofi_config_content_backup" >"$ROFI_CONFIG_FILE"
|
||||
notify_user "$IDIR/error.png" "Preview Error" "Failed to apply $theme_to_preview_now. Reverted."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Prepare theme list for Rofi
|
||||
rofi_input_list=""
|
||||
for theme_name_in_list in "${available_theme_names[@]}"; do
|
||||
rofi_input_list+="$(basename "$theme_name_in_list" .rasi)\n"
|
||||
done
|
||||
rofi_input_list_trimmed="${rofi_input_list%\\n}"
|
||||
|
||||
# Launch Rofi and get user's choice
|
||||
chosen_index_from_rofi=$(echo -e "$rofi_input_list_trimmed" |
|
||||
rofi -dmenu -i \
|
||||
-format 'i' \
|
||||
-p "Rofi Theme" \
|
||||
-mesg "‼️ **note** ‼️ Enter: Preview || Ctrl+S: Apply & Exit || Esc: Cancel" \
|
||||
-config "$ROFI_THEME_FOR_THIS_SCRIPT" \
|
||||
-selected-row "$current_selection_index" \
|
||||
-kb-custom-1 "Control+s")
|
||||
|
||||
rofi_exit_code=$?
|
||||
|
||||
# Handle Rofi's exit code
|
||||
if [ $rofi_exit_code -eq 0 ]; then # Enter
|
||||
if [[ "$chosen_index_from_rofi" =~ ^[0-9]+$ ]] && [ "$chosen_index_from_rofi" -lt "${#available_theme_names[@]}" ]; then
|
||||
current_selection_index="$chosen_index_from_rofi"
|
||||
fi
|
||||
elif [ $rofi_exit_code -eq 1 ]; then # Escape
|
||||
notify_user "$IDIR/note.png" "Rofi Theme" "Selection cancelled. Reverting to original theme."
|
||||
echo "$original_rofi_config_content_backup" >"$ROFI_CONFIG_FILE"
|
||||
break
|
||||
elif [ $rofi_exit_code -eq 10 ]; then # Custom bind 1 (Ctrl+S)
|
||||
notify_user "$IDIR/ja.png" "Rofi Theme Applied" "$(basename "$theme_to_preview_now" .rasi)"
|
||||
break
|
||||
else # Error or unexpected exit code
|
||||
notify_user "$IDIR/error.png" "Rofi Error" "Unexpected Rofi exit ($rofi_exit_code). Reverting."
|
||||
echo "$original_rofi_config_content_backup" >"$ROFI_CONFIG_FILE"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
164
scripts/ScreenShot.sh
Executable file
164
scripts/ScreenShot.sh
Executable file
@@ -0,0 +1,164 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Screenshots scripts
|
||||
|
||||
# variables
|
||||
time=$(date "+%d-%b_%H-%M-%S")
|
||||
dir="$(xdg-user-dir PICTURES)/Screenshots"
|
||||
file="Screenshot_${time}_${RANDOM}.png"
|
||||
|
||||
iDIR="$HOME/.config/swaync/icons"
|
||||
iDoR="$HOME/.config/swaync/images"
|
||||
sDIR="$HOME/.config/hypr/scripts"
|
||||
|
||||
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_cmd_shot="${notify_cmd_base} -i ${iDIR}/picture.png "
|
||||
notify_cmd_shot_win="${notify_cmd_base} -i ${iDIR}/picture.png "
|
||||
notify_cmd_NOT="notify-send -u low -i ${iDoR}/note.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_NOT} " 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_NOT} " 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"
|
||||
|
||||
# Copy with saving
|
||||
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"
|
||||
|
||||
# Copy without saving
|
||||
if [[ -s "$tmpfile" ]]; then
|
||||
wl-copy <"$tmpfile"
|
||||
notify_view "swappy"
|
||||
fi
|
||||
}
|
||||
|
||||
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
scripts/Sounds.sh
Executable file
77
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 -L $sDIR/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
sound_file=$(find -L $iDIR/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
sound_file=$(find -L $userDIR/$defaultTheme/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
sound_file=$(find -L $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
scripts/SwitchKeyboardLayout.sh
Executable file
104
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/ja.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"
|
||||
90
scripts/Tak0-Autodispatch.sh
Executable file
90
scripts/Tak0-Autodispatch.sh
Executable file
@@ -0,0 +1,90 @@
|
||||
#!/bin/bash
|
||||
# USAGE / ІНСТРУКЦІЯ:
|
||||
# 1) Run from terminal:
|
||||
# ./dispatch.sh <application_command> <target_workspace_number>
|
||||
# Example:
|
||||
# ./dispatch.sh discord 2
|
||||
#
|
||||
# 2) Call from Hyprland config (in hyprland.conf file):
|
||||
# exec-once = /path/to/dispatch.sh <application_command> <target_workspace_number>
|
||||
#
|
||||
# Logs are saved in dispatch.log file next to the script.
|
||||
# If the window doesn't appear or is dispatched incorrectly — info will be there.
|
||||
#
|
||||
# Notes:
|
||||
# - Script waits about ~9 seconds (30 iterations of 0.3 sec) for window to appear.
|
||||
# - Uses hyprctl and jq, so these tools must be installed.
|
||||
#
|
||||
# USAGE / ІНСТРУКЦІЯ:
|
||||
# 1) Запуск з терміналу:
|
||||
# ./dispatch.sh <application_command> <target_workspace_number>
|
||||
# Наприклад:
|
||||
# ./dispatch.sh discord 2
|
||||
#
|
||||
# 2) Виклик з конфігурації Hyprland (у файлі hyprland.conf):
|
||||
# exec-once = /path/to/dispatch.sh <application_command> <target_workspace_number>
|
||||
#
|
||||
# Логи зберігаються у файлі dispatch.log поруч зі скриптом.
|
||||
# Якщо вікно не з'явилось або неправильно диспатчилось — інформація там.
|
||||
#
|
||||
# Примітки:
|
||||
# - Скрипт чекає до ~9 секунд (30 ітерацій по 0.3 сек) поки вікно з'явиться.
|
||||
# - Використовує hyprctl і jq, тому ці інструменти мають бути встановлені.
|
||||
|
||||
LOGFILE="$(dirname "$0")/dispatch.log"
|
||||
# Log file path located next to the script.
|
||||
# Файл логів розташований поруч зі скриптом.
|
||||
|
||||
APP=$1
|
||||
# The application command or window class to launch or match.
|
||||
# Команда для запуску аплікації або клас вікна для пошуку.
|
||||
|
||||
TARGET_WORKSPACE=$2
|
||||
# The target workspace number where the window should be moved.
|
||||
# Цільовий номер воркспейсу, куди потрібно перемістити вікно.
|
||||
|
||||
# Check if required arguments are provided.
|
||||
# Перевірка наявності необхідних параметрів.
|
||||
if [[ -z "$APP" || -z "$TARGET_WORKSPACE" ]]; then
|
||||
echo "Usage: $0 <application_command> <target_workspace_number>" >> "$LOGFILE" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Starting dispatch of '$APP' to workspace $TARGET_WORKSPACE at $(date)" >> "$LOGFILE"
|
||||
# Starting the dispatch process and logging the event.
|
||||
# Початок процесу диспатчу, запис у лог.
|
||||
|
||||
# Avoid early workspace focus issues by switching workspace first.
|
||||
# Уникаємо проблем з раннім фокусом, спочатку переключаємо воркспейс.
|
||||
hyprctl dispatch workspace "$TARGET_WORKSPACE" >> "$LOGFILE" 2>&1
|
||||
sleep 0.4
|
||||
|
||||
# Launch the application in the background and disown it.
|
||||
# Запускаємо аплікацію у фоновому режимі та відв’язуємо від терміналу.
|
||||
$APP & disown
|
||||
pid=$!
|
||||
|
||||
echo "Launched '$APP' with PID $pid" >> "$LOGFILE"
|
||||
# Log the launched process ID.
|
||||
# Лог процесу запуску з PID.
|
||||
|
||||
# Wait for the application window to appear (matching window class).
|
||||
# Чекаємо появи вікна аплікації (за класом вікна).
|
||||
for i in {1..30}; do
|
||||
win=$(hyprctl clients -j | jq -r --arg APP "$APP" '
|
||||
.[] | select(.class | test($APP;"i")) | .address' 2>>"$LOGFILE")
|
||||
|
||||
if [[ -n "$win" ]]; then
|
||||
echo "Found window $win for app '$APP', moving to workspace $TARGET_WORKSPACE" >> "$LOGFILE"
|
||||
# Move the window to the target workspace.
|
||||
# Переміщаємо вікно на цільовий воркспейс.
|
||||
hyprctl dispatch movetoworkspace "$TARGET_WORKSPACE,address:$win" >> "$LOGFILE" 2>&1
|
||||
exit 0
|
||||
fi
|
||||
sleep 0.3
|
||||
done
|
||||
|
||||
echo "ERROR: Window for '$APP' was NOT found or dispatched properly to workspace $TARGET_WORKSPACE at $(date)" >> "$LOGFILE"
|
||||
# Log error if window was not found or dispatched correctly.
|
||||
# Запис помилки, якщо вікно не знайдено або неправильно диспатчено.
|
||||
exit 1
|
||||
123
scripts/Tak0-Per-Window-Switch.sh
Executable file
123
scripts/Tak0-Per-Window-Switch.sh
Executable file
@@ -0,0 +1,123 @@
|
||||
##################################################################
|
||||
# #
|
||||
# #
|
||||
# TAK_0'S Per-Window-Switch #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# Just a little script that I made to switch keyboard layouts #
|
||||
# per-window instead of global switching for the more #
|
||||
# smooth and comfortable workflow. #
|
||||
# #
|
||||
##################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# This is for changing kb_layouts. Set kb_layouts in
|
||||
|
||||
MAP_FILE="$HOME/.cache/kb_layout_per_window"
|
||||
CFG_FILE="$HOME/.config/hypr/UserConfigs/UserSettings.conf"
|
||||
ICON="$HOME/.config/swaync/images/ja.png"
|
||||
SCRIPT_NAME="$(basename "$0")"
|
||||
|
||||
# Ensure map file exists
|
||||
touch "$MAP_FILE"
|
||||
|
||||
# Read layouts from config
|
||||
if ! grep -q 'kb_layout' "$CFG_FILE"; then
|
||||
echo "Error: cannot find kb_layout in $CFG_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
kb_layouts=($(grep 'kb_layout' "$CFG_FILE" | cut -d '=' -f2 | tr -d '[:space:]' | tr ',' ' '))
|
||||
count=${#kb_layouts[@]}
|
||||
|
||||
# Get current active window ID
|
||||
get_win() {
|
||||
hyprctl activewindow -j | jq -r '.address // .id'
|
||||
}
|
||||
|
||||
# Get available keyboards
|
||||
get_keyboards() {
|
||||
hyprctl devices -j | jq -r '.keyboards[].name'
|
||||
}
|
||||
|
||||
# Save window-specific layout
|
||||
save_map() {
|
||||
local W=$1 L=$2
|
||||
grep -v "^${W}:" "$MAP_FILE" > "$MAP_FILE.tmp"
|
||||
echo "${W}:${L}" >> "$MAP_FILE.tmp"
|
||||
mv "$MAP_FILE.tmp" "$MAP_FILE"
|
||||
}
|
||||
|
||||
# Load layout for window (fallback to default)
|
||||
load_map() {
|
||||
local W=$1
|
||||
local E
|
||||
E=$(grep "^${W}:" "$MAP_FILE")
|
||||
[[ -n "$E" ]] && echo "${E#*:}" || echo "${kb_layouts[0]}"
|
||||
}
|
||||
|
||||
# Switch layout for all keyboards to layout index
|
||||
do_switch() {
|
||||
local IDX=$1
|
||||
for kb in $(get_keyboards); do
|
||||
hyprctl switchxkblayout "$kb" "$IDX" 2>/dev/null
|
||||
done
|
||||
}
|
||||
|
||||
# Toggle layout for current window only
|
||||
cmd_toggle() {
|
||||
local W=$(get_win)
|
||||
[[ -z "$W" ]] && return
|
||||
local CUR=$(load_map "$W")
|
||||
local i NEXT
|
||||
for idx in "${!kb_layouts[@]}"; do
|
||||
if [[ "${kb_layouts[idx]}" == "$CUR" ]]; then
|
||||
i=$idx
|
||||
break
|
||||
fi
|
||||
done
|
||||
NEXT=$(( (i+1) % count ))
|
||||
do_switch "$NEXT"
|
||||
save_map "$W" "${kb_layouts[NEXT]}"
|
||||
notify-send -u low -i "$ICON" "kb_layout: ${kb_layouts[NEXT]}"
|
||||
}
|
||||
|
||||
# Restore layout on focus
|
||||
cmd_restore() {
|
||||
local W=$(get_win)
|
||||
[[ -z "$W" ]] && return
|
||||
local LAY=$(load_map "$W")
|
||||
for idx in "${!kb_layouts[@]}"; do
|
||||
if [[ "${kb_layouts[idx]}" == "$LAY" ]]; then
|
||||
do_switch "$idx"
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Listen to focus events and restore window-specific layouts
|
||||
subscribe() {
|
||||
local SOCKET2="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
||||
[[ -S "$SOCKET2" ]] || { echo "Error: Hyprland socket not found." >&2; exit 1; }
|
||||
|
||||
socat -u UNIX-CONNECT:"$SOCKET2" - | while read -r line; do
|
||||
[[ "$line" =~ ^activewindow ]] && cmd_restore
|
||||
done
|
||||
}
|
||||
|
||||
# Ensure only one listener
|
||||
if ! pgrep -f "$SCRIPT_NAME.*--listener" >/dev/null; then
|
||||
subscribe --listener &
|
||||
fi
|
||||
|
||||
# CLI
|
||||
case "$1" in
|
||||
toggle|"") cmd_toggle ;;
|
||||
*) echo "Usage: $SCRIPT_NAME [toggle]" >&2; exit 1 ;;
|
||||
esac
|
||||
32
scripts/TouchPad.sh
Executable file
32
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/ja.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
scripts/UptimeNixOS.sh
Executable file
33
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
scripts/Volume.sh
Executable file
143
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 -h boolean:SWAYNC_BYPASS_DND:true -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 -h boolean:SWAYNC_BYPASS_DND:true -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 -h boolean:SWAYNC_BYPASS_DND:true -i "$iDIR/volume-mute.png" " Mute"
|
||||
elif [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
pamixer -u && notify-send -e -u low -h boolean:SWAYNC_BYPASS_DND:true -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 -h boolean:SWAYNC_BYPASS_DND:true -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 -h boolean:SWAYNC_BYPASS_DND:true -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" -h boolean:SWAYNC_BYPASS_DND:true -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
|
||||
59
scripts/WallustSwww.sh
Executable file
59
scripts/WallustSwww.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Wallust: derive colors from the current wallpaper and update templates
|
||||
# Usage: WallustSwww.sh [absolute_path_to_wallpaper]
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Inputs and paths
|
||||
passed_path="${1:-}"
|
||||
cache_dir="$HOME/.cache/swww/"
|
||||
rofi_link="$HOME/.config/rofi/.current_wallpaper"
|
||||
wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
|
||||
|
||||
# Helper: get focused monitor name (prefer JSON)
|
||||
get_focused_monitor() {
|
||||
if command -v jq >/dev/null 2>&1; then
|
||||
hyprctl monitors -j | jq -r '.[] | select(.focused) | .name'
|
||||
else
|
||||
hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}'
|
||||
fi
|
||||
}
|
||||
|
||||
# Determine wallpaper_path
|
||||
wallpaper_path=""
|
||||
if [[ -n "$passed_path" && -f "$passed_path" ]]; then
|
||||
wallpaper_path="$passed_path"
|
||||
else
|
||||
# Try to read from swww cache for the focused monitor, with a short retry loop
|
||||
current_monitor="$(get_focused_monitor)"
|
||||
cache_file="$cache_dir$current_monitor"
|
||||
|
||||
# Wait briefly for swww to write its cache after an image change
|
||||
for i in {1..10}; do
|
||||
if [[ -f "$cache_file" ]]; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
if [[ -f "$cache_file" ]]; then
|
||||
# The first non-filter line is the original wallpaper path
|
||||
# wallpaper_path="$(grep -v 'Lanczos3' "$cache_file" | head -n 1)"
|
||||
wallpaper_path=$(swww query | grep $current_monitor | awk '{print $9}')
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "${wallpaper_path:-}" || ! -f "$wallpaper_path" ]]; then
|
||||
# Nothing to do; avoid failing loudly so callers can continue
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Update helpers that depend on the path
|
||||
ln -sf "$wallpaper_path" "$rofi_link" || true
|
||||
mkdir -p "$(dirname "$wallpaper_current")"
|
||||
cp -f "$wallpaper_path" "$wallpaper_current" || true
|
||||
|
||||
# Run wallust (silent) to regenerate templates defined in ~/.config/wallust/wallust.toml
|
||||
# -s is used in this repo to keep things quiet and avoid extra prompts
|
||||
wallust run -s "$wallpaper_path" || true
|
||||
55
scripts/WaybarCava.sh
Executable file
55
scripts/WaybarCava.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
# WaybarCava.sh — safer single-instance handling, cleanup, and robustness
|
||||
# Original concept by JaKooLit; this variant focuses on lifecycle hardening.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Ensure cava exists
|
||||
if ! command -v cava >/dev/null 2>&1; then
|
||||
echo "cava not found in PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 0..7 → ▁▂▃▄▅▆▇█
|
||||
bar="▁▂▃▄▅▆▇█"
|
||||
dict="s/;//g"
|
||||
bar_length=${#bar}
|
||||
for ((i = 0; i < bar_length; i++)); do
|
||||
dict+=";s/$i/${bar:$i:1}/g"
|
||||
done
|
||||
|
||||
# Single-instance guard (only kill our previous instance if it’s still alive)
|
||||
RUNTIME_DIR="${XDG_RUNTIME_DIR:-/tmp}"
|
||||
pidfile="$RUNTIME_DIR/waybar-cava.pid"
|
||||
if [[ -f "$pidfile" ]]; then
|
||||
oldpid="$(cat "$pidfile" || true)"
|
||||
if [[ -n "$oldpid" ]] && kill -0 "$oldpid" 2>/dev/null; then
|
||||
kill "$oldpid" 2>/dev/null || true
|
||||
sleep 0.1 || true
|
||||
fi
|
||||
fi
|
||||
printf '%d' $$ >"$pidfile"
|
||||
|
||||
# Unique temp config + cleanup on exit
|
||||
config_file="$(mktemp "$RUNTIME_DIR/waybar-cava.XXXXXX.conf")"
|
||||
cleanup() { rm -f "$config_file" "$pidfile"; }
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
cat >"$config_file" <<EOF
|
||||
[general]
|
||||
framerate = 30
|
||||
bars = 10
|
||||
|
||||
[input]
|
||||
method = pulse
|
||||
source = auto
|
||||
|
||||
[output]
|
||||
method = raw
|
||||
raw_target = /dev/stdout
|
||||
data_format = ascii
|
||||
ascii_max_range = 7
|
||||
EOF
|
||||
|
||||
# Stream cava output and translate digits 0..7 to bar glyphs
|
||||
exec cava -p "$config_file" | sed -u "$dict"
|
||||
71
scripts/WaybarLayout.sh
Executable file
71
scripts/WaybarLayout.sh
Executable file
@@ -0,0 +1,71 @@
|
||||
#!/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"
|
||||
msg=' 🎌 NOTE: Some waybar LAYOUT NOT fully compatible with some STYLES'
|
||||
|
||||
# Apply selected configuration
|
||||
apply_config() {
|
||||
ln -sf "$waybar_layouts/$1" "$waybar_config"
|
||||
"${SCRIPTSDIR}/Refresh.sh" &
|
||||
}
|
||||
|
||||
main() {
|
||||
# Resolve current symlink target and basename
|
||||
current_target=$(readlink -f "$waybar_config")
|
||||
current_name=$(basename "$current_target")
|
||||
|
||||
# Build sorted list of available layouts
|
||||
mapfile -t options < <(
|
||||
find -L "$waybar_layouts" -maxdepth 1 -type f -printf '%f\n' | sort
|
||||
)
|
||||
|
||||
# Mark and locate the active layout
|
||||
default_row=0
|
||||
MARKER="👉"
|
||||
for i in "${!options[@]}"; do
|
||||
if [[ "${options[i]}" == "$current_name" ]]; then
|
||||
options[i]="$MARKER ${options[i]}"
|
||||
default_row=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Launch rofi with the annotated list, pre‑selecting the active row
|
||||
choice=$(printf '%s\n' "${options[@]}" \
|
||||
| rofi -i -dmenu \
|
||||
-config "$rofi_config" \
|
||||
-mesg "$msg" \
|
||||
-selected-row "$default_row"
|
||||
)
|
||||
|
||||
# Exit if nothing chosen
|
||||
[[ -z "$choice" ]] && { echo "No option selected. Exiting."; exit 0; }
|
||||
|
||||
# Strip marker before applying
|
||||
choice=${choice# $MARKER}
|
||||
|
||||
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
|
||||
44
scripts/WaybarScripts.sh
Executable file
44
scripts/WaybarScripts.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
|
||||
# This file used on waybar modules sourcing defaults set in $HOME/.config/hypr/UserConfigs/01-UserDefaults.conf
|
||||
|
||||
# Define the path to the config file
|
||||
config_file=$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf
|
||||
|
||||
# Check if the config file exists
|
||||
if [[ ! -f "$config_file" ]]; then
|
||||
echo "Error: Configuration file not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Process the config file in memory, removing the $ and fixing spaces
|
||||
config_content=$(sed 's/\$//g' "$config_file" | sed 's/ = /=/')
|
||||
|
||||
# Source the modified content directly from the variable
|
||||
eval "$config_content"
|
||||
|
||||
# Check if $term is set correctly
|
||||
if [[ -z "$term" ]]; then
|
||||
echo "Error: \$term is not set in the configuration file!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Execute accordingly based on the passed argument
|
||||
if [[ "$1" == "--btop" ]]; then
|
||||
$term --title btop sh -c 'btop'
|
||||
elif [[ "$1" == "--nvtop" ]]; then
|
||||
$term --title nvtop sh -c 'nvtop'
|
||||
elif [[ "$1" == "--nmtui" ]]; then
|
||||
$term nmtui
|
||||
elif [[ "$1" == "--term" ]]; then
|
||||
$term &
|
||||
elif [[ "$1" == "--files" ]]; then
|
||||
$files &
|
||||
else
|
||||
echo "Usage: $0 [--btop | --nvtop | --nmtui | --term]"
|
||||
echo "--btop : Open btop in a new term"
|
||||
echo "--nvtop : Open nvtop in a new term"
|
||||
echo "--nmtui : Open nmtui in a new term"
|
||||
echo "--term : Launch a term window"
|
||||
echo "--files : Launch a file manager"
|
||||
fi
|
||||
64
scripts/WaybarStyles.sh
Executable file
64
scripts/WaybarStyles.sh
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/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"
|
||||
msg=' 🎌 NOTE: Some waybar STYLES NOT fully compatible with some LAYOUTS'
|
||||
|
||||
# Apply selected style
|
||||
apply_style() {
|
||||
ln -sf "$waybar_styles/$1.css" "$waybar_style"
|
||||
pkill waybar && waybar &
|
||||
}
|
||||
|
||||
main() {
|
||||
# resolve current symlink and strip .css
|
||||
current_target=$(readlink -f "$waybar_style")
|
||||
current_name=$(basename "$current_target" .css)
|
||||
|
||||
# gather all style names (without .css) into an array
|
||||
mapfile -t options < <(
|
||||
find -L "$waybar_styles" -maxdepth 1 -type f -name '*.css' \
|
||||
-exec basename {} .css \; \
|
||||
| sort
|
||||
)
|
||||
|
||||
# mark the active style and record its index
|
||||
default_row=0
|
||||
MARKER="👉"
|
||||
for i in "${!options[@]}"; do
|
||||
if [[ "${options[i]}" == "$current_name" ]]; then
|
||||
options[i]="$MARKER ${options[i]}"
|
||||
default_row=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# launch rofi with the annotated list and pre‑selected row
|
||||
choice=$(printf '%s\n' "${options[@]}" \
|
||||
| rofi -i -dmenu \
|
||||
-config "$rofi_config" \
|
||||
-mesg "$msg" \
|
||||
-selected-row "$default_row"
|
||||
)
|
||||
|
||||
[[ -z "$choice" ]] && { echo "No option selected. Exiting."; exit 0; }
|
||||
|
||||
# remove annotation and apply
|
||||
choice=${choice# $MARKER}
|
||||
apply_style "$choice"
|
||||
}
|
||||
|
||||
# Kill Rofi if already running before execution
|
||||
if pgrep -x "rofi" >/dev/null; then
|
||||
pkill rofi
|
||||
#exit 0
|
||||
fi
|
||||
|
||||
main
|
||||
57
scripts/Wlogout.sh
Executable file
57
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=600
|
||||
B_2160=600
|
||||
A_1600=400
|
||||
B_1600=400
|
||||
A_1440=400
|
||||
B_1440=400
|
||||
A_1080=200
|
||||
B_1080=200
|
||||
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
|
||||
95
scripts/sddm_wallpaper.sh
Normal file
95
scripts/sddm_wallpaper.sh
Normal file
@@ -0,0 +1,95 @@
|
||||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */
|
||||
# SDDM Wallpaper and Wallust Colors Setter
|
||||
|
||||
# for the upcoming changes on the simple_sddm_theme
|
||||
|
||||
# variables
|
||||
terminal=kitty
|
||||
wallDIR="$HOME/Pictures/wallpapers"
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
|
||||
wallpaper_modified="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified"
|
||||
# Resolve SDDM themes directory (standard paths and NixOS path)
|
||||
sddm_themes_dir="/usr/share/sddm/themes"
|
||||
if [ ! -d "$sddm_themes_dir" ] && [ -d "/run/current-system/sw/share/sddm/themes" ]; then
|
||||
sddm_themes_dir="/run/current-system/sw/share/sddm/themes"
|
||||
fi
|
||||
sddm_simple="$sddm_themes_dir/simple_sddm_2"
|
||||
|
||||
# rofi-wallust-sddm colors path
|
||||
rofi_wallust="$HOME/.config/rofi/wallust/colors-rofi.rasi"
|
||||
sddm_theme_conf="$sddm_simple/theme.conf"
|
||||
|
||||
# Directory for swaync
|
||||
iDIR="$HOME/.config/swaync/images"
|
||||
iDIRi="$HOME/.config/swaync/icons"
|
||||
|
||||
# Parse arguments
|
||||
mode="effects" # default
|
||||
if [[ "$1" == "--normal" ]]; then
|
||||
mode="normal"
|
||||
elif [[ "$1" == "--effects" ]]; then
|
||||
mode="effects"
|
||||
fi
|
||||
|
||||
# Extract colors from rofi wallust config
|
||||
|
||||
color0=$(grep -oP 'color1:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust")
|
||||
color1=$(grep -oP 'color0:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust")
|
||||
color7=$(grep -oP 'color14:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust")
|
||||
color10=$(grep -oP 'color10:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust")
|
||||
color12=$(grep -oP 'color12:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust")
|
||||
color13=$(grep -oP 'color13:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust")
|
||||
foreground=$(grep -oP 'foreground:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust")
|
||||
#background-color=$(grep -oP 'background:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust")
|
||||
|
||||
# wallpaper to use
|
||||
if [[ "$mode" == "normal" ]]; then
|
||||
wallpaper_path="$wallpaper_current"
|
||||
else
|
||||
wallpaper_path="$wallpaper_modified"
|
||||
fi
|
||||
|
||||
# Abort on NixOS where this repo doesn't manage SDDM and themes are typically read-only
|
||||
if hostnamectl 2>/dev/null | grep -q 'Operating System: NixOS'; then
|
||||
notify-send -i "$iDIR/error.png" "SDDM" "NixOS detected: skipping SDDM background change."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Launch terminal and apply changes
|
||||
$terminal -e bash -c "
|
||||
echo 'Enter your password to update SDDM wallpapers and colors';
|
||||
|
||||
# Update the colors in the SDDM config
|
||||
sudo sed -i \"s/HeaderTextColor=\\\"#.*\\\"/HeaderTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/DateTextColor=\\\"#.*\\\"/DateTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/TimeTextColor=\\\"#.*\\\"/TimeTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/DropdownSelectedBackgroundColor=\\\"#.*\\\"/DropdownSelectedBackgroundColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/SystemButtonsIconsColor=\\\"#.*\\\"/SystemButtonsIconsColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/SessionButtonTextColor=\\\"#.*\\\"/SessionButtonTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/VirtualKeyboardButtonTextColor=\\\"#.*\\\"/VirtualKeyboardButtonTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/HighlightBackgroundColor=\\\"#.*\\\"/HighlightBackgroundColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/LoginFieldTextColor=\\\"#.*\\\"/LoginFieldTextColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/PasswordFieldTextColor=\\\"#.*\\\"/PasswordFieldTextColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\"
|
||||
|
||||
sudo sed -i \"s/DropdownBackgroundColor=\\\"#.*\\\"/DropdownBackgroundColor=\\\"$color1\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/HighlightTextColor=\\\"#.*\\\"/HighlightTextColor=\\\"$color10\\\"/\" \"$sddm_theme_conf\"
|
||||
|
||||
sudo sed -i \"s/PlaceholderTextColor=\\\"#.*\\\"/PlaceholderTextColor=\\\"$color7\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/UserIconColor=\\\"#.*\\\"/UserIconColor=\\\"$color7\\\"/\" \"$sddm_theme_conf\"
|
||||
sudo sed -i \"s/PasswordIconColor=\\\"#.*\\\"/PasswordIconColor=\\\"$color7\\\"/\" \"$sddm_theme_conf\"
|
||||
|
||||
# Copy wallpaper to SDDM theme
|
||||
# Primary: set Backgrounds/default (no extension) for simple_sddm_2
|
||||
sudo cp -f \"$wallpaper_path\" \"$sddm_simple/Backgrounds/default\" || true
|
||||
# Fallbacks: if theme ships default.jpg or default.png, update those too
|
||||
if [ -e \"$sddm_simple/Backgrounds/default.jpg\" ]; then
|
||||
sudo cp -f \"$wallpaper_path\" \"$sddm_simple/Backgrounds/default.jpg\"
|
||||
fi
|
||||
if [ -e \"$sddm_simple/Backgrounds/default.png\" ]; then
|
||||
sudo cp -f \"$wallpaper_path\" \"$sddm_simple/Backgrounds/default.png\"
|
||||
fi
|
||||
|
||||
notify-send -i \"$iDIR/ja.png\" \"SDDM\" \"Background SET\"
|
||||
"
|
||||
Reference in New Issue
Block a user