hyprconfig
This commit is contained in:
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Remove gamemode flag
|
||||
if [ -f ~/.cache/gamemode ] ;then
|
||||
rm ~/.cache/gamemode
|
||||
echo ":: ~/.cache/gamemode removed"
|
||||
fi
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
clear
|
||||
sleep 0.5
|
||||
figlet -f smslant "Diagnosis"
|
||||
echo
|
||||
echo "This script will check that essential packages and "
|
||||
echo "execution commands are available on your system."
|
||||
echo
|
||||
|
||||
_commandExists() {
|
||||
package="$1";
|
||||
if ! type $package > /dev/null 2>&1; then
|
||||
echo ":: ERROR: $package doesn't exists. Please install it with yay -S $2"
|
||||
else
|
||||
echo ":: OK: $package found."
|
||||
fi
|
||||
}
|
||||
|
||||
_folderExists() {
|
||||
folder="$1";
|
||||
if [ ! -d $folder ]; then
|
||||
echo ":: ERROR: $folder doesn't exists."
|
||||
else
|
||||
echo ":: OK: $folder found."
|
||||
fi
|
||||
}
|
||||
|
||||
_commandExists "rofi" "rofi-wayland"
|
||||
_commandExists "dunst" "dunst"
|
||||
_commandExists "waybar" "waybar"
|
||||
_commandExists "hyprpaper" "hyprpaper"
|
||||
_commandExists "hyprlock" "hyprpaper"
|
||||
_commandExists "hypridle" "hyprpaper"
|
||||
_commandExists "hyprshade" "hyprshade"
|
||||
_commandExists "wal" "python-pywal"
|
||||
_commandExists "gum" "gum"
|
||||
_commandExists "wlogout" "wlogout"
|
||||
_commandExists "ags" "ags"
|
||||
_commandExists "magick" "imagemagick"
|
||||
_commandExists "figlet" "figlet"
|
||||
_commandExists "waypaper" "waypaper"
|
||||
|
||||
echo
|
||||
echo "Press return to exit"
|
||||
read
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
clear
|
||||
figlet -f smslant "Disable DM"
|
||||
echo "Hyprland recommends the start with the tty login."
|
||||
echo "You can deactivate the current display manager (if exists)."
|
||||
echo ""
|
||||
echo "-> Do you really want to deactivate the display manager?"
|
||||
while true; do
|
||||
read -p "Do you want to enable the sddm display manager and setup theme? (Yy/Nn): " yn
|
||||
case $yn in
|
||||
[Yy]* )
|
||||
if [ -f /etc/systemd/system/display-manager.service ]; then
|
||||
sudo rm /etc/systemd/system/display-manager.service
|
||||
echo "Current display manager removed."
|
||||
else
|
||||
echo "No active display manager found."
|
||||
fi
|
||||
break;;
|
||||
[Nn]* )
|
||||
exit
|
||||
break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
if [ -f ~/.cache/gamemode ] ;then
|
||||
hyprctl reload
|
||||
rm ~/.cache/gamemode
|
||||
notify-send "Gamemode deactivated" "Animations and blur enabled"
|
||||
else
|
||||
hyprctl --batch "\
|
||||
keyword animations:enabled 0;\
|
||||
keyword decoration:drop_shadow 0;\
|
||||
keyword decoration:blur:enabled 0;\
|
||||
keyword general:gaps_in 0;\
|
||||
keyword general:gaps_out 0;\
|
||||
keyword general:border_size 1;\
|
||||
keyword decoration:rounding 0"
|
||||
touch ~/.cache/gamemode
|
||||
notify-send "Gamemode activated" "Animations and blur disabled"
|
||||
fi
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# Source: https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
|
||||
|
||||
config="$HOME/.config/gtk-3.0/settings.ini"
|
||||
if [ ! -f "$config" ]; then exit 1; fi
|
||||
|
||||
gnome_schema="org.gnome.desktop.interface"
|
||||
gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
cursor_size="$(grep 'gtk-cursor-theme-size' "$config" | sed 's/.*\s*=\s*//')"
|
||||
font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')"
|
||||
|
||||
echo $gtk_theme
|
||||
echo $icon_theme
|
||||
echo $cursor_theme
|
||||
echo $cursor_size
|
||||
echo $font_name
|
||||
|
||||
gsettings set "$gnome_schema" gtk-theme "$gtk_theme"
|
||||
gsettings set "$gnome_schema" icon-theme "$icon_theme"
|
||||
gsettings set "$gnome_schema" cursor-theme "$cursor_theme"
|
||||
gsettings set "$gnome_schema" font-name "$font_name"
|
||||
gsettings set "$gnome_schema" color-scheme "prefer-dark"
|
||||
|
||||
if [ -f ~/.config/hypr/conf/cursor.conf ] ;then
|
||||
echo "exec-once = hyprctl setcursor $cursor_theme $cursor_size" > ~/.config/hypr/conf/cursor.conf
|
||||
hyprctl setcursor $cursor_theme $cursor_size
|
||||
fi
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
SERVICE="hypridle"
|
||||
if [[ "$1" == "status" ]]; then
|
||||
sleep 1
|
||||
if pgrep -x "$SERVICE" >/dev/null ;then
|
||||
echo '{"text": "RUNNING", "class": "active", "tooltip": "Screen locking active\nLeft: Deactivate\nRight: Lock Screen"}'
|
||||
else
|
||||
echo '{"text": "NOT RUNNING", "class": "notactive", "tooltip": "Screen locking deactivated\nLeft: Activate\nRight: Lock Screen"}'
|
||||
fi
|
||||
fi
|
||||
if [[ "$1" == "toggle" ]]; then
|
||||
if pgrep -x "$SERVICE" >/dev/null ;then
|
||||
killall hypridle
|
||||
else
|
||||
hypridle
|
||||
fi
|
||||
fi
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
wallpaper_engine=$(cat $HOME/.config/ml4w/settings/wallpaper-engine.sh)
|
||||
if [ "$wallpaper_engine" == "swww" ] ;then
|
||||
# swww
|
||||
echo ":: Using swww"
|
||||
swww init
|
||||
swww-daemon --format xrgb
|
||||
sleep 0.5
|
||||
~/.config/hypr/scripts/wallpaper.sh init
|
||||
elif [ "$wallpaper_engine" == "hyprpaper" ] ;then
|
||||
# hyprpaper
|
||||
echo ":: Using hyprpaper"
|
||||
sleep 0.5
|
||||
~/.config/hypr/scripts/wallpaper.sh init
|
||||
else
|
||||
echo ":: Wallpaper Engine disabled"
|
||||
~/.config/hypr/scripts/wallpaper.sh init
|
||||
fi
|
||||
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# -----------------------------------------------------
|
||||
# Get keybindings location based on variation
|
||||
# -----------------------------------------------------
|
||||
config_file=$(cat ~/.config/hypr/conf/keybinding.conf)
|
||||
config_file=${config_file/source = ~/}
|
||||
config_file=${config_file/source=~/}
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Path to keybindings config file
|
||||
# -----------------------------------------------------
|
||||
config_file="/home/$USER$config_file"
|
||||
echo "Reading from: $config_file"
|
||||
|
||||
keybinds=""
|
||||
|
||||
# Detect Start String
|
||||
while read -r line
|
||||
do
|
||||
if [[ "$line" == "bind"* ]]; then
|
||||
|
||||
line="$(echo "$line" | sed 's/$mainMod/SUPER/g')"
|
||||
line="$(echo "$line" | sed 's/bind = //g')"
|
||||
line="$(echo "$line" | sed 's/bindm = //g')"
|
||||
|
||||
IFS='#'
|
||||
read -a strarr <<<"$line"
|
||||
kb_str=${strarr[0]}
|
||||
cm_str=${strarr[1]}
|
||||
|
||||
IFS=','
|
||||
read -a kbarr <<<"$kb_str"
|
||||
|
||||
item="${kbarr[0]} + ${kbarr[1]}"$'\r'"${cm_str:1}"
|
||||
keybinds=$keybinds"$item"$'\n'
|
||||
fi
|
||||
done < "$config_file"
|
||||
|
||||
sleep 0.2
|
||||
echo -e "$keybinds" | walker -l 10 -p "Keybinds: "
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
if [ -f ~/.config/ml4w/version/compare.sh ] ;then
|
||||
$HOME/.config/ml4w/version/compare.sh
|
||||
fi
|
||||
|
||||
if [ ! -f ~/.cache/ml4w-post-install ] ;then
|
||||
if [ ! -f $HOME/.cache/ml4w-welcome-autostart ] ;then
|
||||
echo ":: Autostart of ML4W Welcome App enabled."
|
||||
if [ -f $HOME/.config/ml4w/apps/ML4W_Welcome-x86_64.AppImage ] ;then
|
||||
echo ":: Starting ML4W Welcome App ..."
|
||||
sleep 2
|
||||
$HOME/.config/ml4w/apps/ML4W_Welcome-x86_64.AppImage
|
||||
else
|
||||
echo ":: ML4W Welcome App not found."
|
||||
fi
|
||||
|
||||
else
|
||||
echo ":: Autostart of ML4W Welcome App disabled."
|
||||
fi
|
||||
else
|
||||
rm ~/.cache/ml4w-post-install
|
||||
terminal=$(cat ~/.config/ml4w/settings/terminal.sh)
|
||||
$terminal --class dotfiles-floating -e ~/.config/ml4w/postinstall.sh
|
||||
$HOME/.config/ml4w/apps/ML4W_Welcome-x86_64.AppImage
|
||||
fi
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Function to log messages (useful for debugging)
|
||||
log_message() {
|
||||
# echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" >> ~/moveto_log.txt
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1"
|
||||
}
|
||||
|
||||
# Get the target workspace from the argument
|
||||
target_workspace=$1
|
||||
|
||||
# Check if a target workspace was provided
|
||||
if [ -z "$target_workspace" ]; then
|
||||
log_message "Error: No target workspace provided"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the current active workspace
|
||||
current_workspace=$(hyprctl activewindow -j | jq '.workspace.id')
|
||||
|
||||
if [ -z "$current_workspace" ]; then
|
||||
log_message "Error: Couldn't determine current workspace"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_message "Moving from workspace $current_workspace to $target_workspace"
|
||||
|
||||
# Get all window addresses in the current workspace
|
||||
window_addresses=$(hyprctl clients -j | jq -r ".[] | select(.workspace.id == $current_workspace) | .address")
|
||||
|
||||
# Move each window to the target workspace
|
||||
for address in $window_addresses; do
|
||||
log_message "Moving window $address to workspace $target_workspace"
|
||||
hyprctl dispatch movetoworkspacesilent "$target_workspace,address:$address"
|
||||
done
|
||||
|
||||
log_message "Finished moving windows"
|
||||
|
||||
# Switch to the target workspace
|
||||
hyprctl dispatch workspace "$target_workspace"
|
||||
|
||||
log_message "Switched to workspace $target_workspace"
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if eww is open
|
||||
FILE="$HOME/.cache/ml4w_sidebar"
|
||||
|
||||
if [[ "$1" == "exit" ]]; then
|
||||
echo ":: Exit"
|
||||
if [[ -f "$FILE" ]]; then
|
||||
rm $FILE
|
||||
fi
|
||||
sleep 0.5
|
||||
killall -9 Hyprland
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
if [[ "$1" == "lock" ]]; then
|
||||
echo ":: Lock"
|
||||
sleep 0.5
|
||||
hyprlock
|
||||
fi
|
||||
|
||||
if [[ "$1" == "reboot" ]]; then
|
||||
echo ":: Reboot"
|
||||
if [[ -f "$FILE" ]]; then
|
||||
rm $FILE
|
||||
fi
|
||||
sleep 0.5
|
||||
systemctl reboot
|
||||
fi
|
||||
|
||||
if [[ "$1" == "shutdown" ]]; then
|
||||
echo ":: Shutdown"
|
||||
if [[ -f "$FILE" ]]; then
|
||||
rm $FILE
|
||||
fi
|
||||
sleep 0.5
|
||||
systemctl poweroff
|
||||
fi
|
||||
|
||||
if [[ "$1" == "suspend" ]]; then
|
||||
echo ":: Suspend"
|
||||
sleep 0.5
|
||||
systemctl suspend
|
||||
fi
|
||||
|
||||
if [[ "$1" == "hibernate" ]]; then
|
||||
echo ":: Hibernate"
|
||||
sleep 1;
|
||||
systemctl hibernate
|
||||
fi
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
killall hypridle
|
||||
sleep 1
|
||||
hypridle &
|
||||
notify-send "hypridle has been restarted."
|
||||
Executable
+217
@@ -0,0 +1,217 @@
|
||||
#!/bin/bash
|
||||
# -----------------------------------------------------
|
||||
|
||||
# Screenshots will be stored in $HOME by default.
|
||||
# The screenshot will be moved into the screenshot directory
|
||||
|
||||
# Add this to ~/.config/user-dirs.dirs to save screenshots in a custom folder:
|
||||
# XDG_SCREENSHOTS_DIR="$HOME/Screenshots"
|
||||
|
||||
prompt='Screenshot'
|
||||
mesg="DIR: ~/Screenshots"
|
||||
|
||||
# Screenshot Filename
|
||||
source ~/.config/ml4w/settings/screenshot-filename.sh
|
||||
|
||||
# Screenshot Folder
|
||||
source ~/.config/ml4w/settings/screenshot-folder.sh
|
||||
|
||||
# Screenshot Editor
|
||||
export GRIMBLAST_EDITOR="$(cat ~/.config/ml4w/settings/screenshot-editor.sh)"
|
||||
|
||||
# Example for keybindings
|
||||
# bind = SUPER, p, exec, grimblast save active
|
||||
# bind = SUPER SHIFT, p, exec, grimblast save area
|
||||
# bind = SUPER ALT, p, exec, grimblast save output
|
||||
# bind = SUPER CTRL, p, exec, grimblast save screen
|
||||
|
||||
# Options
|
||||
option_1="Immediate"
|
||||
option_2="Delayed"
|
||||
|
||||
option_capture_1="Capture Everything"
|
||||
option_capture_2="Capture Active Display"
|
||||
option_capture_3="Capture Selection"
|
||||
|
||||
option_time_1="5s"
|
||||
option_time_2="10s"
|
||||
option_time_3="20s"
|
||||
option_time_4="30s"
|
||||
option_time_5="60s"
|
||||
#option_time_4="Custom (in seconds)" # Roadmap or someone contribute :)
|
||||
|
||||
list_col='1'
|
||||
list_row='2'
|
||||
|
||||
copy='Copy'
|
||||
save='Save'
|
||||
copy_save='Copy & Save'
|
||||
edit='Edit'
|
||||
|
||||
# Rofi CMD
|
||||
rofi_cmd() {
|
||||
rofi -dmenu -replace -config ~/.config/rofi/config-screenshot.rasi -i -no-show-icons -l 2 -width 30 -p "Take screenshot"
|
||||
}
|
||||
|
||||
# Pass variables to rofi dmenu
|
||||
run_rofi() {
|
||||
echo -e "$option_1\n$option_2" | rofi_cmd
|
||||
}
|
||||
|
||||
####
|
||||
# Choose Timer
|
||||
# CMD
|
||||
timer_cmd() {
|
||||
rofi -dmenu -replace -config ~/.config/rofi/config-screenshot.rasi -i -no-show-icons -l 5 -width 30 -p "Choose timer"
|
||||
}
|
||||
|
||||
# Ask for confirmation
|
||||
timer_exit() {
|
||||
echo -e "$option_time_1\n$option_time_2\n$option_time_3\n$option_time_4\n$option_time_5" | timer_cmd
|
||||
}
|
||||
|
||||
# Confirm and execute
|
||||
timer_run() {
|
||||
selected_timer="$(timer_exit)"
|
||||
if [[ "$selected_timer" == "$option_time_1" ]]; then
|
||||
countdown=5
|
||||
${1}
|
||||
elif [[ "$selected_timer" == "$option_time_2" ]]; then
|
||||
countdown=10
|
||||
${1}
|
||||
elif [[ "$selected_timer" == "$option_time_3" ]]; then
|
||||
countdown=20
|
||||
${1}
|
||||
elif [[ "$selected_timer" == "$option_time_4" ]]; then
|
||||
countdown=30
|
||||
${1}
|
||||
elif [[ "$selected_timer" == "$option_time_5" ]]; then
|
||||
countdown=60
|
||||
${1}
|
||||
else
|
||||
exit
|
||||
fi
|
||||
}
|
||||
###
|
||||
|
||||
####
|
||||
# Chose Screenshot Type
|
||||
# CMD
|
||||
type_screenshot_cmd() {
|
||||
rofi -dmenu -replace -config ~/.config/rofi/config-screenshot.rasi -i -no-show-icons -l 3 -width 30 -p "Type of screenshot"
|
||||
}
|
||||
|
||||
# Ask for confirmation
|
||||
type_screenshot_exit() {
|
||||
echo -e "$option_capture_1\n$option_capture_2\n$option_capture_3" | type_screenshot_cmd
|
||||
}
|
||||
|
||||
# Confirm and execute
|
||||
type_screenshot_run() {
|
||||
selected_type_screenshot="$(type_screenshot_exit)"
|
||||
if [[ "$selected_type_screenshot" == "$option_capture_1" ]]; then
|
||||
option_type_screenshot=screen
|
||||
${1}
|
||||
elif [[ "$selected_type_screenshot" == "$option_capture_2" ]]; then
|
||||
option_type_screenshot=output
|
||||
${1}
|
||||
elif [[ "$selected_type_screenshot" == "$option_capture_3" ]]; then
|
||||
option_type_screenshot=area
|
||||
${1}
|
||||
else
|
||||
exit
|
||||
fi
|
||||
}
|
||||
###
|
||||
|
||||
####
|
||||
# Choose to save or copy photo
|
||||
# CMD
|
||||
copy_save_editor_cmd() {
|
||||
rofi -dmenu -replace -config ~/.config/rofi/config-screenshot.rasi -i -no-show-icons -l 4 -width 30 -p "How to save"
|
||||
}
|
||||
|
||||
# Ask for confirmation
|
||||
copy_save_editor_exit() {
|
||||
echo -e "$copy\n$save\n$copy_save\n$edit" | copy_save_editor_cmd
|
||||
}
|
||||
|
||||
# Confirm and execute
|
||||
copy_save_editor_run() {
|
||||
selected_chosen="$(copy_save_editor_exit)"
|
||||
if [[ "$selected_chosen" == "$copy" ]]; then
|
||||
option_chosen=copy
|
||||
${1}
|
||||
elif [[ "$selected_chosen" == "$save" ]]; then
|
||||
option_chosen=save
|
||||
${1}
|
||||
elif [[ "$selected_chosen" == "$copy_save" ]]; then
|
||||
option_chosen=copysave
|
||||
${1}
|
||||
elif [[ "$selected_chosen" == "$edit" ]]; then
|
||||
option_chosen=edit
|
||||
${1}
|
||||
else
|
||||
exit
|
||||
fi
|
||||
}
|
||||
###
|
||||
|
||||
timer() {
|
||||
if [[ $countdown -gt 10 ]]; then
|
||||
notify-send -t 1000 "Taking screenshot in ${countdown} seconds"
|
||||
countdown_less_10=$((countdown - 10))
|
||||
sleep $countdown_less_10
|
||||
countdown=10
|
||||
fi
|
||||
while [[ $countdown -ne 0 ]]; do
|
||||
notify-send -t 1000 "Taking screenshot in ${countdown} seconds"
|
||||
countdown=$((countdown - 1))
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
# take shots
|
||||
takescreenshot() {
|
||||
sleep 1
|
||||
grimblast --notify "$option_chosen" "$option_type_screenshot" $NAME
|
||||
if [ -f $HOME/$NAME ] ;then
|
||||
if [ -d $screenshot_folder ] ;then
|
||||
mv $HOME/$NAME $screenshot_folder/
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
takescreenshot_timer() {
|
||||
sleep 1
|
||||
timer
|
||||
grimblast --notify "$option_chosen" "$option_type_screenshot" $NAME
|
||||
if [ -f $HOME/$NAME ] ;then
|
||||
if [ -d $screenshot_folder ] ;then
|
||||
mv $HOME/$NAME $screenshot_folder/
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Execute Command
|
||||
run_cmd() {
|
||||
if [[ "$1" == '--opt1' ]]; then
|
||||
type_screenshot_run
|
||||
copy_save_editor_run "takescreenshot"
|
||||
elif [[ "$1" == '--opt2' ]]; then
|
||||
timer_run
|
||||
type_screenshot_run
|
||||
copy_save_editor_run "takescreenshot_timer"
|
||||
fi
|
||||
}
|
||||
|
||||
# Actions
|
||||
chosen="$(run_rofi)"
|
||||
case ${chosen} in
|
||||
$option_1)
|
||||
run_cmd --opt1
|
||||
;;
|
||||
$option_2)
|
||||
run_cmd --opt2
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,8 @@
|
||||
precision highp float;
|
||||
varying vec2 v_texcoord;
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
vec4 pixColor = texture2D(tex, v_texcoord);
|
||||
gl_FragColor = vec4(1.0 - pixColor.r, 1.0 - pixColor.g, 1.0 - pixColor.b, pixColor.a);
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
cache_file="$HOME/.cache/toggle_animation"
|
||||
if [[ $(cat $HOME/.config/hypr/conf/animation.conf) == *"disabled"* ]]; then
|
||||
echo ":: Toggle blocked by disabled.conf variation."
|
||||
else
|
||||
if [ -f $cache_file ] ;then
|
||||
hyprctl keyword animations:enabled true
|
||||
rm $cache_file
|
||||
else
|
||||
hyprctl keyword animations:enabled false
|
||||
touch $cache_file
|
||||
fi
|
||||
fi
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
sec=$(cat ~/.config/ml4w/settings/wallpaper-automation.sh)
|
||||
_setWallpaperRandomly() {
|
||||
waypaper --random
|
||||
echo ":: Next wallpaper in 60 seconds..."
|
||||
sleep $sec
|
||||
_setWallpaperRandomly
|
||||
}
|
||||
|
||||
if [ ! -f ~/.config/ml4w/cache/wallpaper-automation ] ;then
|
||||
touch ~/.config/ml4w/cache/wallpaper-automation
|
||||
echo ":: Start wallpaper automation script"
|
||||
notify-send "Wallpaper automation process started" "Wallpaper will be changed every $sec seconds."
|
||||
_setWallpaperRandomly
|
||||
else
|
||||
rm ~/.config/ml4w/cache/wallpaper-automation
|
||||
notify-send "Wallpaper automation process stopped."
|
||||
echo ":: Wallpaper automation script process $wp stopped"
|
||||
wp=$(pgrep -f wallpaper-automation.sh)
|
||||
kill -KILL $wp
|
||||
fi
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
generated_versions="$HOME/.config/ml4w/cache/wallpaper-generated"
|
||||
rm $generated_versions/*
|
||||
echo ":: Wallpaper cache cleared"
|
||||
notify-send "Wallpaper cache cleared"
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Open rofi to select the Hyprshade filter for toggle
|
||||
options="$(ls ~/.config/hypr/effects/wallpaper/)\noff"
|
||||
|
||||
# Open rofi
|
||||
choice=$(echo -e "$options" | rofi -dmenu -replace -config ~/.config/rofi/config-themes.rasi -i -no-show-icons -l 5 -width 30 -p "Hyprshade")
|
||||
if [ ! -z $choice ] ;then
|
||||
echo "$choice" > ~/.config/ml4w/settings/wallpaper-effect.sh
|
||||
dunstify "Changing Wallpaper Effect to " "$choice"
|
||||
~/.config/hypr/scripts/wallpaper.sh
|
||||
fi
|
||||
Executable
+152
@@ -0,0 +1,152 @@
|
||||
#!/bin/bash
|
||||
# -----------------------------------------------------
|
||||
# Check to use wallpaper cache
|
||||
# -----------------------------------------------------
|
||||
|
||||
use_cache=0
|
||||
if [ -f ~/.config/ml4w/settings/wallpaper_cache ] ;then
|
||||
use_cache=1
|
||||
fi
|
||||
|
||||
if [ "$use_cache" == "1" ] ;then
|
||||
echo ":: Using Wallpaper Cache"
|
||||
else
|
||||
echo ":: Wallpaper Cache disabled"
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Set defaults
|
||||
# -----------------------------------------------------
|
||||
|
||||
force_generate=0
|
||||
generated_versions="$HOME/.config/ml4w/cache/wallpaper-generated"
|
||||
cache_file="$HOME/.config/ml4w/cache/current_wallpaper"
|
||||
blurred_wallpaper="$HOME/.config/ml4w/cache/blurred_wallpaper.png"
|
||||
square_wallpaper="$HOME/.config/ml4w/cache/square_wallpaper.png"
|
||||
rasi_file="$HOME/.config/ml4w/cache/current_wallpaper.rasi"
|
||||
blur_file="$HOME/.config/ml4w/settings/blur.sh"
|
||||
default_wallpaper="$HOME/wallpaper/default.jpg"
|
||||
wallpaper_effect="$HOME/.config/ml4w/settings/wallpaper-effect.sh"
|
||||
blur="50x30"
|
||||
blur=$(cat $blur_file)
|
||||
|
||||
# Create folder with generated versions of wallpaper if not exists
|
||||
if [ ! -d $generated_versions ] ;then
|
||||
mkdir $generated_versions
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Get selected wallpaper
|
||||
# -----------------------------------------------------
|
||||
|
||||
if [ -z $1 ] ;then
|
||||
if [ -f $cache_file ] ;then
|
||||
wallpaper=$(cat $cache_file)
|
||||
else
|
||||
wallpaper=$default_wallpaper
|
||||
fi
|
||||
else
|
||||
wallpaper=$1
|
||||
fi
|
||||
used_wallpaper=$wallpaper
|
||||
echo ":: Setting wallpaper with original image $wallpaper"
|
||||
tmp_wallpaper=$wallpaper
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Copy path of current wallpaper to cache file
|
||||
# -----------------------------------------------------
|
||||
|
||||
if [ ! -f $cache_file ] ;then
|
||||
touch $cache_file
|
||||
fi
|
||||
echo "$wallpaper" > $cache_file
|
||||
echo ":: Path of current wallpaper copied to $cache_file"
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Get wallpaper filename
|
||||
# -----------------------------------------------------
|
||||
wallpaper_filename=$(basename $wallpaper)
|
||||
echo ":: Wallpaper Filename: $wallpaper_filename"
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Wallpaper Effects
|
||||
# -----------------------------------------------------
|
||||
|
||||
if [ -f $wallpaper_effect ] ;then
|
||||
effect=$(cat $wallpaper_effect)
|
||||
if [ ! "$effect" == "off" ] ;then
|
||||
used_wallpaper=$generated_versions/$effect-$wallpaper_filename
|
||||
if [ -f $generated_versions/$effect-$wallpaper_filename ] && [ "$force_generate" == "0" ] && [ "$use_cache" == "1" ] ;then
|
||||
echo ":: Use cached wallpaper $effect-$wallpaper_filename"
|
||||
else
|
||||
echo ":: Generate new cached wallpaper $effect-$wallpaper_filename with effect $effect"
|
||||
dunstify "Using wallpaper effect $effect..." "with image $wallpaper_filename" -h int:value:10 -h string:x-dunst-stack-tag:wallpaper
|
||||
source $HOME/.config/hypr/effects/wallpaper/$effect
|
||||
fi
|
||||
echo ":: Loading wallpaper $generated_versions/$effect-$wallpaper_filename with effect $effect"
|
||||
else
|
||||
echo ":: Wallpaper effect is set to off"
|
||||
fi
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Execute pywal
|
||||
# -----------------------------------------------------
|
||||
|
||||
echo ":: Execute pywal with $used_wallpaper"
|
||||
wal -q -i $used_wallpaper
|
||||
source "$HOME/.cache/wal/colors.sh"
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Write hyprpaper.conf
|
||||
# -----------------------------------------------------
|
||||
|
||||
echo ":: Setting wallpaper with $used_wallpaper"
|
||||
killall -e hyprpaper &
|
||||
sleep 1;
|
||||
wal_tpl=$(cat $HOME/.config/ml4w/settings/hyprpaper.tpl)
|
||||
output=${wal_tpl//WALLPAPER/$used_wallpaper}
|
||||
echo "$output" > $HOME/.config/hypr/hyprpaper.conf
|
||||
hyprpaper & > /dev/null 2>&1
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Reload Waybar
|
||||
# -----------------------------------------------------
|
||||
~/.config/waybar/launch.sh
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Reload AGS
|
||||
# -----------------------------------------------------
|
||||
killall ags
|
||||
ags &
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Created blurred wallpaper
|
||||
# -----------------------------------------------------
|
||||
|
||||
echo ":: Generate new cached wallpaper blur-$blur-$wallpaper_filename with blur $blur"
|
||||
magick $used_wallpaper -resize 75% $blurred_wallpaper
|
||||
echo ":: Resized to 75%"
|
||||
if [ ! "$blur" == "0x0" ] ;then
|
||||
magick $blurred_wallpaper -blur $blur $blurred_wallpaper
|
||||
cp $blurred_wallpaper $generated_versions/blur-$blur-$wallpaper_filename.png
|
||||
echo ":: Blurred"
|
||||
fi
|
||||
cp $generated_versions/blur-$blur-$wallpaper_filename.png $blurred_wallpaper
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Create rasi file
|
||||
# -----------------------------------------------------
|
||||
|
||||
if [ ! -f $rasi_file ] ;then
|
||||
touch $rasi_file
|
||||
fi
|
||||
echo "* { current-image: url(\"$blurred_wallpaper\", height); }" > "$rasi_file"
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Created square wallpaper
|
||||
# -----------------------------------------------------
|
||||
|
||||
echo ":: Generate new cached wallpaper square-$wallpaper_filename"
|
||||
magick $tmp_wallpaper -gravity Center -extent 1:1 $square_wallpaper
|
||||
cp $square_wallpaper $generated_versions/square-$wallpaper_filename.png
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
sleep 1
|
||||
|
||||
# kill all possible running xdg-desktop-portals
|
||||
killall -e xdg-desktop-portal-hyprland
|
||||
killall -e xdg-desktop-portal-gnome
|
||||
killall -e xdg-desktop-portal-kde
|
||||
killall -e xdg-desktop-portal-lxqt
|
||||
killall -e xdg-desktop-portal-wlr
|
||||
killall -e xdg-desktop-portal-gtk
|
||||
killall -e xdg-desktop-portal
|
||||
sleep 1
|
||||
|
||||
# start xdg-desktop-portal-hyprland
|
||||
/usr/lib/xdg-desktop-portal-hyprland &
|
||||
sleep 2
|
||||
|
||||
# start xdg-desktop-portal
|
||||
/usr/lib/xdg-desktop-portal &
|
||||
sleep 1
|
||||
Reference in New Issue
Block a user