From d7ff1c1dea16619a38f35536a5c00685d848abce Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 10 May 2024 02:03:31 +0900 Subject: Initial Push - Moving to Wallust from Pywal --- config/hypr/UserConfigs/Startup_Apps.conf | 6 ++-- config/hypr/UserConfigs/UserSettings.conf | 9 +++--- config/hypr/UserConfigs/WindowRules.conf | 1 + config/hypr/UserScripts/WallpaperAutoChange.sh | 4 +-- config/hypr/UserScripts/WallpaperRandom.sh | 2 +- config/hypr/UserScripts/WallpaperSelect.sh | 2 +- config/hypr/UserScripts/Weather.py | 6 ++-- config/hypr/hyprlock.conf | 3 +- config/hypr/initial-boot.sh | 11 +++----- config/hypr/scripts/DarkLight.sh | 31 +++++++++++++++++---- config/hypr/scripts/GameMode.sh | 2 +- config/hypr/scripts/PywalSwww.sh | 38 -------------------------- config/hypr/scripts/Refresh.sh | 4 +-- config/hypr/scripts/RefreshNoWaybar.sh | 8 ++---- config/hypr/scripts/WallustSwww.sh | 37 +++++++++++++++++++++++++ config/hypr/wallust/wallust-hyprland.conf | 18 ++++++++++++ 16 files changed, 107 insertions(+), 75 deletions(-) delete mode 100755 config/hypr/scripts/PywalSwww.sh create mode 100755 config/hypr/scripts/WallustSwww.sh create mode 100644 config/hypr/wallust/wallust-hyprland.conf (limited to 'config/hypr') diff --git a/config/hypr/UserConfigs/Startup_Apps.conf b/config/hypr/UserConfigs/Startup_Apps.conf index 2f529d61..50be5e14 100644 --- a/config/hypr/UserConfigs/Startup_Apps.conf +++ b/config/hypr/UserConfigs/Startup_Apps.conf @@ -10,7 +10,7 @@ $SwwwRandom = $UserScripts/WallpaperAutoChange.sh # wallpaper stuff / More wallpaper options below exec-once = swww query || swww-daemon --format xrgb -exec-once = $SwwwRandom $wallDIR # random wallpaper switcher every 30 minutes +#exec-once = $SwwwRandom $wallDIR # random wallpaper switcher every 30 minutes # Startup exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP @@ -24,8 +24,8 @@ exec-once = waybar & exec-once = nm-applet --indicator & exec-once = swaync & exec-once = ags & -#exec-once = blueman-applet & -#exec-once = rog-control-center & +exec-once = blueman-applet & +exec-once = rog-control-center & #clipboard manager exec-once = wl-paste --type text --watch cliphist store diff --git a/config/hypr/UserConfigs/UserSettings.conf b/config/hypr/UserConfigs/UserSettings.conf index da8ec4ed..b3193e49 100644 --- a/config/hypr/UserConfigs/UserSettings.conf +++ b/config/hypr/UserConfigs/UserSettings.conf @@ -4,8 +4,9 @@ # refer to Hyprland wiki for more info https://wiki.hyprland.org/Configuring/Variables -# Sourcing colors generated by pywal -source = $HOME/.cache/wal/colors-hyprland +# Sourcing colors generated by wallust +source = $HOME/.config/hypr/wallust/wallust-hyprland.conf + # blurls = waybar # blurls = rofi @@ -29,7 +30,7 @@ general { border_size = 2 resize_on_border = true - col.active_border = $color0 $color2 $color4 $color6 $color8 90deg + col.active_border = $color0 $color2 $color9 $color12 $color15 90deg col.inactive_border = $backgroundCol layout = master @@ -57,7 +58,7 @@ decoration { drop_shadow=true shadow_range=6 shadow_render_power = 1 - col.shadow = $color2 + col.shadow = $color12 col.shadow_inactive = 0x50000000 blur { diff --git a/config/hypr/UserConfigs/WindowRules.conf b/config/hypr/UserConfigs/WindowRules.conf index bdbd551d..c07094bf 100644 --- a/config/hypr/UserConfigs/WindowRules.conf +++ b/config/hypr/UserConfigs/WindowRules.conf @@ -20,6 +20,7 @@ windowrule = float, ^(file-roller|org.gnome.FileRoller)$ # archive manager #windowrule = workspace 6 silent,^(gamescope)$ windowrule = center,^(pavucontrol) +windowrule = float, org.gnome.SystemMonitor # windowrule v2 move to workspace windowrulev2 = workspace 1, class:^([Tt]hunderbird)$ diff --git a/config/hypr/UserScripts/WallpaperAutoChange.sh b/config/hypr/UserScripts/WallpaperAutoChange.sh index 9e0e1cbe..f54620bb 100755 --- a/config/hypr/UserScripts/WallpaperAutoChange.sh +++ b/config/hypr/UserScripts/WallpaperAutoChange.sh @@ -7,7 +7,7 @@ # # NOTE: this script uses bash (not POSIX shell) for the RANDOM variable -pywal_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh +wallust_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') @@ -32,7 +32,7 @@ while true; do | sort -n | cut -d':' -f2- \ | while read -r img; do swww img -o $focused_monitor "$img" - $pywal_refresh + $wallust_refresh sleep $INTERVAL done diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index 52fc819d..adaec3b5 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -20,7 +20,7 @@ SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration swww query || swww-daemon --format xrgb && swww img ${RANDOMPICS} $SWWW_PARAMS -${scriptsDir}/PywalSwww.sh +${scriptsDir}/WallustSwww.sh sleep 1 ${scriptsDir}/Refresh.sh diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index 2616014d..9a087c7d 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -85,6 +85,6 @@ fi main sleep 0.5 -${SCRIPTSDIR}/PywalSwww.sh +${SCRIPTSDIR}/WallustSwww.sh sleep 0.2 ${SCRIPTSDIR}/Refresh.sh diff --git a/config/hypr/UserScripts/Weather.py b/config/hypr/UserScripts/Weather.py index 046dbcd3..7b23d28d 100755 --- a/config/hypr/UserScripts/Weather.py +++ b/config/hypr/UserScripts/Weather.py @@ -76,7 +76,7 @@ temp_min_max = f" {temp_min}\t\t {temp_max}" # wind speed wind_speed = html_data("span[data-testid='Wind']").text().split("\n")[1] -wind_text = f"煮 {wind_speed}" +wind_text = f" {wind_speed}" # print(wind_text) # humidity @@ -86,7 +86,7 @@ humidity_text = f" {humidity}" # visibility visbility = html_data("span[data-testid='VisibilityValue']").text() -visbility_text = f" {visbility}" +visbility_text = f" {visbility}" # print(visbility_text) # air quality index @@ -127,7 +127,7 @@ simple_weather =f"{icon} {status}\n" + \ f" {temp} ({temp_feel_text})\n" + \ f"{wind_text}\n" + \ f"{humidity_text}\n" + \ - f"{visbility_text} AQI {air_quality_index}\n" + f"{visbility_text} AQI{air_quality_index}\n" try: with open(os.path.expanduser("~/.cache/.weather_cache"), "w") as file: diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf index 38c927a0..a4a8c19c 100644 --- a/config/hypr/hyprlock.conf +++ b/config/hypr/hyprlock.conf @@ -2,7 +2,8 @@ # Hyprlock # Original config submitted by https://github.com/SherLock707 -source = $HOME/.cache/wal/colors-hyprland +# Sourcing colors generated by wallust +source = $HOME/.config/hypr/wallust/wallust-hyprland.conf general { grace = 1 diff --git a/config/hypr/initial-boot.sh b/config/hypr/initial-boot.sh index f5fe66d7..34f0af90 100755 --- a/config/hypr/initial-boot.sh +++ b/config/hypr/initial-boot.sh @@ -8,7 +8,7 @@ # Variables scriptsDir=$HOME/.config/hypr/scripts wallpaper=$HOME/Pictures/wallpapers/Lofi-Urban-Nightscape.png -waybar_style="$HOME/.config/waybar/style/[Pywal] Chroma Tally.css" +waybar_style="$HOME/.config/waybar/style/[Wallust] Chroma Tally.css" kvantum_theme="Catppuccin-Mocha" swww="swww img" @@ -17,16 +17,13 @@ effect="--transition-bezier .43,1.19,1,.4 --transition-fps 30 --transition-type # Check if a marker file exists. if [ ! -f ~/.config/hypr/.initial_startup_done ]; then - # Initialize pywal and wallpaper + # Initialize wallust and wallpaper if [ -f "$wallpaper" ]; then - wal -i $wallpaper -s -t > /dev/null + wallust run -s $wallpaper > /dev/null swww query || swww-daemon && $swww $wallpaper $effect - "$scriptsDir/PywalSwww.sh" > /dev/null 2>&1 & + "$scriptsDir/WallustSwww.sh" > /dev/null 2>&1 & fi - # Initial symlink for Pywal Dark and Light for Rofi Themes - ln -sf "$HOME/.cache/wal/colors-rofi-dark.rasi" "$HOME/.config/rofi/pywal-color/pywal-theme.rasi" > /dev/null 2>&1 & - # initiate GTK dark mode and apply icon and cursor theme gsettings set org.gnome.desktop.interface color-scheme prefer-dark > /dev/null 2>&1 & gsettings set org.gnome.desktop.interface gtk-theme Tokyonight-Dark-BL-LB > /dev/null 2>&1 & diff --git a/config/hypr/scripts/DarkLight.sh b/config/hypr/scripts/DarkLight.sh index f9d2a933..60f75d42 100755 --- a/config/hypr/scripts/DarkLight.sh +++ b/config/hypr/scripts/DarkLight.sh @@ -12,9 +12,13 @@ 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" -dark_rofi_pywal="$HOME/.cache/wal/colors-rofi-dark.rasi" -light_rofi_pywal="$HOME/.cache/wal/colors-rofi-light.rasi" +wallust_rofi="$HOME/.config/wallust/templates/colors-rofi.rasi" +wallust_config="$HOME/.config/wallust/wallust.toml" +pallete_dark="dark16" +pallete_light="light16" + +# kill swaybg if running pkill swaybg # Initialize swww if needed @@ -45,6 +49,19 @@ notify_user() { notify-send -u low -i "$notif" "Switching to $1 mode" } +# Print a message indicating the mode change +echo "Changing palette mode to $next_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 + + +# Print a message indicating the completion of the operation +echo "Palette mode updated." # Function to set Waybar style set_waybar_style() { theme="$1" @@ -112,13 +129,15 @@ kvantummanager --set "$kvantum_theme" 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" -# Set Rofi Themes + +# set the rofi color for background if [ "$next_mode" = "Dark" ]; then - ln -sf "$dark_rofi_pywal" "$HOME/.config/rofi/pywal-color/pywal-theme.rasi" + sed -i '24s/.*/background: rgba(0,0,0,0.7);/' $wallust_rofi else - ln -sf "$light_rofi_pywal" "$HOME/.config/rofi/pywal-color/pywal-theme.rasi" + sed -i '24s/.*/background: rgba(255,255,255,0.9);/' $wallust_rofi fi + # GTK themes and icons switching set_custom_gtk_theme() { mode=$1 @@ -201,7 +220,7 @@ update_theme_mode sleep 0.5 # Run remaining scripts -${SCRIPTSDIR}/PywalSwww.sh +${SCRIPTSDIR}/WallustSwww.sh sleep 1 ${SCRIPTSDIR}/Refresh.sh diff --git a/config/hypr/scripts/GameMode.sh b/config/hypr/scripts/GameMode.sh index 37afe066..5ad268ca 100755 --- a/config/hypr/scripts/GameMode.sh +++ b/config/hypr/scripts/GameMode.sh @@ -22,7 +22,7 @@ if [ "$HYPRGAMEMODE" = 1 ] ; then else swww-daemon && swww img "$HOME/.config/rofi/.current_wallpaper" & sleep 0.1 - ${SCRIPTSDIR}/PywalSwww.sh + ${SCRIPTSDIR}/WallustSwww.sh sleep 0.5 ${SCRIPTSDIR}/Refresh.sh notify-send -e -u normal -i "$notif" "gamemode disabled. All animations normal" diff --git a/config/hypr/scripts/PywalSwww.sh b/config/hypr/scripts/PywalSwww.sh deleted file mode 100755 index 9f7b15b5..00000000 --- a/config/hypr/scripts/PywalSwww.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# Pywal Colors for current wallpaper - -# Define the path to the swww cache directory -cache_dir="$HOME/.cache/swww/" - -# Get a list of monitor outputs -monitor_outputs=($(ls "$cache_dir")) - -# Initialize a flag to determine if the ln command was executed -ln_success=false - -# Get current focused monitor -current_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') -echo $current_monitor -# Construct the full path to the cache file -cache_file="$cache_dir$current_monitor" -echo $cache_file -# Check if the cache file exists for the current monitor output -if [ -f "$cache_file" ]; then - # Get the wallpaper path from the cache file - wallpaper_path=$(cat "$cache_file") - echo $wallpaper_path - # Copy the wallpaper to the location Rofi can access - if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then - ln_success=true # Set the flag to true upon successful execution - fi -fi - -# Check the flag before executing further commands -if [ "$ln_success" = true ]; then - # execute pywal - # wal -i "$wallpaper_path" - echo 'about to execute wal' - # execute pywal skipping tty and terminal changes - wal -i "$wallpaper_path" -s -t -n -e & -fi diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index aeae77d1..42e70896 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -1,6 +1,6 @@ #!/bin/bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# Scripts for refreshing ags waybar, rofi, swaync, pywal colors +# Scripts for refreshing ags waybar, rofi, swaync, wallust SCRIPTSDIR=$HOME/.config/hypr/scripts UserScripts=$HOME/.config/hypr/UserScripts @@ -42,7 +42,5 @@ if file_exists "${UserScripts}/RainbowBorders.sh"; then ${UserScripts}/RainbowBorders.sh & fi -# for cava-pywal (note, need to manually restart cava once wallpaper changes) -ln -sf "$HOME/.cache/wal/cava-colors" "$HOME/.config/cava/config" || true exit 0 \ No newline at end of file diff --git a/config/hypr/scripts/RefreshNoWaybar.sh b/config/hypr/scripts/RefreshNoWaybar.sh index 42d67adc..70a4aeb3 100755 --- a/config/hypr/scripts/RefreshNoWaybar.sh +++ b/config/hypr/scripts/RefreshNoWaybar.sh @@ -3,7 +3,7 @@ # Modified version of Refresh but no waybar refresh # Used by automatic wallpaper change -# Modified inorder to refresh rofi background, Pywal, SwayNC +# Modified inorder to refresh rofi background, Wallust, SwayNC SCRIPTSDIR=$HOME/.config/hypr/scripts UserScripts=$HOME/.config/hypr/UserScripts @@ -28,8 +28,8 @@ done # quit ags ags -q -# Pywal refresh -${SCRIPTSDIR}/PywalSwww.sh & +# Wallust refresh +${SCRIPTSDIR}/WallustSwww.sh & # Relaunching rainbow borders if the script exists sleep 1 @@ -37,7 +37,5 @@ if file_exists "${UserScripts}/RainbowBorders.sh"; then ${UserScripts}/RainbowBorders.sh & fi -# for cava-pywal (note, need to manually restart cava once wallpaper changes) -ln -sf "$HOME/.cache/wal/cava-colors" "$HOME/.config/cava/config" || true exit 0 \ No newline at end of file diff --git a/config/hypr/scripts/WallustSwww.sh b/config/hypr/scripts/WallustSwww.sh new file mode 100755 index 00000000..2a711028 --- /dev/null +++ b/config/hypr/scripts/WallustSwww.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Wallust Colors for current wallpaper + +# Define the path to the swww cache directory +cache_dir="$HOME/.cache/swww/" + +# Get a list of monitor outputs +monitor_outputs=($(ls "$cache_dir")) + +# Initialize a flag to determine if the ln command was executed +ln_success=false + +# Get current focused monitor +current_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') +echo $current_monitor +# Construct the full path to the cache file +cache_file="$cache_dir$current_monitor" +echo $cache_file +# Check if the cache file exists for the current monitor output +if [ -f "$cache_file" ]; then + # Get the wallpaper path from the cache file + wallpaper_path=$(cat "$cache_file") + echo $wallpaper_path + # Copy the wallpaper to the location Rofi can access + if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then + ln_success=true # Set the flag to true upon successful execution + fi +fi + +# Check the flag before executing further commands +if [ "$ln_success" = true ]; then + # execute wallust + echo 'about to execute wallust' + # execute wallust skipping tty and terminal changes + wallust run "$wallpaper_path" -s & +fi diff --git a/config/hypr/wallust/wallust-hyprland.conf b/config/hypr/wallust/wallust-hyprland.conf new file mode 100644 index 00000000..00488854 --- /dev/null +++ b/config/hypr/wallust/wallust-hyprland.conf @@ -0,0 +1,18 @@ +$background = rgb(010102) +$foreground = rgb(E2FECE) +$color0 = rgb(010102) +$color1 = rgb(595213) +$color2 = rgb(9E2517) +$color3 = rgb(0E714C) +$color4 = rgb(08AC75) +$color5 = rgb(08BCB1) +$color6 = rgb(81BC57) +$color7 = rgb(CDF5B1) +$color8 = rgb(8FAB7C) +$color9 = rgb(776D19) +$color10 = rgb(D3311F) +$color11 = rgb(129766) +$color12 = rgb(0AE59C) +$color13 = rgb(0AFAEC) +$color14 = rgb(ACFB74) +$color15 = rgb(CDF5B1) -- cgit v1.2.3 From 4ff5b6fb30c83fe1e1b5652a759105858756f4b1 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 10 May 2024 02:39:55 +0900 Subject: adjusted hyprlock --- config/hypr/hyprlock.conf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'config/hypr') diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf index a4a8c19c..f41d646a 100644 --- a/config/hypr/hyprlock.conf +++ b/config/hypr/hyprlock.conf @@ -34,7 +34,7 @@ input-field { dots_center = true outer_color = $color1 inner_color = $color0 - font_color = $color7 + font_color = $color12 fade_on_empty = true placeholder_text = Password... # Text rendered in the input box when it's empty. hide_input = false @@ -48,7 +48,7 @@ input-field { label { monitor = text = cmd[update:18000000] echo " "$(date +'%A, %-d %B %Y')" " - color = $color1 + color = $color9 font_size = 34 font_family = JetBrains Mono Nerd Font 10 @@ -61,7 +61,7 @@ label { label { monitor = text = cmd[update:18000000] echo " "$(date +'Week %U')" " - color = $color7 + color = $color5 font_size = 24 font_family = JetBrains Mono Nerd Font 10 position = 0, -250 @@ -74,7 +74,7 @@ label { monitor = # text = cmd[update:1000] echo " $(date +"%I:%M:%S %p") " # AM/PM text = cmd[update:1000] echo " $(date +"%H:%M:%S") " # 24H - color = $color7 + color = $color15 font_size = 94 font_family = JetBrains Mono Nerd Font 10 @@ -87,7 +87,7 @@ text = cmd[update:1000] echo " $(date +"%H:%M:%S") " # 24H label { monitor = text =  $USER - color = $color7 + color = $color9 font_size = 18 font_family = Inter Display Medium @@ -112,7 +112,7 @@ label { label { monitor = text = cmd[update:3600000] [ -f ~/.cache/.weather_cache ] && cat ~/.cache/.weather_cache - color = $color10 + color = $color12 font_size = 24 font_family = JetBrains Mono Nerd Font 10 position = 50, 0 @@ -127,7 +127,7 @@ image { size = 230 rounding = -1 border_size = 4 - border_color = $color2 + border_color = $color1 rotate = 0 reload_time = -1 position = 0, 300 -- cgit v1.2.3 From b18d3ed7a1403cca43e21595e8a5a2071fc49994 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 10 May 2024 10:53:35 +0900 Subject: updated startup and window Rules --- config/hypr/UserConfigs/Startup_Apps.conf | 6 +++--- config/hypr/UserConfigs/WindowRules.conf | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'config/hypr') diff --git a/config/hypr/UserConfigs/Startup_Apps.conf b/config/hypr/UserConfigs/Startup_Apps.conf index 50be5e14..2f529d61 100644 --- a/config/hypr/UserConfigs/Startup_Apps.conf +++ b/config/hypr/UserConfigs/Startup_Apps.conf @@ -10,7 +10,7 @@ $SwwwRandom = $UserScripts/WallpaperAutoChange.sh # wallpaper stuff / More wallpaper options below exec-once = swww query || swww-daemon --format xrgb -#exec-once = $SwwwRandom $wallDIR # random wallpaper switcher every 30 minutes +exec-once = $SwwwRandom $wallDIR # random wallpaper switcher every 30 minutes # Startup exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP @@ -24,8 +24,8 @@ exec-once = waybar & exec-once = nm-applet --indicator & exec-once = swaync & exec-once = ags & -exec-once = blueman-applet & -exec-once = rog-control-center & +#exec-once = blueman-applet & +#exec-once = rog-control-center & #clipboard manager exec-once = wl-paste --type text --watch cliphist store diff --git a/config/hypr/UserConfigs/WindowRules.conf b/config/hypr/UserConfigs/WindowRules.conf index c07094bf..bdbd551d 100644 --- a/config/hypr/UserConfigs/WindowRules.conf +++ b/config/hypr/UserConfigs/WindowRules.conf @@ -20,7 +20,6 @@ windowrule = float, ^(file-roller|org.gnome.FileRoller)$ # archive manager #windowrule = workspace 6 silent,^(gamescope)$ windowrule = center,^(pavucontrol) -windowrule = float, org.gnome.SystemMonitor # windowrule v2 move to workspace windowrulev2 = workspace 1, class:^([Tt]hunderbird)$ -- cgit v1.2.3 From 4b44f8eceb31ed13453a5ba5f0a735d52d92e065 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Fri, 10 May 2024 12:15:33 +0530 Subject: lockscreen.sh: immediately lock screen if invoked, this removes the lag --- config/hypr/scripts/LockScreen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/hypr') diff --git a/config/hypr/scripts/LockScreen.sh b/config/hypr/scripts/LockScreen.sh index 56d496a5..ce2320ab 100755 --- a/config/hypr/scripts/LockScreen.sh +++ b/config/hypr/scripts/LockScreen.sh @@ -2,4 +2,4 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # For Hyprlock -hyprlock -q \ No newline at end of file +hyprlock -q --immediate \ No newline at end of file -- cgit v1.2.3 From 4cd64ff0b907f8d8d6503bcb7c858ca25494d1cb Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Fri, 10 May 2024 12:16:30 +0530 Subject: hyprlock: use UptimeNixOS script to get the output if uptime -p not available --- config/hypr/hyprlock.conf | 3 ++- config/hypr/scripts/UptimeNixOS.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 config/hypr/scripts/UptimeNixOS.sh (limited to 'config/hypr') diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf index f41d646a..eec6d31f 100644 --- a/config/hypr/hyprlock.conf +++ b/config/hypr/hyprlock.conf @@ -4,6 +4,7 @@ # Sourcing colors generated by wallust source = $HOME/.config/hypr/wallust/wallust-hyprland.conf +$Scripts = $HOME/.config/hypr/scripts general { grace = 1 @@ -99,7 +100,7 @@ label { # uptime label { monitor = - text = cmd[update:60000] echo " "$(uptime -p)" " + text = cmd[update:60000] echo " "$(uptime -p || $Scripts/UptimeNixOS.sh)" " color = $color12 font_size = 24 font_family = JetBrains Mono Nerd Font 10 diff --git a/config/hypr/scripts/UptimeNixOS.sh b/config/hypr/scripts/UptimeNixOS.sh new file mode 100644 index 00000000..654ae2c8 --- /dev/null +++ b/config/hypr/scripts/UptimeNixOS.sh @@ -0,0 +1,33 @@ +#!/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" -- cgit v1.2.3 From 0b5e264fd9d2bc17c2f2d84cdf785e0c32ca4382 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 10 May 2024 20:16:11 +0900 Subject: added 1 sec sleep function to execute properly the initial-boot.sh --- config/hypr/initial-boot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/hypr') diff --git a/config/hypr/initial-boot.sh b/config/hypr/initial-boot.sh index 34f0af90..95b9e491 100755 --- a/config/hypr/initial-boot.sh +++ b/config/hypr/initial-boot.sh @@ -16,7 +16,7 @@ effect="--transition-bezier .43,1.19,1,.4 --transition-fps 30 --transition-type # Check if a marker file exists. if [ ! -f ~/.config/hypr/.initial_startup_done ]; then - + sleep 1 # Initialize wallust and wallpaper if [ -f "$wallpaper" ]; then wallust run -s $wallpaper > /dev/null -- cgit v1.2.3 From 56810d5996c38f12742c4c147f61efe056ac12bb Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Fri, 10 May 2024 20:30:39 +0900 Subject: weather.py alignment adjustment --- config/hypr/UserScripts/Weather.py | 135 +++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) (limited to 'config/hypr') diff --git a/config/hypr/UserScripts/Weather.py b/config/hypr/UserScripts/Weather.py index 7b23d28d..9f9c1440 100755 --- a/config/hypr/UserScripts/Weather.py +++ b/config/hypr/UserScripts/Weather.py @@ -53,6 +53,66 @@ icon = ( ) # 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)#!/usr/bin/env python3 + +import subprocess +from pyquery import PyQuery # install using `pip install pyquery` +import json +import os + +# 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 + +# 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) + +# 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) + +# 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']" @@ -60,6 +120,81 @@ temp_feel = html_data( temp_feel_text = f"Feels like {temp_feel}c" # print(temp_feel_text) +# 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) + +# wind speed +wind_speed = html_data("span[data-testid='Wind']").text().split("\n")[1] +wind_text = f" {wind_speed}" +# print(wind_text) + +# 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) + +# air quality index +air_quality_index = html_data("text[data-testid='DonutChartValue']").text() +# print(air_quality_index) + +# 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'{temp}', + f" {icon}", + f"{status}", + f"{temp_feel_text}", + f"{temp_min_max}", + f"{wind_text}\t{humidity_text}", + f"{visbility_text}\tAQI {air_quality_index}", + f" {prediction}", +) + +# print waybar module data +out_data = { + "text": f"{icon} {temp}", + "alt": status, + "tooltip": tooltip_text, + "class": status_code, +} +print(json.dumps(out_data)) + +simple_weather =f"{icon} {status}\n" + \ + f" {temp} ({temp_feel_text})\n" + \ + f"{wind_text}\n" + \ + f"{humidity_text}\n" + \ + f"{visbility_text} AQI{air_quality_index}\n" + +try: + with open(os.path.expanduser("~/.cache/.weather_cache"), "w") as file: + file.write(simple_weather) +except: + pass + # min-max temperature temp_min = ( html_data("div[data-testid='wxData'] > span[data-testid='TemperatureValue']") -- cgit v1.2.3 From 4db173373a8c2b08468472928eb90520cb36f9be Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 12 May 2024 02:39:24 +0900 Subject: small tweak on the dark light switcher --- config/hypr/scripts/DarkLight.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'config/hypr') diff --git a/config/hypr/scripts/DarkLight.sh b/config/hypr/scripts/DarkLight.sh index 60f75d42..e6f212f6 100755 --- a/config/hypr/scripts/DarkLight.sh +++ b/config/hypr/scripts/DarkLight.sh @@ -49,9 +49,6 @@ notify_user() { notify-send -u low -i "$notif" "Switching to $1 mode" } -# Print a message indicating the mode change -echo "Changing palette mode to $next_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" @@ -59,9 +56,6 @@ else sed -i 's/^palette = .*/palette = "'"$pallete_light"'"/' "$wallust_config" fi - -# Print a message indicating the completion of the operation -echo "Palette mode updated." # Function to set Waybar style set_waybar_style() { theme="$1" @@ -125,9 +119,9 @@ else qt6ct_color_scheme="$HOME/.config/qt6ct/colors/Catppuccin-Latte.conf" fi -kvantummanager --set "$kvantum_theme" 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 @@ -224,6 +218,7 @@ ${SCRIPTSDIR}/WallustSwww.sh sleep 1 ${SCRIPTSDIR}/Refresh.sh +sleep 0.3 # Display notifications for theme and icon changes notify-send -u normal -i "$notif" "Themes in $next_mode Mode" -- cgit v1.2.3 From 5a0673f70387de74baa1a9a67b6061dafa261fca Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 12 May 2024 14:16:40 +0900 Subject: adding fallback to sound.sh --- config/hypr/scripts/Sounds.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config/hypr') diff --git a/config/hypr/scripts/Sounds.sh b/config/hypr/scripts/Sounds.sh index a749114c..e19feea4 100755 --- a/config/hypr/scripts/Sounds.sh +++ b/config/hypr/scripts/Sounds.sh @@ -67,4 +67,6 @@ if ! test -f "$sound_file"; then fi fi fi -pw-play "$sound_file" \ No newline at end of file + +# pipewire priority, fallback pulseaudio +pw-play "$sound_file" || pa-play "$sound_file" \ No newline at end of file -- cgit v1.2.3 From 5b85fd7415ad55b3323cd1caacf1ae86c4b3a6ea Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 12 May 2024 02:17:58 -0400 Subject: Weather.py clean up. Double codes --- config/hypr/UserScripts/Weather.py | 147 ++----------------------------------- 1 file changed, 6 insertions(+), 141 deletions(-) (limited to 'config/hypr') diff --git a/config/hypr/UserScripts/Weather.py b/config/hypr/UserScripts/Weather.py index 9f9c1440..5cd11a66 100755 --- a/config/hypr/UserScripts/Weather.py +++ b/config/hypr/UserScripts/Weather.py @@ -53,66 +53,6 @@ icon = ( ) # 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)#!/usr/bin/env python3 - -import subprocess -from pyquery import PyQuery # install using `pip install pyquery` -import json -import os - -# 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 - -# 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) - -# 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) - -# 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']" @@ -120,81 +60,6 @@ temp_feel = html_data( temp_feel_text = f"Feels like {temp_feel}c" # print(temp_feel_text) -# 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) - -# wind speed -wind_speed = html_data("span[data-testid='Wind']").text().split("\n")[1] -wind_text = f" {wind_speed}" -# print(wind_text) - -# 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) - -# air quality index -air_quality_index = html_data("text[data-testid='DonutChartValue']").text() -# print(air_quality_index) - -# 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'{temp}', - f" {icon}", - f"{status}", - f"{temp_feel_text}", - f"{temp_min_max}", - f"{wind_text}\t{humidity_text}", - f"{visbility_text}\tAQI {air_quality_index}", - f" {prediction}", -) - -# print waybar module data -out_data = { - "text": f"{icon} {temp}", - "alt": status, - "tooltip": tooltip_text, - "class": status_code, -} -print(json.dumps(out_data)) - -simple_weather =f"{icon} {status}\n" + \ - f" {temp} ({temp_feel_text})\n" + \ - f"{wind_text}\n" + \ - f"{humidity_text}\n" + \ - f"{visbility_text} AQI{air_quality_index}\n" - -try: - with open(os.path.expanduser("~/.cache/.weather_cache"), "w") as file: - file.write(simple_weather) -except: - pass - # min-max temperature temp_min = ( html_data("div[data-testid='wxData'] > span[data-testid='TemperatureValue']") @@ -221,7 +86,7 @@ humidity_text = f" {humidity}" # visibility visbility = html_data("span[data-testid='VisibilityValue']").text() -visbility_text = f" {visbility}" +visbility_text = f" {visbility}" # print(visbility_text) # air quality index @@ -258,14 +123,14 @@ out_data = { } print(json.dumps(out_data)) -simple_weather =f"{icon} {status}\n" + \ +simple_weather =f"{icon} {status}\n" + \ f" {temp} ({temp_feel_text})\n" + \ - f"{wind_text}\n" + \ - f"{humidity_text}\n" + \ - f"{visbility_text} AQI{air_quality_index}\n" + f"{wind_text} \n" + \ + f"{humidity_text} \n" + \ + f"{visbility_text} AQI{air_quality_index}\n" try: with open(os.path.expanduser("~/.cache/.weather_cache"), "w") as file: file.write(simple_weather) except: - pass \ No newline at end of file + pass -- cgit v1.2.3 From c25741678cfa136d5fb7e9b4a43020bdcab0937d Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 12 May 2024 18:27:38 +0900 Subject: updated keyhints --- config/hypr/scripts/KeyHints.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config/hypr') diff --git a/config/hypr/scripts/KeyHints.sh b/config/hypr/scripts/KeyHints.sh index d45f2e7e..f7450217 100755 --- a/config/hypr/scripts/KeyHints.sh +++ b/config/hypr/scripts/KeyHints.sh @@ -40,7 +40,7 @@ yad --width=$dynamic_width --height=$dynamic_height \ "ESC" "close this app" "" "=" "SUPER KEY (Windows Key)" "(SUPER KEY)" \ " enter" "Terminal" "(kitty)" \ " SHIFT enter" "DropDown Terminal" "(kitty-pyprland)" \ -" D" "App Launcher" "(rofi)" \ +" D" "App Launcher" "(rofi-wayland)" \ " T" "Open File Manager" "(Thunar)" \ " S" "Google Search" "(rofi)" \ " Q" "close active window" "(not kill)" \ @@ -59,7 +59,7 @@ yad --width=$dynamic_width --height=$dynamic_height \ " Shift S" "screenshot region" "(swappy)" \ "ALT Print" "Screenshot active window" "active window only" \ "CTRL ALT P" "power-menu" "(wlogout)" \ -"CTRL ALT L" "screen lock" "(swaylock)" \ +"CTRL ALT L" "screen lock" "(hyprlock)" \ "CTRL ALT Del" "Hyprland Exit" "(SAVE YOUR WORK!!!)" \ " F" "Fullscreen" "Toggles to full screen" \ " ALT L" "Toggle Dwindle | Master Layout" "Hyprland Layout" \ -- cgit v1.2.3 From 27285b10c8b9cd90a945ef7167d4c6d93daf5e3e Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sun, 12 May 2024 19:38:06 +0900 Subject: wallpaperRamdom will only change focused monitor --- config/hypr/UserScripts/WallpaperRandom.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config/hypr') diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index adaec3b5..050c10c3 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -5,6 +5,8 @@ wallDIR="$HOME/Pictures/wallpapers" scriptsDir="$HOME/.config/hypr/scripts" +focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') + PICS=($(find ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} @@ -17,7 +19,7 @@ BEZIER=".43,1.19,1,.4" SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" -swww query || swww-daemon --format xrgb && swww img ${RANDOMPICS} $SWWW_PARAMS +swww query || swww-daemon --format xrgb && swww img -o $focused_monitor ${RANDOMPICS} $SWWW_PARAMS ${scriptsDir}/WallustSwww.sh -- cgit v1.2.3 From ca3a8941e7b647ed40b60c247869a4de9cae26f5 Mon Sep 17 00:00:00 2001 From: Linxford Kwabena Date: Sun, 12 May 2024 11:06:50 +0000 Subject: Update RofiBeats.sh || Add support for local and online music playback This commit introduces enhancements to the music playback script. It now allows users to choose between local and online music options. Under each category, the available songs are displayed, and the selected song is played using `mpv`. Additionally, shuffle functionality has been added to provide a randomized listening experience. The code has been refactored to include separate functions for playing local and online music, improving code organization and readability. These changes aim to provide users with a more versatile and enjoyable music playback experience. --- config/hypr/UserScripts/RofiBeats.sh | 64 ++++++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 14 deletions(-) (limited to 'config/hypr') diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index e3c79587..5620f666 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -3,11 +3,18 @@ # Directory for icons iDIR="$HOME/.config/swaync/icons" -# Note: You can add more options below with the following format: -# ["TITLE"]="link" +# Define menu options as associative arrays for local and online music +declare -A local_music -# Define menu options as an associative array -declare -A menu_options=( +# Populate the menu_options array with music files from the Music folder +for file in ~/Music/*.mp3; do + filename=$(basename "$file") + local_music["$filename"]="$file" +done + + +declare -A online_music=( + ["AfroBeatz 2024 🎧"]="https://www.youtube.com/watch?v=7uB-Eh9XVZQ" ["Lofi Girl ☕️🎶"]="https://play.streamafrica.net/lofiradio" ["Easy Rock 96.3 FM 📻🎶"]="https://radio-stations-philippines.com/easy-rock" ["Wish 107.5 FM 📻🎶"]="https://radio-stations-philippines.com/dwnu-1075-wish" @@ -26,25 +33,54 @@ notification() { notify-send -u normal -i "$iDIR/music.png" "Playing now: $@" } -# Main function -main() { - choice=$(printf "%s\n" "${!menu_options[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -p "") +# Main function for playing local music +play_local_music() { + choice=$(printf "%s\n" "${!local_music[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -p "Local Music") if [ -z "$choice" ]; then exit 1 fi - link="${menu_options[$choice]}" + file="${local_music[$choice]}" notification "$choice" - # Check if the link is a playlist - if [[ $link == *playlist* ]]; then - mpv --shuffle --vid=no "$link" - else - mpv "$link" + # Play the selected local music file using mpv + mpv --shuffle --vid=no "$file" +} + +# Main function for playing online music +play_online_music() { + choice=$(printf "%s\n" "${!online_music[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -p "Online Music") + + if [ -z "$choice" ]; then + exit 1 fi + + link="${online_music[$choice]}" + + notification "$choice" + + # Play the selected online music using mpv + mpv --shuffle --vid=no "$link" } # Check if an online music process is running and send a notification, otherwise run the main function -pkill mpv && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || main +pkill mpv && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || { + + # Prompt the user to choose between local and online music + user_choice=$(printf "Play from Music Folder\nOnline Streaming" | rofi -dmenu -p "Select music source") + + case "$user_choice" in + "Play from Music Folder") + play_local_music + ;; + "Online Streaming") + play_online_music + ;; + *) + echo "Invalid choice" + ;; + esac +} + -- cgit v1.2.3 From f3b3f8ed2b122a84ff1f6cc772e244d318fbf9f6 Mon Sep 17 00:00:00 2001 From: Linxford Kwabena Date: Sun, 12 May 2024 12:38:07 +0000 Subject: Update RofiBeats.sh Added option to list all supported music formats (mp3, ogg, wav, flac, m4a, wma,mp4) for local files. --- config/hypr/UserScripts/RofiBeats.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'config/hypr') diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index 5620f666..010d5f74 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -6,10 +6,12 @@ iDIR="$HOME/.config/swaync/icons" # Define menu options as associative arrays for local and online music declare -A local_music -# Populate the menu_options array with music files from the Music folder -for file in ~/Music/*.mp3; do - filename=$(basename "$file") - local_music["$filename"]="$file" +# Populate the menu_options array with music files from the Music folder with specified extensions +for file in ~/Music/*.{mp3,ogg,wav,flac,m4a,wma,mp4}; do + if [ -f "$file" ]; then + filename=$(basename "$file") + local_music["$filename"]="$file" + fi done @@ -67,7 +69,6 @@ play_online_music() { # Check if an online music process is running and send a notification, otherwise run the main function pkill mpv && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || { - # Prompt the user to choose between local and online music user_choice=$(printf "Play from Music Folder\nOnline Streaming" | rofi -dmenu -p "Select music source") @@ -83,4 +84,3 @@ pkill mpv && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || { ;; esac } - -- cgit v1.2.3 From 4929d1530275f3d492071dd8bb30394e02418dae Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" Date: Sun, 12 May 2024 21:41:09 +0900 Subject: Update RofiBeats.sh adjusted a bit... made another rofi-beats menu --- config/hypr/UserScripts/RofiBeats.sh | 38 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'config/hypr') diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index 010d5f74..c6fbb06d 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -3,18 +3,18 @@ # Directory for icons iDIR="$HOME/.config/swaync/icons" -# Define menu options as associative arrays for local and online music -declare -A local_music +# Directory music folder +mDIR="$HOME/Music/*" -# Populate the menu_options array with music files from the Music folder with specified extensions -for file in ~/Music/*.{mp3,ogg,wav,flac,m4a,wma,mp4}; do - if [ -f "$file" ]; then - filename=$(basename "$file") - local_music["$filename"]="$file" - fi +# Local Music +declare -A local_music +# Populate the menu_options array with music files from the Music folder +for file in $mDIR; do + filename=$(basename "$file") + local_music["$filename"]="$file" done - +# Online Stations declare -A online_music=( ["AfroBeatz 2024 🎧"]="https://www.youtube.com/watch?v=7uB-Eh9XVZQ" ["Lofi Girl ☕️🎶"]="https://play.streamafrica.net/lofiradio" @@ -32,11 +32,12 @@ declare -A online_music=( # Function for displaying notifications notification() { - notify-send -u normal -i "$iDIR/music.png" "Playing now: $@" + notify-send -u normal -i "$iDIR/music.png" "Playing: $@" } # Main function for playing local music play_local_music() { + # Prompt the user to select a song choice=$(printf "%s\n" "${!local_music[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -p "Local Music") if [ -z "$choice" ]; then @@ -46,9 +47,14 @@ play_local_music() { file="${local_music[$choice]}" notification "$choice" - - # Play the selected local music file using mpv - mpv --shuffle --vid=no "$file" + + # Play the selected local music file using mpv and shuffle the rest + mpv --shuffle --vid=no "$file" && \ + for file in $mDIR; do + if [ "$file" != "${local_music[$choice]}" ]; then + mpv --shuffle --vid=no "$file" + fi + done } # Main function for playing online music @@ -69,14 +75,15 @@ play_online_music() { # Check if an online music process is running and send a notification, otherwise run the main function pkill mpv && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || { + # Prompt the user to choose between local and online music - user_choice=$(printf "Play from Music Folder\nOnline Streaming" | rofi -dmenu -p "Select music source") + user_choice=$(printf "Play from Music Folder\nPlay from Online Stations" | rofi -dmenu -config ~/.config/rofi/config-rofi-Beats-menu.rasi -p "Select music source") case "$user_choice" in "Play from Music Folder") play_local_music ;; - "Online Streaming") + "Play from Online Stations") play_online_music ;; *) @@ -84,3 +91,4 @@ pkill mpv && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || { ;; esac } + -- cgit v1.2.3 From 0a59d4b9fd14384c5f726504d363ccd2cb213d09 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 13 May 2024 01:25:37 +0900 Subject: updated rofi.beats. initial boot, wallpaper copy.sh in preparation for the upcomming release --- .editorconfig | 2 +- config/hypr/UserScripts/RofiBeats.sh | 52 +++++++++++++++++++---------------- config/hypr/initial-boot.sh | 8 +++--- copy.sh | 6 ++-- wallpapers/Anime-Landscape2.png | Bin 7704488 -> 0 bytes wallpapers/Fantasy-Waterfall.png | Bin 0 -> 12428942 bytes 6 files changed, 37 insertions(+), 31 deletions(-) delete mode 100644 wallpapers/Anime-Landscape2.png create mode 100644 wallpapers/Fantasy-Waterfall.png (limited to 'config/hypr') diff --git a/.editorconfig b/.editorconfig index f8e72805..5644fbb2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ root = true [*] indent_style = space -indent_size = 4 +indent_size = 2 diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index c6fbb06d..76634a1a 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -1,18 +1,10 @@ #!/bin/bash -# Directory for icons -iDIR="$HOME/.config/swaync/icons" - # Directory music folder -mDIR="$HOME/Music/*" +mDIR="$HOME/Music/" -# Local Music -declare -A local_music -# Populate the menu_options array with music files from the Music folder -for file in $mDIR; do - filename=$(basename "$file") - local_music["$filename"]="$file" -done +# Directory for icons +iDIR="$HOME/.config/swaync/icons" # Online Stations declare -A online_music=( @@ -30,6 +22,17 @@ declare -A online_music=( ["Korean Drama OST 📻🎶"]="https://youtube.com/playlist?list=PLUge_o9AIFp4HuA-A3e3ZqENh63LuRRlQ" ) +# Local Music +# Populate local_music array with files from music directory and subdirectories +populate_local_music() { + local_music=() + filenames=() + while IFS= read -r file; do + local_music+=("$file") + filenames+=("$(basename "$file")") + done < <(find "$mDIR" -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.wav" -o -iname "*.ogg" \)) +} + # Function for displaying notifications notification() { notify-send -u normal -i "$iDIR/music.png" "Playing: $@" @@ -37,26 +40,30 @@ notification() { # Main function for playing local music play_local_music() { + populate_local_music + # Prompt the user to select a song - choice=$(printf "%s\n" "${!local_music[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -p "Local Music") + choice=$(printf "%s\n" "${filenames[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -p "Local Music") if [ -z "$choice" ]; then exit 1 fi - file="${local_music[$choice]}" + # Find the corresponding file path based on user's choice + for (( i=0; i<"${#filenames[@]}"; i++ )); do + if [ "${filenames[$i]}" = "$choice" ]; then + file="${local_music[$i]}" + break + fi + done notification "$choice" - # Play the selected local music file using mpv and shuffle the rest - mpv --shuffle --vid=no "$file" && \ - for file in $mDIR; do - if [ "$file" != "${local_music[$choice]}" ]; then - mpv --shuffle --vid=no "$file" - fi - done + # Play the selected local music file using mpv + mpv --shuffle --vid=no "$file" } + # Main function for playing online music play_online_music() { choice=$(printf "%s\n" "${!online_music[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi -p "Online Music") @@ -76,8 +83,8 @@ play_online_music() { # Check if an online music process is running and send a notification, otherwise run the main function pkill mpv && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || { - # Prompt the user to choose between local and online music - user_choice=$(printf "Play from Music Folder\nPlay from Online Stations" | rofi -dmenu -config ~/.config/rofi/config-rofi-Beats-menu.rasi -p "Select music source") +# Prompt the user to choose between local and online music +user_choice=$(printf "Play from Music Folder\nPlay from Online Stations" | rofi -dmenu -config ~/.config/rofi/config-rofi-Beats-menu.rasi -p "Select music source") case "$user_choice" in "Play from Music Folder") @@ -91,4 +98,3 @@ pkill mpv && notify-send -u low -i "$iDIR/music.png" "Online Music stopped" || { ;; esac } - diff --git a/config/hypr/initial-boot.sh b/config/hypr/initial-boot.sh index 95b9e491..162ad65f 100755 --- a/config/hypr/initial-boot.sh +++ b/config/hypr/initial-boot.sh @@ -7,8 +7,8 @@ # Variables scriptsDir=$HOME/.config/hypr/scripts -wallpaper=$HOME/Pictures/wallpapers/Lofi-Urban-Nightscape.png -waybar_style="$HOME/.config/waybar/style/[Wallust] Chroma Tally.css" +wallpaper=$HOME/Pictures/wallpapers/Fantasy-Waterfall.png +waybar_style="$HOME/.config/waybar/style/[Dark] Latte-Wallust combined.css" kvantum_theme="Catppuccin-Mocha" swww="swww img" @@ -26,8 +26,8 @@ if [ ! -f ~/.config/hypr/.initial_startup_done ]; then # initiate GTK dark mode and apply icon and cursor theme gsettings set org.gnome.desktop.interface color-scheme prefer-dark > /dev/null 2>&1 & - gsettings set org.gnome.desktop.interface gtk-theme Tokyonight-Dark-BL-LB > /dev/null 2>&1 & - gsettings set org.gnome.desktop.interface icon-theme Tokyonight-Dark > /dev/null 2>&1 & + gsettings set org.gnome.desktop.interface gtk-theme Tokyonight-Dark-Moon-BL-LB > /dev/null 2>&1 & + gsettings set org.gnome.desktop.interface icon-theme Flat-Remix-Blue-Dark > /dev/null 2>&1 & gsettings set org.gnome.desktop.interface cursor-theme Bibata-Modern-Ice > /dev/null 2>&1 & gsettings set org.gnome.desktop.interface cursor-size 24 > /dev/null 2>&1 & diff --git a/copy.sh b/copy.sh index 9ab32b07..e1047f24 100755 --- a/copy.sh +++ b/copy.sh @@ -3,8 +3,8 @@ clear -wallpaper=$HOME/Pictures/wallpapers/Lofi-Urban-Nightscape.png -Waybar_Style="$HOME/.config/waybar/style/[Wallust] Chroma Tally.css" +wallpaper=$HOME/Pictures/wallpapers/Fantasy-Waterfall.png +waybar_style="$HOME/.config/waybar/style/[Dark] Latte-Wallust combined.css" # Check if running as root. If root, script will exit if [[ $EUID -eq 0 ]]; then @@ -295,7 +295,7 @@ while true; do done # symlinks for waybar style -ln -sf "$Waybar_Style" "$HOME/.config/waybar/style.css" && \ +ln -sf "$waybar_Style" "$HOME/.config/waybar/style.css" && \ # initialize wallust to avoid config error on hyprland wallust run -s $wallpaper 2>&1 | tee -a "$LOG" diff --git a/wallpapers/Anime-Landscape2.png b/wallpapers/Anime-Landscape2.png deleted file mode 100644 index c8681762..00000000 Binary files a/wallpapers/Anime-Landscape2.png and /dev/null differ diff --git a/wallpapers/Fantasy-Waterfall.png b/wallpapers/Fantasy-Waterfall.png new file mode 100644 index 00000000..91c58a47 Binary files /dev/null and b/wallpapers/Fantasy-Waterfall.png differ -- cgit v1.2.3