Massive Updates

This commit is contained in:
sankalp committed 2024-01-07 22:32:54 +05:45
1 parent 007c2f8edb
commit 5f37d6c0ec
109 files changed
+7670 -3972

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
CONFIG=$(rofi -show file-browser-extended -file-browser-stdout -file-browser-dir "$HOME"/.config/keyb/bindings -config ~/.config/rofi/config-long.rasi)
hyprctl dispatch exec "[float;size 45% 80%;center 1] kitty keyb -k '$CONFIG'"
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
# Rofi menu for Quick Edit / View of Settings (SUPER E)
configs="$HOME/.config/hypr/configs"
UserConfigs="$HOME/.config/hypr/UserConfigs"
menu(){
printf "1. view Env-variables\n"
printf "2. view Window-Rules\n"
printf "3. view Startup_Apps\n"
printf "4. view User-Keybinds\n"
printf "5. view Monitors\n"
printf "6. view Laptop-Keybinds\n"
printf "7. view User-Settings\n"
printf "8. view Default-Settings\n"
printf "9. view Default-Keybinds\n"
}
main() {
choice=$(menu | rofi -dmenu -i -l 7 -p " View / Edit Hyprland Configs:" -config ~/.config/rofi/config-compact.rasi | cut -d. -f1)
case $choice in
1)
kitty -e nano "$UserConfigs/ENVariables.conf"
;;
2)
kitty -e nano "$UserConfigs/WindowRules.conf"
;;
3)
kitty -e nano "$UserConfigs/Startup_Apps.conf"
;;
4)
kitty -e nano "$UserConfigs/UserKeybinds.conf"
;;
5)
kitty -e nano "$UserConfigs/Monitors.conf"
;;
6)
kitty -e nano "$UserConfigs/Laptops.conf"
;;
7)
kitty -e nano "$UserConfigs/UserSettings.conf"
;;
8)
kitty -e nano "$configs/Settings.conf"
;;
9)
kitty -e nano "$configs/Keybinds.conf"
;;
*)
;;
esac
}
main
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
function random_hex() {
random_hex=("0xff$(openssl rand -hex 3)")
echo $random_hex
}
hyprctl keyword general:col.active_border $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) 270deg
hyprctl keyword general:col.inactive_border $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) $(random_hex) 270deg
+84
View File
@@ -0,0 +1,84 @@
#!/usr/bin/env bash
# Directory for icons
iDIR="$HOME/.config/swaync/icons"
LOFI_STREAM="https://www.youtube.com/watch?v=jfKfPfyJRdk"
ALL_TIME_CHILL_HITS="https://www.youtube.com/playlist?list=PL1FPWPLPHKhysG2trm9RKV8FG3eQ7J4VN"
ALL_TIME_MALAYALAM_HITS="https://www.youtube.com/playlist?list=PL1FPWPLPHKhyZeoBv-Ws_eRiWiUYKkuDz"
HAND_PICKED_HITS="https://music.youtube.com/playlist?list=PLAj6caR1_EYHevz9nP5CzbE-z8viVAyI3&feature=share"
BHAJAN="https://youtube.com/playlist?list=PLwIh-QEhrDJDM8IF3gLUgnEyZm6dBgr_n&si=_RDHngYobHlcxaJW"
# Player menu controls
play=" Play music"
pause=" Pause music"
stop=" Stop music"
next_track=" Next track"
prev_track=" Previous track"
increase_volume="󰝝 Increase volume"
decrease_volume="󰝞 Decrease volume"
# Music menu controls
play_bhajan="󰥳 Play Bhajan"
play_lofi=" Play lofi girl"
play_chill_hits="1.  Play All time chill hits"
play_malayalam_hits="2.  Play All time malayalam hits"
play_hand_picked_hits="3.  Play hand picked hits"
function notify() {
notify-send -u normal -i "$iDIR/music.png" "$1"
}
function music() {
local chosen=$(printf "%s\n%s\n%s\n%s\n" "$play_bhajan" "$play_lofi" "$play_chill_hits" "$play_malayalam_hits" "$play_hand_picked_hits" | rofi -dmenu -i -l 6 -p "Music Time:" -config ~/.config/rofi/config.rasi)
if [[ "$chosen" == "$play_bhajan" ]]; then
notify "Playing Bhajan"
exec -a "rofi-music" mpv --no-video "$BHAJAN" --shuffle --no-resume-playback
elif [[ "$chosen" == "$play_lofi" ]]; then
notify "🎹 Playing lofi girl"
exec -a "rofi-music" mpv --no-video "$LOFI_STREAM" --no-resume-playback
elif [[ "$chosen" == "$play_chill_hits" ]]; then
notify "🎹 Playing all time chill hits"
exec -a "rofi-music" mpv --no-video "$ALL_TIME_CHILL_HITS" --shuffle --no-resume-playback
elif [[ "$chosen" == "$play_malayalam_hits" ]]; then
notify "🎹 Playing malayalam hits"
exec -a "rofi-music" mpv --no-video "$ALL_TIME_MALAYALAM_HITS" --shuffle --no-resume-playback
elif [[ "$chosen" == "$play_hand_picked_hits" ]]; then
notify "🎹 Playing hand picked hits"
exec -a "rofi-music" mpv --no-video "$HAND_PICKED_HITS" --shuffle --no-resume-playback
fi
}
function controls() {
local chosen=$(printf "%s\n%s\n%s\n%s\n%s\n%s\n%s\n" "$play" "$pause" "$stop" "$next_track" "$prev_track" "$increase_volume" "$decrease_volume" | rofi -dmenu -i -l 7 -p "Music Controls:" -config ~/.config/rofi/config.rasi)
if [[ "$chosen" == "$play" ]]; then
playerctl --player=mpv play && notify-send -u normal -i "$1" "▶️ Resuming music"
elif [[ "$chosen" == "$pause" ]]; then
playerctl --player=mpv pause && notify-send -u normal -i "$1" "⏸️ Music paused"
elif [[ "$chosen" == "$stop" ]]; then
kill $(pidof "rofi-music") && notify-send -u normal -i "$1" "🛑 Music stopped"
elif [[ "$chosen" == "$next_track" ]]; then
playerctl --player=mpv next && notify-send -u normal -i "$1" "⏭️ Next track playing"
elif [[ "$chosen" == "$prev_track" ]]; then
playerctl --player=mpv previous && notify-send -u normal -i "$1" "⏮️ Previous track playing"
elif [[ "$chosen" == "$increase_volume" ]]; then
current_volume=$(playerctl --player=mpv volume)
new_volume=$(echo "$current_volume + 0.1" | bc)
playerctl --player=mpv volume $new_volume && notify-send -u normal -i "$1" "🔊 Increasing track volume"
elif [[ "$chosen" == "$decrease_volume" ]]; then
current_volume=$(playerctl --player=mpv volume)
new_volume=$(echo "$current_volume - 0.1" | bc)
playerctl --player=mpv volume $new_volume && notify-send -u normal -i "$1" "🔉 Decreasing track volume"
fi
}
# Check if music is running
if pidof "rofi-music" > /dev/null; then
controls
else
music
fi
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
# wlsunset project page
# https://sr.ht/~kennylevinsen/wlsunset/
wlsunset -t 4000 -T 6500 -d 900 -S 07:00 -s 19:00
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
# For disabling touchpad.
notif="$HOME/.config/swaync/images/bell.png"
# NOTE: find the right device using hyprctl devices
HYPRLAND_DEVICE="dll07a7:01-044e:120b"
XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)}
STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
toggle_touchpad() {
if [ ! -f "$STATUS_FILE" ] || [ "$(cat "$STATUS_FILE")" = "false" ]; then
echo "true" > "$STATUS_FILE"
action="enabled"
else
echo "false" > "$STATUS_FILE"
action="disabled"
fi
notify-send -u low -i "$notif" "Touchpad $action"
hyprctl keyword "device:$HYPRLAND_DEVICE:enabled" "$(cat "$STATUS_FILE")"
}
toggle_touchpad
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
# source https://wiki.archlinux.org/title/Hyprland#Using_a_script_to_change_wallpaper_every_X_minutes
# This script will randomly go through the files of a directory, setting it
# up as the wallpaper at regular intervals
#
# NOTE: this script uses bash (not POSIX shell) for the RANDOM variable
if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then
echo "Usage:
$0 <dir containing images>"
exit 1
fi
# Edit below to control the images transition
export SWWW_TRANSITION_FPS=60
export SWWW_TRANSITION_TYPE=simple
# This controls (in seconds) when to switch to the next image
INTERVAL=1800
while true; do
find "$1" \
| while read -r img; do
echo "$((RANDOM % 1000)):$img"
done \
| sort -n | cut -d':' -f2- \
| while read -r img; do
# Create symbolic link to the current image
ln -sf "$img" $HOME/.config/hypr/.current_wallpaper
swww img "$img"
sleep $INTERVAL
done
done
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
# Script for Random Wallpaper (SHIFT ALT W)
# Directory paths
wallDIR="$HOME/Pictures/wallpapers"
hyprConfigDir="$HOME/.config/hypr"
scriptsDir="$hyprConfigDir/scripts"
# Check if swww is initialized; if not, initialize it
swww query || swww init
# Array of image files in wallDIR
PICS=($(find "${wallDIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \)))
# Check if there are images in the specified directory
if [ ${#PICS[@]} -eq 0 ]; then
echo "No images found in ${wallDIR}. Exiting."
exit 1
fi
# Select a random image
RANDOMPICS=${PICS[$RANDOM % ${#PICS[@]}]}
# Transition config
FPS=60
TYPE="random"
DURATION=1
BEZIER=".43,1.19,1,.4"
SWWW_PARAMS="--transition-fps ${FPS} --transition-type ${TYPE} --transition-duration ${DURATION} --transition-bezier ${BEZIER}"
# Set the randomly selected wallpaper
swww img "${RANDOMPICS}" ${SWWW_PARAMS}
# Create symbolic link to the selected wallpaper
ln -sf "${RANDOMPICS}" "${hyprConfigDir}/.current_wallpaper"
+87
View File
@@ -0,0 +1,87 @@
#!/bin/bash
# This script for selecting wallpapers (SUPER W)
SCRIPTSDIR="$HOME/.config/hypr/scripts"
# WALLPAPERS PATH
DIR="$HOME/Pictures/wallpapers"
# Transition config
FPS=30
TYPE="wipe"
DURATION=1
BEZIER=".43,1.19,1,.4"
SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION"
# Check if swaybg is running
if pidof swaybg > /dev/null; then
pkill swaybg
fi
# Retrieve image files
PICS=($(ls "${DIR}" | grep -E ".jpg$|.jpeg$|.png$|.gif$"))
RANDOM_PIC="${PICS[$((RANDOM % ${#PICS[@]}))]}"
RANDOM_PIC_NAME="${#PICS[@]}. random"
# Rofi command
rofi_command="rofi -show -dmenu -config ~/.config/rofi/config-wallpaper.rasi"
menu() {
for i in "${!PICS[@]}"; do
# Displaying .gif to indicate animated images
if [[ -z $(echo "${PICS[$i]}" | grep .gif$) ]]; then
printf "$(echo "${PICS[$i]}" | cut -d. -f1)\x00icon\x1f${DIR}/${PICS[$i]}\n"
else
printf "${PICS[$i]}\n"
fi
done
printf "$RANDOM_PIC_NAME\n"
}
swww query || swww init
main() {
choice=$(menu | ${rofi_command})
# No choice case
if [[ -z $choice ]]; then
exit 0
fi
# Random choice case
if [ "$choice" = "$RANDOM_PIC_NAME" ]; then
swww img "${DIR}/${RANDOM_PIC}" $SWWW_PARAMS
# Create symbolic link
ln -sf "${DIR}/${RANDOM_PIC}" "$HOME/.config/hypr/.current_wallpaper"
notify-send "Wallpaper Changed" -i "${DIR}/${RANDOM_PIC}"
exit 0
fi
# Find the index of the selected file
pic_index=-1
for i in "${!PICS[@]}"; do
filename=$(basename "${PICS[$i]}")
if [[ "$filename" == "$choice"* ]]; then
pic_index=$i
break
fi
done
if [[ $pic_index -ne -1 ]]; then
swww img "${DIR}/${PICS[$pic_index]}" $SWWW_PARAMS
# Create symbolic link
ln -sf "${DIR}/${PICS[$pic_index]}" "$HOME/.config/hypr/.current_wallpaper"
notify-send "Wallpaper Changed" -i "${DIR}/${PICS[$pic_index]}"
else
notify-send "Wallpaper Changed" -i "Image not found."
exit 1
fi
}
main
+121
View File
@@ -0,0 +1,121 @@
#!/usr/bin/env python3
# From https://raw.githubusercontent.com/rxyhn/dotfiles/main/home/rxyhn/modules/desktop/waybar/scripts/waybar-wttr.py
## ensure to insert city inside ""
import json
import requests
from datetime import datetime
WEATHER_CODES = {
'113': '',
'116': '󰖕 ',
'119': '',
'122': '',
'143': '',
'176': '',
'179': '',
'182': '',
'185': '',
'200': '⛈️',
'227': '🌨️',
'230': '🌨️',
'248': '☁️',
'260': '☁️',
'263': '🌧️',
'266': '🌧️',
'281': '🌧️',
'284': '🌧️',
'293': '🌧️',
'296': '🌧️',
'299': '🌧️',
'302': '🌧️',
'305': '🌧️',
'308': '🌧️',
'311': '🌧️',
'314': '🌧️',
'317': '🌧️',
'320': '🌨️',
'323': '🌨️',
'326': '🌨️',
'329': '❄️',
'332': '❄️',
'335': '❄️',
'338': '❄️',
'350': '🌧️',
'353': '🌧️',
'356': '🌧️',
'359': '🌧️',
'362': '🌧️',
'365': '🌧️',
'368': '🌧️',
'371': '❄️',
'374': '🌨️',
'377': '🌨️',
'386': '🌨️',
'389': '🌨️',
'392': '🌧️',
'395': '❄️'
}
data = {}
weather = requests.get("https://wttr.in/Kohalpur?format=j1").json()
def format_time(time):
return time.replace("00", "").zfill(2)
def format_temp(temp):
return (hour['FeelsLikeC']+"°").ljust(3)
def format_chances(hour):
chances = {
"chanceoffog": "Fog",
"chanceoffrost": "Frost",
"chanceofovercast": "Overcast",
"chanceofrain": "Rain",
"chanceofsnow": "Snow",
"chanceofsunshine": "Sunshine",
"chanceofthunder": "Thunder",
"chanceofwindy": "Wind"
}
conditions = []
for event in chances.keys():
if int(hour[event]) > 0:
conditions.append(chances[event]+" "+hour[event]+"%")
return ", ".join(conditions)
tempint = int(weather['current_condition'][0]['FeelsLikeC'])
extrachar = ''
if tempint > 0 and tempint < 10:
extrachar = '+'
data['text'] = ' '+WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \
" "+extrachar+weather['current_condition'][0]['FeelsLikeC']+"°"
data['tooltip'] = f"<b>{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°</b>\n"
data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}°\n"
data['tooltip'] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n"
data['tooltip'] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n"
for i, day in enumerate(weather['weather']):
data['tooltip'] += f"\n<b>"
if i == 0:
data['tooltip'] += "Today, "
if i == 1:
data['tooltip'] += "Tomorrow, "
data['tooltip'] += f"{day['date']}</b>\n"
data['tooltip'] += f"⬆️{day['maxtempC']}° ⬇️{day['mintempC']}° "
data['tooltip'] += f"🌅{day['astronomy'][0]['sunrise']} 🌇{day['astronomy'][0]['sunset']}\n"
for hour in day['hourly']:
if i == 0:
if int(format_time(hour['time'])) < datetime.now().hour-2:
continue
data['tooltip'] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n"
print(json.dumps(data))