This commit is contained in:
sankalp committed 2024-03-27 14:12:02 +05:45
1 parent d1e4e2f9af
commit 28527dfce3
15 files changed
+275 -799

No files matched your search

+2 -1
View File
@@ -7,11 +7,12 @@ STATUS_FILE="$DIR/touchpad.status"
# For Notification icon
notif="$HOME/dotfiles/hypr/assets/bell.png"
reload="$HOME/dotfiles/hypr/assets/reload.png"
# Scripts DIR
SCRIPTSDIR="$HOME/dotfiles/hypr/scripts"
UserSCRIPTSDIR="$HOME/dotfiles/hypr/UserScripts"
linker="$SCRIPTSDIR/RunCMD.sh linker"
# For Random Wallpaper
wallDIR="$HOME/Pictures/wallpapers"
+1 -1
View File
@@ -54,7 +54,7 @@ edit() {
######################################
keybind() {
CONFIG=$(fd --base-directory "$HOME/dotfiles/keyb/bindings" --type f . | rofi -dmenu -config ~/dotfiles/rofi/config-long.rasi)
CONFIG=$(fd --base-directory "$HOME/dotfiles/keyb/bindings" --type f . | rofi -dmenu -p "Keybinds" -config ~/dotfiles/rofi/config-long.rasi)
hyprctl dispatch exec "[float;size 45% 80%;center 1] kitty keyb -k '$HOME/dotfiles/keyb/bindings/$CONFIG'"
}
+2 -3
View File
@@ -93,7 +93,7 @@ reload_waybar() {
if [[ -z $1 ]]; then
waybar &
fi
notify-send -u low -i $notif "Reload Waybar"
notify-send -u low -i $reload "Reload Waybar"
}
@@ -105,8 +105,7 @@ reload_waybar() {
reload_hypr() {
hyprctl reload
$RunCMD linker
notify-send -u low -i $notif 'Reload Hyprland'
notify-send -u low -i $reload 'Reload Hyprland'
}
######################################
+4 -29
View File
@@ -104,7 +104,6 @@ random_wall() {
if [[ ${#PICS[@]} -gt 0 ]]; then
RANDOMPICS=${PICS[RANDOM % ${#PICS[@]}]} # Select a random image
swww img "${RANDOMPICS}" ${SWWW_PARAMS} # Set the randomly selected wallpaper
$linker
else
echo "No images found in ${wallDIR}"
fi
@@ -122,7 +121,7 @@ auto_wall() {
while true; do
find "$wallDIR" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \) -print0 \
| shuf -z -n 1 \
| xargs -0 -I {} swww img "{}" ${SWWW_PARAMS} && $linker
| xargs -0 -I {} swww img "{}" ${SWWW_PARAMS} &&
sleep $INTERVAL
done
}
@@ -145,13 +144,13 @@ select_wall() {
exit 1
fi
images=$(find "$wallDIR" -maxdepth 1 -type f -printf "%f\x00icon\x1f$wallDIR/%f\n" | sort -n)
choice=$(echo -en "$images\nRandom Choice" | rofi -dmenu -i -show-icons -theme-str "$(build_theme 3 5 6)" config ~/dotfiles/rofi/config-wallpaper.rasi)
choice=$(echo -en "$images\nRandom Choice" | rofi -dmenu -i -show-icons -theme-str "$(build_theme 3 5 6)" -p "󰸉 Wallpaper")
if [ -n "$choice" ]; then
if [ "$choice" = "Random Choice" ]; then
choice=$(find "$wallDIR" -type f -maxdepth 1 -printf "%f\n" | shuf -n1)
fi
wallpaper="$wallDIR/${choice#*icon\x1f}"
swww img $SWWW_PARAMS1 "$wallpaper" && $linker
swww img $SWWW_PARAMS1 "$wallpaper"
else
echo "No wallpaper selected. Exiting."
exit 0
@@ -207,7 +206,7 @@ gamemode() {
else
notify-send -e -u normal -i "$notif" "All animations normal"
hyprctl keyword animations:enabled 1
swww init && swww img "$HOME/dotfiles/rofi/.current_wallpaper"
swww query || swww init && $random_wall
fi
}
@@ -259,30 +258,6 @@ notify-send -u low -i "$notif" "Keyboad Layout Changed to $new_layout"
}
######################################
# #
# Symbolic Linker for Wallpaper #
# #
######################################
linker() {
cache_dir="$HOME/.cache/swww/" # Define the path to the swww cache directory
monitor_outputs=("$cache_dir"/*) # Get a list of monitor outputs
ln_success=false # Initialize a flag to determine if the ln command was executed
for cache_file in "${monitor_outputs[@]}"; do # Loop through monitor outputs
if [ -f "$cache_file" ]; then # Check if the cache file exists for the current monitor output
wallpaper_path=$(<"$cache_file") # Get the wallpaper path from the cache file
if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then # Copy the wallpaper to the location Rofi can access
ln_success=true # Set the flag to true upon successful execution
break # Exit the loop after processing the first found monitor output
fi
fi
done
if $ln_success; then # Add a message indicating whether the ln command was successful
echo "Wallpaper linked successfully."
else
echo "Failed to link wallpaper."
fi
}
######################################
# #
+1 -1
View File
@@ -60,7 +60,7 @@ declare -A menu_options=(
main() {
choice=$(
printf "%s\n" "${!menu_options[@]}" |
rofi -dmenu -config ~/.config/rofi/config-long.rasi \
rofi -dmenu \
-p "Rofi" \
-mesg "Hello" \
-max-history-size 0 \