aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts
diff options
context:
space:
mode:
Diffstat (limited to 'config/hypr/UserScripts')
-rwxr-xr-xconfig/hypr/UserScripts/QuickEdit.sh10
-rwxr-xr-xconfig/hypr/UserScripts/RofiBeats.sh8
-rwxr-xr-xconfig/hypr/UserScripts/Sounds.sh69
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperSelect.sh2
-rwxr-xr-xconfig/hypr/UserScripts/Weather.py206
-rwxr-xr-xconfig/hypr/UserScripts/ZshChangeTheme.sh2
6 files changed, 118 insertions, 179 deletions
diff --git a/config/hypr/UserScripts/QuickEdit.sh b/config/hypr/UserScripts/QuickEdit.sh
index 658d7b03..af5c65d2 100755
--- a/config/hypr/UserScripts/QuickEdit.sh
+++ b/config/hypr/UserScripts/QuickEdit.sh
@@ -12,8 +12,9 @@ menu(){
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"
+ printf "8. view Workspace-Rules\n"
+ printf "9. view Default-Settings\n"
+ printf "10. view Default-Keybinds\n"
}
main() {
@@ -41,9 +42,12 @@ main() {
kitty -e nano "$UserConfigs/UserSettings.conf"
;;
8)
+ kitty -e nano "$UserConfigs/WorkspaceRules.conf"
+ ;;
+ 9)
kitty -e nano "$configs/Settings.conf"
;;
- 9)
+ 10)
kitty -e nano "$configs/Keybinds.conf"
;;
*)
diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh
index 16777f55..e3c79587 100755
--- a/config/hypr/UserScripts/RofiBeats.sh
+++ b/config/hypr/UserScripts/RofiBeats.sh
@@ -9,9 +9,11 @@ iDIR="$HOME/.config/swaync/icons"
# Define menu options as an associative array
declare -A menu_options=(
["Lofi Girl ā˜•ļøšŸŽ¶"]="https://play.streamafrica.net/lofiradio"
- ["96.3 Easy Rock šŸ“»šŸŽ¶"]="https://radio-stations-philippines.com/easy-rock"
- ["Ghibli Music šŸŽ»šŸŽ¶"]="https://youtube.com/playlist?list=PLNi74S754EXbrzw-IzVhpeAaMISNrzfUy&si=rqnXCZU5xoFhxfOl"
+ ["Easy Rock 96.3 FM šŸ“»šŸŽ¶"]="https://radio-stations-philippines.com/easy-rock"
+ ["Wish 107.5 FM šŸ“»šŸŽ¶"]="https://radio-stations-philippines.com/dwnu-1075-wish"
+ ["Wish 107.5 YT Pinoy HipHop šŸŽ»šŸŽ¶"]="https://youtube.com/playlist?list=PLkrzfEDjeYJnmgMYwCKid4XIFqUKBVWEs&si=vahW_noh4UDJ5d37"
["Top Youtube Music 2023 ā˜•ļøšŸŽ¶"]="https://youtube.com/playlist?list=PLDIoUOhQQPlXr63I_vwF9GD8sAKh77dWU&si=y7qNeEVFNgA-XxKy"
+ ["Wish 107.5 YT Wishclusives ā˜•ļøšŸŽ¶"]="https://youtube.com/playlist?list=PLkrzfEDjeYJn5B22H9HOWP3Kxxs-DkPSM&si=d_Ld2OKhGvpH48WO"
["Chillhop ā˜•ļøšŸŽ¶"]="http://stream.zeno.fm/fyn8eh3h5f8uv"
["SmoothChill ā˜•ļøšŸŽ¶"]="https://media-ssl.musicradio.com/SmoothChill"
["Relaxing Music ā˜•ļøšŸŽ¶"]="https://youtube.com/playlist?list=PLMIbmfP_9vb8BCxRoraJpoo4q1yMFg4CE"
@@ -26,7 +28,7 @@ notification() {
# Main function
main() {
- choice=$(printf "%s\n" "${!menu_options[@]}" | rofi -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -i -p "")
+ choice=$(printf "%s\n" "${!menu_options[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -p "")
if [ -z "$choice" ]; then
exit 1
diff --git a/config/hypr/UserScripts/Sounds.sh b/config/hypr/UserScripts/Sounds.sh
deleted file mode 100755
index fb8a1f57..00000000
--- a/config/hypr/UserScripts/Sounds.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-# /* ---- šŸ’« https://github.com/JaKooLit šŸ’« ---- */ ##
-# This script is used to play system sounds.
-
-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.*"
-else
- echo -e "Available sounds: --screenshot, --volume"
- 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
-pw-play "$sound_file" \ No newline at end of file
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh
index 8aa9bdd8..de9c6546 100755
--- a/config/hypr/UserScripts/WallpaperSelect.sh
+++ b/config/hypr/UserScripts/WallpaperSelect.sh
@@ -25,7 +25,7 @@ RANDOM_PIC="${PICS[$((RANDOM % ${#PICS[@]}))]}"
RANDOM_PIC_NAME="${#PICS[@]}. random"
# Rofi command
-rofi_command="rofi -show -dmenu -config ~/.config/rofi/config-wallpaper.rasi"
+rofi_command="rofi -i -show -dmenu -config ~/.config/rofi/config-wallpaper.rasi"
menu() {
for i in "${!PICS[@]}"; do
diff --git a/config/hypr/UserScripts/Weather.py b/config/hypr/UserScripts/Weather.py
index 2b13a977..14c9cfe0 100755
--- a/config/hypr/UserScripts/Weather.py
+++ b/config/hypr/UserScripts/Weather.py
@@ -1,122 +1,124 @@
#!/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 ""
-city = ""
+import subprocess
+from pyquery import PyQuery # install using `pip install pyquery`
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 = {}
+# original code https://gist.github.com/Surendrajat/ff3876fd2166dd86fb71180f4e9342d7
+# weather icons
+weather_icons = {
+ "sunnyDay": "",
+ "clearNight": "ļ›ƒ",
+ "cloudyFoggyDay": "ļƒ",
+ "cloudyFoggyNight": "",
+ "rainyDay": "",
+ "rainyNight": "ļ€",
+ "snowyIcyDay": "",
+ "snowyIcyNight": "",
+ "severe": "ī®",
+ "default": "īŒ‚",
+}
+# get location_id
+# to get your own location_id, go to https://weather.com & search your location.
+# once you choose your location, you can see the location_id in the URL(64 chars long hex string)
+# like this: https://weather.com/en-PH/weather/today/l/bca47d1099e762a012b9a139c36f30a0b1e647f69c0c4ac28b537e7ae9c1c200
+location_id = "bca47d1099e762a012b9a139c36f30a0b1e647f69c0c4ac28b537e7ae9c1c200" # TODO
-weather = requests.get(f"https://wttr.in/{city}?format=j1").json()
+# NOTE to change to deg F, change the URL to your preffered location after weather.com
+# Default is English-Philippines with Busan, South Korea as location_id
+# get html page
+url = "https://weather.com/en-PH/weather/today/l/" + location_id
+html_data = PyQuery(url=url)
+# current temperature
+temp = html_data("span[data-testid='TemperatureValue']").eq(0).text()
+# print(temp)
-def format_time(time):
- return time.replace("00", "").zfill(2)
+# current status phrase
+status = html_data("div[data-testid='wxPhrase']").text()
+status = f"{status[:16]}.." if len(status) > 17 else status
+# print(status)
+# status code
+status_code = html_data("#regionHeader").attr("class").split(" ")[2].split("-")[2]
+# print(status_code)
-def format_temp(temp):
- return (hour['FeelsLikeC']+"°").ljust(3)
+# status icon
+icon = (
+ weather_icons[status_code]
+ if status_code in weather_icons
+ else weather_icons["default"]
+)
+# print(icon)
+# temperature feels like
+temp_feel = html_data(
+ "div[data-testid='FeelsLikeSection'] > span > span[data-testid='TemperatureValue']"
+).text()
+temp_feel_text = f"Feels like {temp_feel}c"
+# print(temp_feel_text)
-def format_chances(hour):
- chances = {
- "chanceoffog": "Fog",
- "chanceoffrost": "Frost",
- "chanceofovercast": "Overcast",
- "chanceofrain": "Rain",
- "chanceofsnow": "Snow",
- "chanceofsunshine": "Sunshine",
- "chanceofthunder": "Thunder",
- "chanceofwindy": "Wind"
- }
+# min-max temperature
+temp_min = (
+ html_data("div[data-testid='wxData'] > span[data-testid='TemperatureValue']")
+ .eq(0)
+ .text()
+)
+temp_max = (
+ html_data("div[data-testid='wxData'] > span[data-testid='TemperatureValue']")
+ .eq(1)
+ .text()
+)
+temp_min_max = f"ļ‹‹ {temp_min}\t\t {temp_max}"
+# print(temp_min_max)
- conditions = []
- for event in chances.keys():
- if int(hour[event]) > 0:
- conditions.append(chances[event]+" "+hour[event]+"%")
- return ", ".join(conditions)
+# wind speed
+wind_speed = html_data("span[data-testid='Wind']").text().split("\n")[1]
+wind_text = f"ē…® {wind_speed}"
+# print(wind_text)
-tempint = int(weather['current_condition'][0]['FeelsLikeC'])
-extrachar = ''
-if tempint > 0 and tempint < 10:
- extrachar = '+'
+# humidity
+humidity = html_data("span[data-testid='PercentageValue']").text()
+humidity_text = f"ī³ {humidity}"
+# print(humidity_text)
+# visibility
+visbility = html_data("span[data-testid='VisibilityValue']").text()
+visbility_text = f" {visbility}"
+# print(visbility_text)
-data['text'] = ' '+WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \
- " "+extrachar+weather['current_condition'][0]['FeelsLikeC']+"°"
+# air quality index
+air_quality_index = html_data("text[data-testid='DonutChartValue']").text()
+# print(air_quality_index)
-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"
+# hourly rain prediction
+prediction = html_data("section[aria-label='Hourly Forecast']")(
+ "div[data-testid='SegmentPrecipPercentage'] > span"
+).text()
+prediction = prediction.replace("Chance of Rain", "")
+prediction = f"\n\n (hourly) {prediction}" if len(prediction) > 0 else prediction
+# print(prediction)
+# tooltip text
+tooltip_text = str.format(
+ "\t\t{}\t\t\n{}\n{}\n{}\n\n{}\n{}\n{}{}",
+ f'<span size="xx-large">{temp}</span>',
+ f"<big> {icon}</big>",
+ f"<b>{status}</b>",
+ f"<small>{temp_feel_text}</small>",
+ f"<b>{temp_min_max}</b>",
+ f"{wind_text}\t{humidity_text}",
+ f"{visbility_text}\tAQI {air_quality_index}",
+ f"<i> {prediction}</i>",
+)
-print(json.dumps(data))
+# print waybar module data
+out_data = {
+ "text": f"{icon} {temp}",
+ "alt": status,
+ "tooltip": tooltip_text,
+ "class": status_code,
+}
+print(json.dumps(out_data))
diff --git a/config/hypr/UserScripts/ZshChangeTheme.sh b/config/hypr/UserScripts/ZshChangeTheme.sh
index 7057ed2e..46d2249e 100755
--- a/config/hypr/UserScripts/ZshChangeTheme.sh
+++ b/config/hypr/UserScripts/ZshChangeTheme.sh
@@ -5,7 +5,7 @@ file_extension=".zsh-theme"
themes_array=($(find "$themes_dir" -type f -name "*$file_extension" -exec basename {} \; | sed -e "s/$file_extension//"))
-rofi_command="rofi -dmenu -config ~/.config/rofi/config-zsh-theme.rasi"
+rofi_command="rofi -i -dmenu -config ~/.config/rofi/config-zsh-theme.rasi"
menu() {
for theme in "${themes_array[@]}"; do
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage