This commit is contained in:
sankalp committed 2024-01-28 14:42:32 +05:45
1 parent cffd9482e9
commit 662fb5ff83
15 files changed
+615 -670

No files matched your search

+3 -3
View File
@@ -26,13 +26,13 @@ play_music() {
local choice="$1"
local link="${menu_options[$choice]}"
notification "Playing now: $choice"
# Check if the link is a playlist
if [[ $link == *playlist* ]]; then
mpv --shuffle --vid=no --no-resume-playback "$link"
else
notification "Playing now: $choice"
elif [[ -n $link ]]; then
mpv "$link"
notification "Playing now: $choice"
fi
}
+1 -1
View File
@@ -33,7 +33,7 @@ FPS1=30
TYPE1="wipe"
DURATION1=1
BEZIER1=".43,1.19,1,.4"
SWWW_PARAMS1="--transition-fps $FPS1 --transition-type $TYPE1 --transition-duration $DURATION1"
SWWW_PARAMS1="--transition-fps $FPS1 --transition-type $TYPE1 --transition-duration $DURATION1 --transition-bezier ${BEZIER1}"
# For Keyboard Layout Switcher
+1 -1
View File
@@ -211,6 +211,6 @@ hyprctl dispatch exec "[float;size 45% 80%;center 1] kitty keyb -k '$CONFIG'"
# Emoji (ALT SLASH)
emoji() {
A="$(rofi -dmenu -l 10 -p "Emoji:" -config ~/.config/rofi/config-long.rasi < "$HOME/.config/hypr/configs/emojis" | cut -d' ' -f1 | tr -d '\n')"
A="$(rofi -dmenu -p "Emoji:" -config ~/.config/rofi/config-long.rasi < "$HOME/.config/hypr/configs/emojis" | cut -d ' ' -f 1 | tr -d '\n')"
[[ -n "$A" ]] && wl-copy -- "$A"
}
-14
View File
@@ -51,12 +51,6 @@ reloadall() {
waybar &
sleep 0.5
swaync > /dev/null 2>&1 &
sleep 1
script_path="${UserSCRIPTSDIR}/RainbowBorders.sh"
if file_exists "$script_path"; then
"$script_path" &
fi
}
reload_waybar() {
_ps=(waybar rofi)
@@ -82,14 +76,6 @@ reload_hypr() {
hyprctl reload
notify-send -u low -i $notif 'Reload Hyprland'
}
restart_waybar_if_needed() {
if pgrep -x "waybar" >/dev/null; then
pkill waybar
sleep 0.1 # Delay for Waybar to completely terminate
fi
reload_waybar &
}
lock_screen() {
LOCKCONFIG="$HOME/.config/swaylock/config"
sleep 0.5s
+5 -34
View File
@@ -69,7 +69,7 @@ randomwall() {
if [[ ${#PICS[@]} -gt 0 ]]; then
RANDOMPICS=${PICS[RANDOM % ${#PICS[@]}]} # Select a random image
swww img "${RANDOMPICS}" ${SWWW_PARAMS} # Set the randomly selected wallpaper
linker
$linker
else
echo "No images found in ${wallDIR}"
fi
@@ -84,7 +84,7 @@ autowall() {
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} && $linker
sleep $INTERVAL
done
@@ -113,43 +113,13 @@ selectwall() {
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" && $linker
else
echo "No wallpaper selected. Exiting."
exit 0
fi
}
select_wall(){
# Set some variables
rofi_command="rofi -dmenu -theme ${HOME}/.config/rofi/WallSelect.rasi -theme-str ${rofi_override}"
rofi_override="element-icon{size:${monitor_res}px;border-radius:0px;}"
# Launch rofi
wall_selection=$(find "${wallDIR}" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.webp" \) -exec basename {} \; | sort | while read -r A ; do echo -en "$A\x00icon\x1f""${wallDIR}"/"$A\n" ; done | $rofi_command)
# Set wallpaper
[[ -n "$wall_selection" ]] || exit 1
swww img $SWWW_PARAMS1 "${wallDIR}"/"${wall_selection}" && linker
exit 0
}
sr() {
if pgrep -x "wf-recorder" > /dev/null; then
pkill -SIGTERM wf-recorder
wait "$(pgrep -o wf-recorder)" || true
notify-send "Screen recording stopped."
else
wf-recorder --force-yuv -c libx264rgb -t -f "$HOME/Videos/sr--$(date +'%I:%M:%S_%p_%d-%m-%Y.mp4')" --audio=alsa_output.pci-0000_03_00.6.analog-stereo.monitor &
disown
notify-send "Screen recording started."
fi
}
# Waybar Layout (ALT W)
waybarl() {
menu() {
@@ -167,7 +137,7 @@ restart_waybar_if_needed() {
$RunCMD reload_waybar &
}
main() {
choice=$(menu | rofi -dmenu -p " Choose Waybar Layout")
choice=$(menu | rofi -dmenu -p "  Choose Waybar Layout")
[[ -z "$choice" ]] && { echo "No option selected. Exiting."; exit 0; }
@@ -239,6 +209,7 @@ echo "$new_layout" > "$layout_f"
notify-send -u low -i "$notif" "Keyboad Layout Changed to $new_layout"
}
# Symbolic link for wallpaper
linker() {
# Define the path to the swww cache directory
cache_dir="$HOME/.cache/swww/"