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/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 +++++++++++++++++++++++++++++++++ 6 files changed, 67 insertions(+), 53 deletions(-) delete mode 100755 config/hypr/scripts/PywalSwww.sh create mode 100755 config/hypr/scripts/WallustSwww.sh (limited to 'config/hypr/scripts') 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 -- 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/scripts') 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/scripts') 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 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/scripts') 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/scripts') 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 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/scripts') 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