diff options
| author | Ja.KooLit <jimmielovejay@gmail.com> | 2024-05-13 02:36:43 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-13 02:36:43 +0900 |
| commit | 683e801de6ee2fe01513311e2bc13f695cd96486 (patch) | |
| tree | 64df94cb64f5ba161761bfd64ae93658ca163f9c /config/hypr/scripts | |
| parent | 35327b2814b228253464f0358f58c553ec98002b (diff) | |
| parent | ea93a71cf6ac92041f00168e040cdc22882047b7 (diff) | |
Merge branch 'development' into main
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/DarkLight.sh | 28 | ||||
| -rwxr-xr-x | config/hypr/scripts/GameMode.sh | 2 | ||||
| -rwxr-xr-x | config/hypr/scripts/KeyHints.sh | 4 | ||||
| -rwxr-xr-x | config/hypr/scripts/LockScreen.sh | 2 | ||||
| -rwxr-xr-x | config/hypr/scripts/Refresh.sh | 4 | ||||
| -rwxr-xr-x | config/hypr/scripts/RefreshNoWaybar.sh | 8 | ||||
| -rwxr-xr-x | config/hypr/scripts/Sounds.sh | 4 | ||||
| -rw-r--r-- | config/hypr/scripts/UptimeNixOS.sh | 33 | ||||
| -rwxr-xr-x | config/hypr/scripts/WallustSwww.sh (renamed from config/hypr/scripts/PywalSwww.sh) | 11 |
9 files changed, 70 insertions, 26 deletions
diff --git a/config/hypr/scripts/DarkLight.sh b/config/hypr/scripts/DarkLight.sh index f9d2a933..e6f212f6 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,13 @@ notify_user() { notify-send -u low -i "$notif" "Switching to $1 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 + # Function to set Waybar style set_waybar_style() { theme="$1" @@ -108,17 +119,19 @@ 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 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,10 +214,11 @@ update_theme_mode sleep 0.5 # Run remaining scripts -${SCRIPTSDIR}/PywalSwww.sh +${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" 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/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" \ 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 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/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 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" diff --git a/config/hypr/scripts/PywalSwww.sh b/config/hypr/scripts/WallustSwww.sh index 9f7b15b5..2a711028 100755 --- a/config/hypr/scripts/PywalSwww.sh +++ b/config/hypr/scripts/WallustSwww.sh @@ -1,6 +1,6 @@ #!/bin/bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# Pywal Colors for current wallpaper +# Wallust Colors for current wallpaper # Define the path to the swww cache directory cache_dir="$HOME/.cache/swww/" @@ -30,9 +30,8 @@ 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 & + # execute wallust + echo 'about to execute wallust' + # execute wallust skipping tty and terminal changes + wallust run "$wallpaper_path" -s & fi |
