Adjusts config
This commit is contained in:
parent
20f63ff346
commit
8372d7f669
53 changed files with 130 additions and 7872 deletions
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Airplane Mode. Turning on or off all wifi using rfkill.
|
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
|
||||
# Check if any wireless device is blocked
|
||||
wifi_blocked=$(rfkill list wifi | grep -o "Soft blocked: yes")
|
||||
|
||||
if [ -n "$wifi_blocked" ]; then
|
||||
rfkill unblock wifi
|
||||
notify-send -u low -i "$notif" " Airplane" " mode: OFF"
|
||||
else
|
||||
rfkill block wifi
|
||||
notify-send -u low -i "$notif" " Airplane" " mode: ON"
|
||||
fi
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Script for Monitor backlights (if supported) using brightnessctl
|
||||
|
||||
iDIR="$HOME/.config/swaync/icons"
|
||||
notification_timeout=1000
|
||||
step=10 # INCREASE/DECREASE BY THIS VALUE
|
||||
|
||||
# Get brightness
|
||||
get_backlight() {
|
||||
brightnessctl -m | cut -d, -f4 | sed 's/%//'
|
||||
}
|
||||
|
||||
# Get icons
|
||||
get_icon() {
|
||||
current=$(get_backlight)
|
||||
if [ "$current" -le "20" ]; then
|
||||
icon="$iDIR/brightness-20.png"
|
||||
elif [ "$current" -le "40" ]; then
|
||||
icon="$iDIR/brightness-40.png"
|
||||
elif [ "$current" -le "60" ]; then
|
||||
icon="$iDIR/brightness-60.png"
|
||||
elif [ "$current" -le "80" ]; then
|
||||
icon="$iDIR/brightness-80.png"
|
||||
else
|
||||
icon="$iDIR/brightness-100.png"
|
||||
fi
|
||||
}
|
||||
|
||||
# Notify
|
||||
notify_user() {
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i $icon "Screen" "Brightness:$current%"
|
||||
}
|
||||
|
||||
# Change brightness
|
||||
change_backlight() {
|
||||
local current_brightness
|
||||
current_brightness=$(get_backlight)
|
||||
|
||||
# Calculate new brightness
|
||||
if [[ "$1" == "+${step}%" ]]; then
|
||||
new_brightness=$((current_brightness + step))
|
||||
elif [[ "$1" == "${step}%-" ]]; then
|
||||
new_brightness=$((current_brightness - step))
|
||||
fi
|
||||
|
||||
# Ensure new brightness is within valid range
|
||||
if (( new_brightness < 5 )); then
|
||||
new_brightness=5
|
||||
elif (( new_brightness > 100 )); then
|
||||
new_brightness=100
|
||||
fi
|
||||
|
||||
brightnessctl set "${new_brightness}%"
|
||||
get_icon
|
||||
current=$new_brightness
|
||||
notify_user
|
||||
}
|
||||
|
||||
# Execute accordingly
|
||||
case "$1" in
|
||||
"--get")
|
||||
get_backlight
|
||||
;;
|
||||
"--inc")
|
||||
change_backlight "+${step}%"
|
||||
;;
|
||||
"--dec")
|
||||
change_backlight "${step}%-"
|
||||
;;
|
||||
*)
|
||||
get_backlight
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Script for keyboard backlights (if supported) using brightnessctl
|
||||
|
||||
iDIR="$HOME/.config/swaync/icons"
|
||||
|
||||
# Get keyboard brightness
|
||||
get_kbd_backlight() {
|
||||
echo $(brightnessctl -d '*::kbd_backlight' -m | cut -d, -f4)
|
||||
}
|
||||
|
||||
# Get icons
|
||||
get_icon() {
|
||||
current=$(get_kbd_backlight | sed 's/%//')
|
||||
if [ "$current" -le "20" ]; then
|
||||
icon="$iDIR/brightness-20.png"
|
||||
elif [ "$current" -le "40" ]; then
|
||||
icon="$iDIR/brightness-40.png"
|
||||
elif [ "$current" -le "60" ]; then
|
||||
icon="$iDIR/brightness-60.png"
|
||||
elif [ "$current" -le "80" ]; then
|
||||
icon="$iDIR/brightness-80.png"
|
||||
else
|
||||
icon="$iDIR/brightness-100.png"
|
||||
fi
|
||||
}
|
||||
# Notify
|
||||
notify_user() {
|
||||
notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Keyboard" "Brightness:$current%"
|
||||
}
|
||||
|
||||
# Change brightness
|
||||
change_kbd_backlight() {
|
||||
brightnessctl -d *::kbd_backlight set "$1" && get_icon && notify_user
|
||||
}
|
||||
|
||||
# Execute accordingly
|
||||
case "$1" in
|
||||
"--get")
|
||||
get_kbd_backlight
|
||||
;;
|
||||
"--inc")
|
||||
change_kbd_backlight "+30%"
|
||||
;;
|
||||
"--dec")
|
||||
change_kbd_backlight "30%-"
|
||||
;;
|
||||
*)
|
||||
get_kbd_backlight
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Script for changing blurs on the fly
|
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
|
||||
STATE=$(hyprctl -j getoption decoration:blur:passes | jq ".int")
|
||||
|
||||
if [ "${STATE}" == "2" ]; then
|
||||
hyprctl keyword decoration:blur:size 2
|
||||
hyprctl keyword decoration:blur:passes 1
|
||||
notify-send -e -u low -i "$notif" " Less Blur"
|
||||
else
|
||||
hyprctl keyword decoration:blur:size 5
|
||||
hyprctl keyword decoration:blur:passes 2
|
||||
notify-send -e -u low -i "$notif" " Normal Blur"
|
||||
fi
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# for changing Hyprland Layouts (Master or Dwindle) on the fly
|
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
|
||||
LAYOUT=$(hyprctl -j getoption general:layout | jq '.str' | sed 's/"//g')
|
||||
|
||||
case $LAYOUT in
|
||||
"master")
|
||||
hyprctl keyword general:layout dwindle
|
||||
hyprctl keyword unbind SUPER,J
|
||||
hyprctl keyword unbind SUPER,K
|
||||
hyprctl keyword bind SUPER,J,cyclenext
|
||||
hyprctl keyword bind SUPER,K,cyclenext,prev
|
||||
hyprctl keyword bind SUPER,O,togglesplit
|
||||
notify-send -e -u low -i "$notif" " Dwindle Layout"
|
||||
;;
|
||||
"dwindle")
|
||||
hyprctl keyword general:layout master
|
||||
hyprctl keyword unbind SUPER,J
|
||||
hyprctl keyword unbind SUPER,K
|
||||
hyprctl keyword unbind SUPER,O
|
||||
hyprctl keyword bind SUPER,J,layoutmsg,cyclenext
|
||||
hyprctl keyword bind SUPER,K,layoutmsg,cycleprev
|
||||
notify-send -e -u low -i "$notif" " Master Layout"
|
||||
;;
|
||||
*) ;;
|
||||
|
||||
esac
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Clipboard Manager. This script uses cliphist, rofi, and wl-copy.
|
||||
|
||||
# Actions:
|
||||
# CTRL Del to delete an entry
|
||||
# ALT Del to wipe clipboard contents
|
||||
|
||||
# Check if rofi is already running
|
||||
if pidof rofi > /dev/null; then
|
||||
pkill rofi
|
||||
fi
|
||||
|
||||
while true; do
|
||||
result=$(
|
||||
rofi -i -dmenu \
|
||||
-kb-custom-1 "Control-Delete" \
|
||||
-kb-custom-2 "Alt-Delete" \
|
||||
-config ~/.config/rofi/config-clipboard.rasi < <(cliphist list)
|
||||
)
|
||||
|
||||
case "$?" in
|
||||
1)
|
||||
exit
|
||||
;;
|
||||
0)
|
||||
case "$result" in
|
||||
"")
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
cliphist decode <<<"$result" | wl-copy
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
10)
|
||||
cliphist delete <<<"$result"
|
||||
;;
|
||||
11)
|
||||
cliphist wipe
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
|
@ -1,252 +0,0 @@
|
|||
#!/bin/bash
|
||||
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# For Dark and Light switching
|
||||
# Note: Scripts are looking for keywords Light or Dark except for wallpapers as the are in a separate folders
|
||||
|
||||
# Paths
|
||||
wallpaper_base_path="$HOME/Pictures/wallpapers/Dynamic-Wallpapers"
|
||||
dark_wallpapers="$wallpaper_base_path/Dark"
|
||||
light_wallpapers="$wallpaper_base_path/Light"
|
||||
hypr_config_path="$HOME/.config/hypr"
|
||||
swaync_style="$HOME/.config/swaync/style.css"
|
||||
ags_style="$HOME/.config/ags/user/style.css"
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
wallust_rofi="$HOME/.config/wallust/templates/colors-rofi.rasi"
|
||||
|
||||
kitty_conf="$HOME/.config/kitty/kitty.conf"
|
||||
|
||||
wallust_config="$HOME/.config/wallust/wallust.toml"
|
||||
pallete_dark="dark16"
|
||||
pallete_light="light16"
|
||||
|
||||
# kill swaybg if running
|
||||
pkill swaybg
|
||||
|
||||
# Initialize swww if needed
|
||||
swww query || swww-daemon --format xrgb
|
||||
|
||||
# Set swww options
|
||||
swww="swww img"
|
||||
effect="--transition-bezier .43,1.19,1,.4 --transition-fps 60 --transition-type grow --transition-pos 0.925,0.977 --transition-duration 2"
|
||||
|
||||
# Determine current theme mode
|
||||
if [ "$(cat $HOME/.cache/.theme_mode)" = "Light" ]; then
|
||||
next_mode="Dark"
|
||||
# Logic for Dark mode
|
||||
wallpaper_path="$dark_wallpapers"
|
||||
else
|
||||
next_mode="Light"
|
||||
# Logic for Light mode
|
||||
wallpaper_path="$light_wallpapers"
|
||||
fi
|
||||
|
||||
# Function to update theme mode for the next cycle
|
||||
update_theme_mode() {
|
||||
echo "$next_mode" > ~/.cache/.theme_mode
|
||||
}
|
||||
|
||||
# Function to notify user
|
||||
notify_user() {
|
||||
notify-send -u low -i "$notif" " Switching to" " $1 mode"
|
||||
}
|
||||
|
||||
# Use sed to replace the palette setting in the wallust config file
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
sed -i 's/^palette = .*/palette = "'"$pallete_dark"'"/' "$wallust_config"
|
||||
else
|
||||
sed -i 's/^palette = .*/palette = "'"$pallete_light"'"/' "$wallust_config"
|
||||
fi
|
||||
|
||||
# Function to set Waybar style
|
||||
set_waybar_style() {
|
||||
theme="$1"
|
||||
waybar_styles="$HOME/.config/waybar/style"
|
||||
waybar_style_link="$HOME/.config/waybar/style.css"
|
||||
style_prefix="\\[${theme}\\].*\\.css$"
|
||||
|
||||
style_file=$(find "$waybar_styles" -maxdepth 1 -type f -regex ".*$style_prefix" | shuf -n 1)
|
||||
|
||||
if [ -n "$style_file" ]; then
|
||||
ln -sf "$style_file" "$waybar_style_link"
|
||||
else
|
||||
echo "Style file not found for $theme theme."
|
||||
fi
|
||||
}
|
||||
|
||||
# Call the function after determining the mode
|
||||
set_waybar_style "$next_mode"
|
||||
notify_user "$next_mode"
|
||||
|
||||
|
||||
# swaync color change
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.8);/' "${swaync_style}"
|
||||
sed -i '/@define-color noti-bg-alt/s/#.*;/#111111;/' "${swaync_style}"
|
||||
else
|
||||
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.9);/' "${swaync_style}"
|
||||
sed -i '/@define-color noti-bg-alt/s/#.*;/#F0F0F0;/' "${swaync_style}"
|
||||
fi
|
||||
|
||||
# ags color change
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.4);/' "${ags_style}"
|
||||
sed -i '/@define-color text-color/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.7);/' "${ags_style}"
|
||||
sed -i '/@define-color noti-bg-alt/s/#.*;/#111111;/' "${ags_style}"
|
||||
else
|
||||
sed -i '/@define-color noti-bg/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(255, 255, 255, 0.4);/' "${ags_style}"
|
||||
sed -i '/@define-color text-color/s/rgba([0-9]*,\s*[0-9]*,\s*[0-9]*,\s*[0-9.]*);/rgba(0, 0, 0, 0.7);/' "${ags_style}"
|
||||
sed -i '/@define-color noti-bg-alt/s/#.*;/#F0F0F0;/' "${ags_style}"
|
||||
fi
|
||||
|
||||
# kitty background color change
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
sed -i '/^foreground /s/^foreground .*/foreground #dddddd/' "${kitty_conf}"
|
||||
sed -i '/^background /s/^background .*/background #000000/' "${kitty_conf}"
|
||||
sed -i '/^cursor /s/^cursor .*/cursor #dddddd/' "${kitty_conf}"
|
||||
else
|
||||
sed -i '/^foreground /s/^foreground .*/foreground #000000/' "${kitty_conf}"
|
||||
sed -i '/^background /s/^background .*/background #dddddd/' "${kitty_conf}"
|
||||
sed -i '/^cursor /s/^cursor .*/cursor #000000/' "${kitty_conf}"
|
||||
fi
|
||||
|
||||
for pid in $(pidof kitty); do
|
||||
kill -SIGUSR1 "$pid"
|
||||
done
|
||||
|
||||
|
||||
# Set Dynamic Wallpaper for Dark or Light Mode
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
next_wallpaper="$(find "${dark_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)"
|
||||
else
|
||||
next_wallpaper="$(find "${light_wallpapers}" -type f \( -iname "*.jpg" -o -iname "*.png" \) -print0 | shuf -n1 -z | xargs -0)"
|
||||
fi
|
||||
|
||||
# Update wallpaper using swww command
|
||||
$swww "${next_wallpaper}" $effect
|
||||
|
||||
|
||||
# Set Kvantum Manager theme & QT5/QT6 settings
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
kvantum_theme="catppuccin-mocha-blue"
|
||||
#qt5ct_color_scheme="$HOME/.config/qt5ct/colors/Catppuccin-Mocha.conf"
|
||||
#qt6ct_color_scheme="$HOME/.config/qt6ct/colors/Catppuccin-Mocha.conf"
|
||||
else
|
||||
kvantum_theme="catppuccin-latte-blue"
|
||||
#qt5ct_color_scheme="$HOME/.config/qt5ct/colors/Catppuccin-Latte.conf"
|
||||
#qt6ct_color_scheme="$HOME/.config/qt6ct/colors/Catppuccin-Latte.conf"
|
||||
fi
|
||||
|
||||
sed -i "s|^color_scheme_path=.*$|color_scheme_path=$qt5ct_color_scheme|" "$HOME/.config/qt5ct/qt5ct.conf"
|
||||
sed -i "s|^color_scheme_path=.*$|color_scheme_path=$qt6ct_color_scheme|" "$HOME/.config/qt6ct/qt6ct.conf"
|
||||
kvantummanager --set "$kvantum_theme"
|
||||
|
||||
|
||||
# set the rofi color for background
|
||||
if [ "$next_mode" = "Dark" ]; then
|
||||
sed -i '24s/.*/background: rgba(0,0,0,0.7);/' $wallust_rofi
|
||||
else
|
||||
sed -i '24s/.*/background: rgba(255,255,255,0.9);/' $wallust_rofi
|
||||
fi
|
||||
|
||||
|
||||
# GTK themes and icons switching
|
||||
set_custom_gtk_theme() {
|
||||
mode=$1
|
||||
gtk_themes_directory="$HOME/.themes"
|
||||
icon_directory="$HOME/.icons"
|
||||
color_setting="org.gnome.desktop.interface color-scheme"
|
||||
theme_setting="org.gnome.desktop.interface gtk-theme"
|
||||
icon_setting="org.gnome.desktop.interface icon-theme"
|
||||
|
||||
if [ "$mode" == "Light" ]; then
|
||||
search_keywords="*Light*"
|
||||
gsettings set $color_setting 'prefer-light'
|
||||
elif [ "$mode" == "Dark" ]; then
|
||||
search_keywords="*Dark*"
|
||||
gsettings set $color_setting 'prefer-dark'
|
||||
else
|
||||
echo "Invalid mode provided."
|
||||
return 1
|
||||
fi
|
||||
|
||||
themes=()
|
||||
icons=()
|
||||
|
||||
while IFS= read -r -d '' theme_search; do
|
||||
themes+=("$(basename "$theme_search")")
|
||||
done < <(find "$gtk_themes_directory" -maxdepth 1 -type d -iname "$search_keywords" -print0)
|
||||
|
||||
while IFS= read -r -d '' icon_search; do
|
||||
icons+=("$(basename "$icon_search")")
|
||||
done < <(find "$icon_directory" -maxdepth 1 -type d -iname "$search_keywords" -print0)
|
||||
|
||||
if [ ${#themes[@]} -gt 0 ]; then
|
||||
if [ "$mode" == "Dark" ]; then
|
||||
selected_theme=${themes[RANDOM % ${#themes[@]}]}
|
||||
else
|
||||
selected_theme=${themes[$RANDOM % ${#themes[@]}]}
|
||||
fi
|
||||
echo "Selected GTK theme for $mode mode: $selected_theme"
|
||||
gsettings set $theme_setting "$selected_theme"
|
||||
|
||||
# Flatpak GTK apps (themes)
|
||||
if command -v flatpak &> /dev/null; then
|
||||
flatpak --user override --filesystem=$HOME/.themes
|
||||
sleep 0.5
|
||||
flatpak --user override --env=GTK_THEME="$selected_theme"
|
||||
fi
|
||||
else
|
||||
echo "No $mode GTK theme found"
|
||||
fi
|
||||
|
||||
if [ ${#icons[@]} -gt 0 ]; then
|
||||
if [ "$mode" == "Dark" ]; then
|
||||
selected_icon=${icons[RANDOM % ${#icons[@]}]}
|
||||
else
|
||||
selected_icon=${icons[$RANDOM % ${#icons[@]}]}
|
||||
fi
|
||||
echo "Selected icon theme for $mode mode: $selected_icon"
|
||||
gsettings set $icon_setting "$selected_icon"
|
||||
|
||||
## QT5ct icon_theme
|
||||
sed -i "s|^icon_theme=.*$|icon_theme=$selected_icon|" "$HOME/.config/qt5ct/qt5ct.conf"
|
||||
sed -i "s|^icon_theme=.*$|icon_theme=$selected_icon|" "$HOME/.config/qt6ct/qt6ct.conf"
|
||||
|
||||
# Flatpak GTK apps (icons)
|
||||
if command -v flatpak &> /dev/null; then
|
||||
flatpak --user override --filesystem=$HOME/.icons
|
||||
sleep 0.5
|
||||
flatpak --user override --env=ICON_THEME="$selected_icon"
|
||||
fi
|
||||
else
|
||||
echo "No $mode icon theme found"
|
||||
fi
|
||||
}
|
||||
|
||||
# Call the function to set GTK theme and icon theme based on mode
|
||||
set_custom_gtk_theme "$next_mode"
|
||||
|
||||
# Update theme mode for the next cycle
|
||||
update_theme_mode
|
||||
|
||||
|
||||
${SCRIPTSDIR}/WallustSwww.sh &&
|
||||
|
||||
# some process to kill
|
||||
_ps=(waybar rofi swaync ags swaybg)
|
||||
for _prs in "${_ps[@]}"; do
|
||||
if pidof "${_prs}" >/dev/null; then
|
||||
pkill "${_prs}"
|
||||
fi
|
||||
done
|
||||
|
||||
sleep 2
|
||||
${SCRIPTSDIR}/Refresh.sh
|
||||
|
||||
sleep 0.3
|
||||
# Display notifications for theme and icon changes
|
||||
notify-send -u normal -i "$notif" " Themes switched to:" " $next_mode Mode"
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Game Mode. Turning off all animations
|
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
|
||||
|
||||
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
|
||||
if [ "$HYPRGAMEMODE" = 1 ] ; then
|
||||
hyprctl --batch "\
|
||||
keyword animations:enabled 0;\
|
||||
keyword decoration:drop_shadow 0;\
|
||||
keyword decoration:blur:passes 0;\
|
||||
keyword general:gaps_in 0;\
|
||||
keyword general:gaps_out 0;\
|
||||
keyword general:border_size 1;\
|
||||
keyword decoration:rounding 0"
|
||||
|
||||
hyprctl keyword "windowrule opacity 1 override 1 override 1 override, ^(.*)$"
|
||||
swww kill
|
||||
notify-send -e -u low -i "$notif" " Gamemode:" " enabled"
|
||||
exit
|
||||
else
|
||||
swww-daemon --format xrgb && swww img "$HOME/.config/rofi/.current_wallpaper" &
|
||||
sleep 0.1
|
||||
${SCRIPTSDIR}/WallustSwww.sh
|
||||
sleep 0.5
|
||||
${SCRIPTSDIR}/Refresh.sh
|
||||
notify-send -e -u normal -i "$notif" " Gamemode:" " disabled"
|
||||
exit
|
||||
fi
|
||||
hyprctl reload
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#!/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."
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# This is for polkits, it will start from top and will stop if the top is executed
|
||||
|
||||
# Polkit possible paths files to check
|
||||
polkit=(
|
||||
"/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
|
||||
"/usr/libexec/hyprpolkitagent"
|
||||
"/usr/lib/hyprpolkitagent"
|
||||
"/usr/lib/polkit-kde-authentication-agent-1"
|
||||
"/usr/lib/polkit-gnome-authentication-agent-1"
|
||||
"/usr/libexec/polkit-gnome-authentication-agent-1"
|
||||
"/usr/libexec/polkit-mate-authentication-agent-1"
|
||||
"/usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1"
|
||||
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"
|
||||
)
|
||||
|
||||
executed=false # Flag to track if a file has been executed
|
||||
|
||||
# Loop through the list of files
|
||||
for file in "${polkit[@]}"; do
|
||||
if [ -e "$file" ]; then
|
||||
echo "File $file found, executing command..."
|
||||
exec "$file"
|
||||
executed=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# If none of the files were found, you can add a fallback command here
|
||||
if [ "$executed" == false ]; then
|
||||
echo "None of the specified files were found. Install a Polkit"
|
||||
fi
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,17 +0,0 @@
|
|||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Modified Script for Google Search
|
||||
# Original Submitted by https://github.com/LeventKaanOguz
|
||||
|
||||
# Opens rofi in dmenu mod and waits for input. Then pushes the input to the query of the URL.
|
||||
|
||||
rofi_config="$HOME/.config/rofi/config-search.rasi"
|
||||
|
||||
# Kill Rofi if already running before execution
|
||||
if pgrep -x "rofi" >/dev/null; then
|
||||
pkill rofi
|
||||
#exit 0
|
||||
fi
|
||||
|
||||
# Open rofi with a dmenu and pass the selected item to xdg-open for Google search
|
||||
echo "" | rofi -dmenu -config "$rofi_config" -p "Search:" | xargs -I{} xdg-open "https://www.google.com/search?q={}"
|
||||
|
||||
|
|
@ -2,9 +2,6 @@
|
|||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Screenshots scripts
|
||||
|
||||
iDIR="$HOME/.config/swaync/icons"
|
||||
sDIR="$HOME/.config/hypr/scripts"
|
||||
|
||||
time=$(date "+%d-%b_%H-%M-%S")
|
||||
dir="$(xdg-user-dir)/Pictures/Screenshots"
|
||||
file="Screenshot_${time}_${RANDOM}.png"
|
||||
|
|
@ -15,142 +12,141 @@ active_window_path="${dir}/${active_window_file}"
|
|||
|
||||
notify_cmd_base="notify-send -t 10000 -A action1=Open -A action2=Delete -h string:x-canonical-private-synchronous:shot-notify"
|
||||
#notify_swappy="notify-send -h string:x-canonical-private-synchronous:shot-notify -u low -i ${iDIR}/picture.png"
|
||||
notify_cmd_shot="${notify_cmd_base} -i ${iDIR}/picture.png "
|
||||
notify_cmd_shot_win="${notify_cmd_base} -i ${iDIR}/picture.png "
|
||||
notify_cmd_shot="${notify_cmd_base}"
|
||||
notify_cmd_shot_win="${notify_cmd_base}"
|
||||
|
||||
# notify and view screenshot
|
||||
notify_view() {
|
||||
if [[ "$1" == "active" ]]; then
|
||||
if [[ -e "${active_window_path}" ]]; then
|
||||
"${sDIR}/Sounds.sh" --screenshot
|
||||
resp=$(timeout 5 ${notify_cmd_shot_win} " Screenshot of:" " ${active_window_class} Saved.")
|
||||
case "$resp" in
|
||||
action1)
|
||||
xdg-open "${active_window_path}" &
|
||||
;;
|
||||
action2)
|
||||
rm "${active_window_path}" &
|
||||
;;
|
||||
esac
|
||||
else
|
||||
${notify_cmd_shot} " Screenshot of:" " ${active_window_class} NOT Saved."
|
||||
"${sDIR}/Sounds.sh" --error
|
||||
fi
|
||||
|
||||
elif [[ "$1" == "swappy" ]]; then
|
||||
"${sDIR}/Sounds.sh" --screenshot
|
||||
resp=$(${notify_cmd_shot} " Screenshot:" " Captured by Swappy")
|
||||
case "$resp" in
|
||||
action1)
|
||||
swappy -f - <"$tmpfile"
|
||||
;;
|
||||
action2)
|
||||
rm "$tmpfile"
|
||||
;;
|
||||
esac
|
||||
|
||||
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
|
||||
local check_file="${dir}/${file}"
|
||||
if [[ -e "$check_file" ]]; then
|
||||
"${sDIR}/Sounds.sh" --screenshot
|
||||
resp=$(timeout 5 ${notify_cmd_shot} " Screenshot" " Saved")
|
||||
case "$resp" in
|
||||
action1)
|
||||
xdg-open "${check_file}" &
|
||||
;;
|
||||
action2)
|
||||
rm "${check_file}" &
|
||||
;;
|
||||
esac
|
||||
else
|
||||
${notify_cmd_shot} " Screenshot" " NOT Saved"
|
||||
"${sDIR}/Sounds.sh" --error
|
||||
fi
|
||||
${notify_cmd_shot} " Screenshot of:" " ${active_window_class} NOT Saved."
|
||||
"${sDIR}/Sounds.sh" --error
|
||||
fi
|
||||
|
||||
elif [[ "$1" == "swappy" ]]; then
|
||||
"${sDIR}/Sounds.sh" --screenshot
|
||||
resp=$(${notify_cmd_shot} " Screenshot:" " Captured by Swappy")
|
||||
case "$resp" in
|
||||
action1)
|
||||
swappy -f - <"$tmpfile"
|
||||
;;
|
||||
action2)
|
||||
rm "$tmpfile"
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
local check_file="${dir}/${file}"
|
||||
if [[ -e "$check_file" ]]; then
|
||||
"${sDIR}/Sounds.sh" --screenshot
|
||||
resp=$(timeout 5 ${notify_cmd_shot} " Screenshot" " Saved")
|
||||
case "$resp" in
|
||||
action1)
|
||||
xdg-open "${check_file}" &
|
||||
;;
|
||||
action2)
|
||||
rm "${check_file}" &
|
||||
;;
|
||||
esac
|
||||
else
|
||||
${notify_cmd_shot} " Screenshot" " NOT Saved"
|
||||
"${sDIR}/Sounds.sh" --error
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
# countdown
|
||||
countdown() {
|
||||
for sec in $(seq $1 -1 1); do
|
||||
notify-send -h string:x-canonical-private-synchronous:shot-notify -t 1000 -i "$iDIR"/timer.png " Taking shot" " in: $sec secs"
|
||||
sleep 1
|
||||
done
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
w_pos=$(hyprctl activewindow | grep 'at:' | cut -d':' -f2 | tr -d ' ' | tail -n1)
|
||||
w_size=$(hyprctl activewindow | grep 'size:' | cut -d':' -f2 | tr -d ' ' | tail -n1 | sed s/,/x/g)
|
||||
cd ${dir} && grim -g "$w_pos $w_size" - | tee "$file" | wl-copy
|
||||
notify_view
|
||||
}
|
||||
|
||||
shotarea() {
|
||||
tmpfile=$(mktemp)
|
||||
grim -g "$(slurp)" - >"$tmpfile"
|
||||
if [[ -s "$tmpfile" ]]; then
|
||||
wl-copy <"$tmpfile"
|
||||
mv "$tmpfile" "$dir/$file"
|
||||
fi
|
||||
notify_view
|
||||
tmpfile=$(mktemp)
|
||||
grim -g "$(slurp)" - >"$tmpfile"
|
||||
if [[ -s "$tmpfile" ]]; then
|
||||
wl-copy <"$tmpfile"
|
||||
mv "$tmpfile" "$dir/$file"
|
||||
fi
|
||||
notify_view
|
||||
}
|
||||
|
||||
shotactive() {
|
||||
active_window_class=$(hyprctl -j activewindow | jq -r '(.class)')
|
||||
active_window_file="Screenshot_${time}_${active_window_class}.png"
|
||||
active_window_path="${dir}/${active_window_file}"
|
||||
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"
|
||||
hyprctl -j activewindow | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | grim -g - "${active_window_path}"
|
||||
sleep 1
|
||||
notify_view "active"
|
||||
}
|
||||
|
||||
shotswappy() {
|
||||
tmpfile=$(mktemp)
|
||||
grim -g "$(slurp)" - >"$tmpfile" && notify_view "swappy"
|
||||
tmpfile=$(mktemp)
|
||||
grim -g "$(slurp)" - >"$tmpfile" && notify_view "swappy"
|
||||
}
|
||||
|
||||
if [[ ! -d "$dir" ]]; then
|
||||
mkdir -p "$dir"
|
||||
mkdir -p "$dir"
|
||||
fi
|
||||
|
||||
if [[ "$1" == "--now" ]]; then
|
||||
shotnow
|
||||
shotnow
|
||||
elif [[ "$1" == "--in5" ]]; then
|
||||
shot5
|
||||
shot5
|
||||
elif [[ "$1" == "--in10" ]]; then
|
||||
shot10
|
||||
shot10
|
||||
elif [[ "$1" == "--win" ]]; then
|
||||
shotwin
|
||||
shotwin
|
||||
elif [[ "$1" == "--area" ]]; then
|
||||
shotarea
|
||||
shotarea
|
||||
elif [[ "$1" == "--active" ]]; then
|
||||
shotactive
|
||||
shotactive
|
||||
elif [[ "$1" == "--swappy" ]]; then
|
||||
shotswappy
|
||||
shotswappy
|
||||
else
|
||||
echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy"
|
||||
echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,77 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# This script is used to play system sounds.
|
||||
# Script is used by Volume.Sh and ScreenShots.sh
|
||||
|
||||
theme="freedesktop" # Set the theme for the system sounds.
|
||||
mute=false # Set to true to mute the system sounds.
|
||||
|
||||
# Mute individual sounds here.
|
||||
muteScreenshots=false
|
||||
muteVolume=false
|
||||
|
||||
# Exit if the system sounds are muted.
|
||||
if [[ "$mute" = true ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Choose the sound to play.
|
||||
if [[ "$1" == "--screenshot" ]]; then
|
||||
if [[ "$muteScreenshots" = true ]]; then
|
||||
exit 0
|
||||
fi
|
||||
soundoption="screen-capture.*"
|
||||
elif [[ "$1" == "--volume" ]]; then
|
||||
if [[ "$muteVolume" = true ]]; then
|
||||
exit 0
|
||||
fi
|
||||
soundoption="audio-volume-change.*"
|
||||
elif [[ "$1" == "--error" ]]; then
|
||||
if [[ "$muteScreenshots" = true ]]; then
|
||||
exit 0
|
||||
fi
|
||||
soundoption="dialog-error.*"
|
||||
else
|
||||
echo -e "Available sounds: --screenshot, --volume, --error"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Set the directory defaults for system sounds.
|
||||
if [ -d "/run/current-system/sw/share/sounds" ]; then
|
||||
systemDIR="/run/current-system/sw/share/sounds" # NixOS
|
||||
else
|
||||
systemDIR="/usr/share/sounds"
|
||||
fi
|
||||
userDIR="$HOME/.local/share/sounds"
|
||||
defaultTheme="freedesktop"
|
||||
|
||||
# Prefer the user's theme, but use the system's if it doesn't exist.
|
||||
sDIR="$systemDIR/$defaultTheme"
|
||||
if [ -d "$userDIR/$theme" ]; then
|
||||
sDIR="$userDIR/$theme"
|
||||
elif [ -d "$systemDIR/$theme" ]; then
|
||||
sDIR="$systemDIR/$theme"
|
||||
fi
|
||||
|
||||
# Get the theme that it inherits.
|
||||
iTheme=$(cat "$sDIR/index.theme" | grep -i "inherits" | cut -d "=" -f 2)
|
||||
iDIR="$sDIR/../$iTheme"
|
||||
|
||||
# Find the sound file and play it.
|
||||
sound_file=$(find $sDIR/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
sound_file=$(find $iDIR/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
sound_file=$(find $userDIR/$defaultTheme/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
sound_file=$(find $systemDIR/$defaultTheme/stereo -name "$soundoption" -print -quit)
|
||||
if ! test -f "$sound_file"; then
|
||||
echo "Error: Sound file not found."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# pipewire priority, fallback pulseaudio
|
||||
pw-play "$sound_file" || pa-play "$sound_file"
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# This is for changing kb_layouts. Set kb_layouts in $settings_file
|
||||
|
||||
layout_file="$HOME/.cache/kb_layout"
|
||||
settings_file="$HOME/.config/hypr/UserConfigs/UserSettings.conf"
|
||||
notif_icon="$HOME/.config/swaync/images/bell.png"
|
||||
|
||||
# Refined ignore list with patterns or specific device names
|
||||
ignore_patterns=(
|
||||
"--(avrcp)"
|
||||
"Bluetooth Speaker"
|
||||
"Other Device
|
||||
Name"
|
||||
)
|
||||
|
||||
|
||||
# Create layout file with default layout if it does not exist
|
||||
if [ ! -f "$layout_file" ]; then
|
||||
echo "Creating layout file..."
|
||||
default_layout=$(grep 'kb_layout = ' "$settings_file" | cut -d '=' -f 2 | tr -d '[:space:]' | cut -d ',' -f 1 2>/dev/null)
|
||||
default_layout=${default_layout:-"us"} # Default to 'us' layout
|
||||
echo "$default_layout" > "$layout_file"
|
||||
echo "Default layout set to $default_layout"
|
||||
fi
|
||||
|
||||
current_layout=$(cat "$layout_file")
|
||||
echo "Current layout: $current_layout"
|
||||
|
||||
# Read available layouts from settings file
|
||||
if [ -f "$settings_file" ]; then
|
||||
kb_layout_line=$(grep 'kb_layout = ' "$settings_file" | cut -d '=' -f 2)
|
||||
# Remove leading and trailing spaces around each layout
|
||||
kb_layout_line=$(echo "$kb_layout_line" | tr -d '[:space:]')
|
||||
IFS=',' read -r -a layout_mapping <<< "$kb_layout_line"
|
||||
else
|
||||
echo "Settings file not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
layout_count=${#layout_mapping[@]}
|
||||
echo "Number of layouts: $layout_count"
|
||||
|
||||
# Find current layout index and calculate next layout
|
||||
for ((i = 0; i < layout_count; i++)); do
|
||||
if [ "$current_layout" == "${layout_mapping[i]}" ]; then
|
||||
current_index=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
next_index=$(( (current_index + 1) % layout_count ))
|
||||
new_layout="${layout_mapping[next_index]}"
|
||||
echo "Next layout: $new_layout"
|
||||
|
||||
# Function to get keyboard names
|
||||
get_keyboard_names() {
|
||||
hyprctl devices -j | jq -r '.keyboards[].name'
|
||||
}
|
||||
|
||||
# Function to check if a device matches any ignore pattern
|
||||
is_ignored() {
|
||||
local device_name=$1
|
||||
for pattern in "${ignore_patterns[@]}"; do
|
||||
if [[ "$device_name" == *"$pattern"* ]]; then
|
||||
return 0 # Device matches ignore pattern
|
||||
fi
|
||||
done
|
||||
return 1 # Device does not match any ignore pattern
|
||||
}
|
||||
|
||||
# Function to change keyboard layout
|
||||
change_layout() {
|
||||
local error_found=false
|
||||
|
||||
while read -r name; do
|
||||
if is_ignored "$name"; then
|
||||
echo "Skipping ignored device: $name"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Switching layout for $name to $new_layout..."
|
||||
hyprctl switchxkblayout "$name" "$next_index"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error while switching layout for $name." >&2
|
||||
error_found=true
|
||||
fi
|
||||
done <<< "$(get_keyboard_names)"
|
||||
|
||||
$error_found && return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
# Execute layout change and notify
|
||||
if ! change_layout; then
|
||||
notify-send -u low -t 2000 'kb_layout' " Error:" " Layout change failed"
|
||||
echo "Layout change failed." >&2
|
||||
exit 1
|
||||
else
|
||||
notify-send -u low -i "$notif_icon" " kb_layout: $new_layout"
|
||||
echo "Layout change notification sent."
|
||||
fi
|
||||
|
||||
echo "$new_layout" > "$layout_file"
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# For disabling touchpad.
|
||||
# Edit the Touchpad_Device on ~/.config/hypr/UserConfigs/Laptops.conf according to your system
|
||||
# use hyprctl devices to get your system touchpad device name
|
||||
# source https://github.com/hyprwm/Hyprland/discussions/4283?sort=new#discussioncomment-8648109
|
||||
|
||||
notif="$HOME/.config/swaync/images/bell.png"
|
||||
|
||||
export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
|
||||
|
||||
enable_touchpad() {
|
||||
printf "true" >"$STATUS_FILE"
|
||||
notify-send -u low -i $notif " Enabling" " touchpad"
|
||||
hyprctl keyword '$TOUCHPAD_ENABLED' "true" -r
|
||||
}
|
||||
|
||||
disable_touchpad() {
|
||||
printf "false" >"$STATUS_FILE"
|
||||
notify-send -u low -i $notif " Disabling" " touchpad"
|
||||
hyprctl keyword '$TOUCHPAD_ENABLED' "false" -r
|
||||
}
|
||||
|
||||
if ! [ -f "$STATUS_FILE" ]; then
|
||||
enable_touchpad
|
||||
else
|
||||
if [ $(cat "$STATUS_FILE") = "true" ]; then
|
||||
disable_touchpad
|
||||
elif [ $(cat "$STATUS_FILE") = "false" ]; then
|
||||
enable_touchpad
|
||||
fi
|
||||
fi
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
#!/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"
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Scripts for volume controls for audio and mic
|
||||
|
||||
iDIR="$HOME/.config/swaync/icons"
|
||||
sDIR="$HOME/.config/hypr/scripts"
|
||||
|
||||
# Get Volume
|
||||
get_volume() {
|
||||
volume=$(pamixer --get-volume)
|
||||
if [[ "$volume" -eq "0" ]]; then
|
||||
echo "Muted"
|
||||
else
|
||||
echo "$volume %"
|
||||
fi
|
||||
}
|
||||
|
||||
# Get icons
|
||||
get_icon() {
|
||||
current=$(get_volume)
|
||||
if [[ "$current" == "Muted" ]]; then
|
||||
echo "$iDIR/volume-mute.png"
|
||||
elif [[ "${current%\%}" -le 30 ]]; then
|
||||
echo "$iDIR/volume-low.png"
|
||||
elif [[ "${current%\%}" -le 60 ]]; then
|
||||
echo "$iDIR/volume-mid.png"
|
||||
else
|
||||
echo "$iDIR/volume-high.png"
|
||||
fi
|
||||
}
|
||||
|
||||
# Notify
|
||||
notify_user() {
|
||||
if [[ "$(get_volume)" == "Muted" ]]; then
|
||||
notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" " Volume:" " Muted"
|
||||
else
|
||||
notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" " Volume Level:" " $(get_volume)" &&
|
||||
"$sDIR/Sounds.sh" --volume
|
||||
fi
|
||||
}
|
||||
|
||||
# Increase Volume
|
||||
inc_volume() {
|
||||
if [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
toggle_mute
|
||||
else
|
||||
pamixer -i 5 --allow-boost --set-limit 150 && notify_user
|
||||
fi
|
||||
}
|
||||
|
||||
# Decrease Volume
|
||||
dec_volume() {
|
||||
if [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
toggle_mute
|
||||
else
|
||||
pamixer -d 5 && notify_user
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggle Mute
|
||||
toggle_mute() {
|
||||
if [ "$(pamixer --get-mute)" == "false" ]; then
|
||||
pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" " Mute"
|
||||
elif [ "$(pamixer --get-mute)" == "true" ]; then
|
||||
pamixer -u && notify-send -e -u low -i "$(get_icon)" " Volume:" " Switched ON"
|
||||
fi
|
||||
}
|
||||
|
||||
# Toggle Mic
|
||||
toggle_mic() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "false" ]; then
|
||||
pamixer --default-source -m && notify-send -e -u low -i "$iDIR/microphone-mute.png" " Microphone:" " Switched OFF"
|
||||
elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
pamixer -u --default-source u && notify-send -e -u low -i "$iDIR/microphone.png" " Microphone:" " Switched ON"
|
||||
fi
|
||||
}
|
||||
# Get Mic Icon
|
||||
get_mic_icon() {
|
||||
current=$(pamixer --default-source --get-volume)
|
||||
if [[ "$current" -eq "0" ]]; then
|
||||
echo "$iDIR/microphone-mute.png"
|
||||
else
|
||||
echo "$iDIR/microphone.png"
|
||||
fi
|
||||
}
|
||||
|
||||
# Get Microphone Volume
|
||||
get_mic_volume() {
|
||||
volume=$(pamixer --default-source --get-volume)
|
||||
if [[ "$volume" -eq "0" ]]; then
|
||||
echo "Muted"
|
||||
else
|
||||
echo "$volume %"
|
||||
fi
|
||||
}
|
||||
|
||||
# Notify for Microphone
|
||||
notify_mic_user() {
|
||||
volume=$(get_mic_volume)
|
||||
icon=$(get_mic_icon)
|
||||
notify-send -e -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -u low -i "$icon" " Mic Level:" " $volume"
|
||||
}
|
||||
|
||||
# Increase MIC Volume
|
||||
inc_mic_volume() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
toggle_mic
|
||||
else
|
||||
pamixer --default-source -i 5 && notify_mic_user
|
||||
fi
|
||||
}
|
||||
|
||||
# Decrease MIC Volume
|
||||
dec_mic_volume() {
|
||||
if [ "$(pamixer --default-source --get-mute)" == "true" ]; then
|
||||
toggle-mic
|
||||
else
|
||||
pamixer --default-source -d 5 && notify_mic_user
|
||||
fi
|
||||
}
|
||||
|
||||
# Execute accordingly
|
||||
if [[ "$1" == "--get" ]]; then
|
||||
get_volume
|
||||
elif [[ "$1" == "--inc" ]]; then
|
||||
inc_volume
|
||||
elif [[ "$1" == "--dec" ]]; then
|
||||
dec_volume
|
||||
elif [[ "$1" == "--toggle" ]]; then
|
||||
toggle_mute
|
||||
elif [[ "$1" == "--toggle-mic" ]]; then
|
||||
toggle_mic
|
||||
elif [[ "$1" == "--get-icon" ]]; then
|
||||
get_icon
|
||||
elif [[ "$1" == "--get-mic-icon" ]]; then
|
||||
get_mic_icon
|
||||
elif [[ "$1" == "--mic-inc" ]]; then
|
||||
inc_mic_volume
|
||||
elif [[ "$1" == "--mic-dec" ]]; then
|
||||
dec_mic_volume
|
||||
else
|
||||
get_volume
|
||||
fi
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Script for waybar layout or configs
|
||||
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Define directories
|
||||
waybar_layouts="$HOME/.config/waybar/configs"
|
||||
waybar_config="$HOME/.config/waybar/config"
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
rofi_config="$HOME/.config/rofi/config-waybar-layout.rasi"
|
||||
|
||||
# Function to display menu options
|
||||
menu() {
|
||||
options=()
|
||||
while IFS= read -r file; do
|
||||
options+=("$(basename "$file")")
|
||||
done < <(find "$waybar_layouts" -maxdepth 1 -type f -exec basename {} \; | sort)
|
||||
|
||||
printf '%s\n' "${options[@]}"
|
||||
}
|
||||
|
||||
# Apply selected configuration
|
||||
apply_config() {
|
||||
ln -sf "$waybar_layouts/$1" "$waybar_config"
|
||||
#restart_waybar_if_needed
|
||||
"${SCRIPTSDIR}/Refresh.sh" &
|
||||
}
|
||||
|
||||
# Main function
|
||||
main() {
|
||||
choice=$(menu | rofi -i -dmenu -config "$rofi_config")
|
||||
|
||||
if [[ -z "$choice" ]]; then
|
||||
echo "No option selected. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case $choice in
|
||||
"no panel")
|
||||
pgrep -x "waybar" && pkill waybar || true
|
||||
;;
|
||||
*)
|
||||
apply_config "$choice"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Kill Rofi if already running before execution
|
||||
if pgrep -x "rofi" >/dev/null; then
|
||||
pkill rofi
|
||||
#exit 0
|
||||
fi
|
||||
|
||||
main
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
#!/bin/bash
|
||||
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
|
||||
# Script for waybar styles
|
||||
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Define directories
|
||||
waybar_styles="$HOME/.config/waybar/style"
|
||||
waybar_style="$HOME/.config/waybar/style.css"
|
||||
SCRIPTSDIR="$HOME/.config/hypr/scripts"
|
||||
rofi_config="$HOME/.config/rofi/config-waybar-style.rasi"
|
||||
|
||||
# Function to display menu options
|
||||
menu() {
|
||||
options=()
|
||||
while IFS= read -r file; do
|
||||
if [ -f "$waybar_styles/$file" ]; then
|
||||
options+=("$(basename "$file" .css)")
|
||||
fi
|
||||
done < <(find "$waybar_styles" -maxdepth 1 -type f -name '*.css' -exec basename {} \; | sort)
|
||||
|
||||
printf '%s\n' "${options[@]}"
|
||||
}
|
||||
|
||||
# Apply selected style
|
||||
apply_style() {
|
||||
ln -sf "$waybar_styles/$1.css" "$waybar_style"
|
||||
"${SCRIPTSDIR}/Refresh.sh" &
|
||||
}
|
||||
|
||||
# Main function
|
||||
main() {
|
||||
choice=$(menu | rofi -i -dmenu -config "$rofi_config")
|
||||
|
||||
if [[ -z "$choice" ]]; then
|
||||
echo "No option selected. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
apply_style "$choice"
|
||||
}
|
||||
|
||||
# Kill Rofi if already running before execution
|
||||
if pgrep -x "rofi" >/dev/null; then
|
||||
pkill rofi
|
||||
#exit 0
|
||||
fi
|
||||
|
||||
main
|
||||
Loading…
Add table
Add a link
Reference in a new issue