init: copy from Hacmini

This commit is contained in:
2024-09-14 10:42:47 -04:00
commit 1df22c6512
384 changed files with 18925 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import sys
import subprocess
import os
import json
import pathlib
import shutil
# Get script path
pathname = os.path.dirname(sys.argv[0])
homeFolder = os.path.expanduser('~') # Path to home folder
dotfiles = homeFolder + "/dotfiles/"
result = subprocess.run(["bash", dotfiles + "hypr/scripts/monitors.sh"], capture_output=True, text=True)
monitors_json = result.stdout.strip()
monitors_arr = json.loads(monitors_json)
for row in monitors_arr:
if row["focused"]:
print(row["id"])

View File

@@ -0,0 +1,7 @@
#!/bin/bash
# Remove gamemode flag
if [ -f ~/.cache/gamemode ] ;then
rm ~/.cache/gamemode
echo ":: ~/.cache/gamemode removed"
fi

View File

@@ -0,0 +1,52 @@
#!/bin/bash
# ____ _ _
# | _ \(_) __ _ __ _ _ __ ___ ___(_)___
# | | | | |/ _` |/ _` | '_ \ / _ \/ __| / __|
# | |_| | | (_| | (_| | | | | (_) \__ \ \__ \
# |____/|_|\__,_|\__, |_| |_|\___/|___/_|___/
# |___/
#
clear
sleep 0.5
figlet "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 "wal" "python-pywal"
_commandExists "gum" "gum"
_commandExists "wlogout" "wlogout"
_commandExists "swww" "swww"
_commandExists "eww" "eww"
_commandExists "magick" "imagemagick"
_commandExists "figlet" "figlet"
echo
echo "Press return to exit"
read

View File

@@ -0,0 +1,32 @@
#!/bin/bash
clear
cat <<"EOF"
____ _ _ _ ____ __ __
| _ \(_)___ __ _| |__ | | ___| _ \| \/ |
| | | | / __|/ _` | '_ \| |/ _ \ | | | |\/| |
| |_| | \__ \ (_| | |_) | | __/ |_| | | | |
|____/|_|___/\__,_|_.__/|_|\___|____/|_| |_|
EOF
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

11
dotfiles/hypr/scripts/eww.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
# _____ ____ __
# / _ \ \ /\ / /\ \ /\ / /
# | __/\ V V / \ V V /
# \___| \_/\_/ \_/\_/
#
EWW=`which eww`
if [[ ! `pidof eww` ]]; then
${EWW} daemon
sleep 0.5
fi

3
dotfiles/hypr/scripts/exit.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
sleep 0.5
killall -9 Hyprland sleep 2

View File

@@ -0,0 +1,24 @@
#!/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

35
dotfiles/hypr/scripts/gtk.sh Executable file
View File

@@ -0,0 +1,35 @@
#!/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 ~/dotfiles/hypr/conf/cursor.conf ] ;then
# echo "exec-once = hyprctl setcursor $cursor_theme $cursor_size" > ~/dotfiles/hypr/conf/cursor.conf
# hyprctl setcursor $cursor_theme $cursor_size
# fi

View File

@@ -0,0 +1,25 @@
#!/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"}'
else
echo '{"text": "NOT RUNNING", "class": "notactive", "tooltip": "Screen locking deactivated"}'
fi
fi
if [[ "$1" == "toggle" ]]; then
if pgrep -x "$SERVICE" >/dev/null ;then
killall hypridle
else
hypridle
fi
fi

View File

@@ -0,0 +1,52 @@
#!/bin/bash
# _ _ _ _
# | | | |_ _ _ __ _ __ ___| |__ __ _ __| | ___
# | |_| | | | | '_ \| '__/ __| '_ \ / _` |/ _` |/ _ \
# | _ | |_| | |_) | | \__ \ | | | (_| | (_| | __/
# |_| |_|\__, | .__/|_| |___/_| |_|\__,_|\__,_|\___|
# |___/|_|
#
if [[ "$1" == "rofi" ]]; then
# Open rofi to select the Hyprshade filter for toggle
options="$(hyprshade ls)\noff"
# Open rofi
choice=$(echo -e "$options" | rofi -dmenu -replace -config ~/dotfiles/rofi/config-hyprshade.rasi -i -no-show-icons -l 4 -width 30 -p "Hyprshade")
if [ ! -z $choice ] ;then
echo "hyprshade_filter=\"$choice\"" > ~/dotfiles/.settings/hyprshade.sh
dunstify "Changing Hyprshade to $choice" "Toggle shader with SUPER+SHIFT+S"
fi
else
# Toggle Hyprshade based on the selected filter
hyprshade_filter="blue-light-filter"
# Check if hyprshade.sh settings file exists and load
if [ -f ~/dotfiles/.settings/hyprshade.sh ] ;then
source ~/dotfiles/.settings/hyprshade.sh
fi
# Toggle Hyprshade
if [ "$hyprshade_filter" != "off" ] ;then
if [ -z $(hyprshade current) ] ;then
echo ":: hyprshade is not running"
hyprshade on $hyprshade_filter
notify-send "Hyprshade activated" "with $(hyprshade current)"
echo ":: hyprshade started with $(hyprshade current)"
else
notify-send "Hyprshade deactivated"
echo ":: Current hyprshade $(hyprshade current)"
echo ":: Switching hyprshade off"
hyprshade off
fi
else
if [ -z $(hyprshade current) ] ;then
hyprshade off
fi
echo ":: hyprshade turned off"
fi
fi

View File

@@ -0,0 +1,27 @@
#!/bin/bash
# __ ______ _____ _
# \ \ / / _ \ | ____|_ __ __ _(_)_ __ ___
# \ \ /\ / /| |_) | | _| | '_ \ / _` | | '_ \ / _ \
# \ V V / | __/ | |___| | | | (_| | | | | | __/
# \_/\_/ |_| |_____|_| |_|\__, |_|_| |_|\___|
# |___/
#
wallpaper_engine=$(cat $HOME/dotfiles/.settings/wallpaper-engine.sh)
if [ "$wallpaper_engine" == "swww" ] ;then
# swww
echo ":: Using swww"
swww init
swww-daemon --format xrgb
sleep 0.5
~/dotfiles/hypr/scripts/wallpaper.sh init
elif [ "$wallpaper_engine" == "hyprpaper" ] ;then
# hyprpaper
echo ":: Using hyprpaper"
sleep 0.5
~/dotfiles/hypr/scripts/wallpaper.sh init
else
echo ":: Wallpaper Engine disabled"
~/dotfiles/hypr/scripts/wallpaper.sh init
fi

View File

@@ -0,0 +1,49 @@
#!/bin/bash
# _ _ _ _ _
# | | _____ _ _| |__ (_)_ __ __| (_)_ __ __ _ ___
# | |/ / _ \ | | | '_ \| | '_ \ / _` | | '_ \ / _` / __|
# | < __/ |_| | |_) | | | | | (_| | | | | | (_| \__ \
# |_|\_\___|\__, |_.__/|_|_| |_|\__,_|_|_| |_|\__, |___/
# |___/ |___/
# by Stephan Raabe (2023)
# -----------------------------------------------------
# -----------------------------------------------------
# Get keybindings location based on variation
# -----------------------------------------------------
config_file=$(cat ~/dotfiles/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
rofi -dmenu -i -markup -eh 2 -replace -p "Keybinds" -config ~/dotfiles/rofi/config-compact.rasi <<< "$keybinds"

View File

@@ -0,0 +1,2 @@
#!/bin/bash
hyprctl reload

3
dotfiles/hypr/scripts/lock.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
sleep 0.5
hyprlock

View File

@@ -0,0 +1,33 @@
#!/bin/bash
# __ __ _ _ ___ __ _ _
# | \/ | | | || \ \ / / | | __ _ _ _ _ __ ___| |__ ___ _ __
# | |\/| | | | || |\ \ /\ / / | | / _` | | | | '_ \ / __| '_ \ / _ \ '__|
# | | | | |__|__ _\ V V / | |__| (_| | |_| | | | | (__| | | | __/ |
# |_| |_|_____| |_| \_/\_/ |_____\__,_|\__,_|_| |_|\___|_| |_|\___|_|
#
option1="ML4W Dotfiles Settings"
option2="Hyprland Settings"
option3="Change Wallpaper"
option4="Change Waybar Theme"
option5="ML4W Welcome App"
options="$option1\n"
options="$options$option2\n"
options="$options$option3\n"
options="$options$option4\n$option5"
choice=$(echo -e "$options" | rofi -dmenu -replace -config ~/dotfiles/rofi/config-ml4w-launcher.rasi -l 5)
case $choice in
$option1)
$HOME/dotfiles/apps/ML4W_Dotfiles_Settings-x86_64.AppImage ;;
$option2)
$HOME/dotfiles/apps/ML4W_Hyprland_Settings-x86_64.AppImage ;;
$option3)
$HOME/dotfiles/hypr/scripts/wallpaper.sh select ;;
$option4)
$HOME/dotfiles/waybar/themeswitcher.sh ;;
$option5)
$HOME/dotfiles/apps/ML4W_Welcome-x86_64.AppImage ;;
esac

View File

@@ -0,0 +1,14 @@
#!/bin/bash
if [ ! -f $HOME/.cache/ml4w-welcome-autostart ] ;then
echo ":: Autostart of ML4W Welcome App enabled."
if [ -f $HOME/dotfiles/apps/ML4W_Welcome-x86_64.AppImage ] ;then
echo ":: Starting ML4W Welcome App ..."
sleep 2
$HOME/dotfiles/apps/ML4W_Welcome-x86_64.AppImage
else
echo ":: ML4W Welcome App not found."
fi
else
echo ":: Autostart of ML4W Welcome App disabled."
fi

View File

@@ -0,0 +1,2 @@
#!/bin/bash
hyprctl -j monitors

43
dotfiles/hypr/scripts/power.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
# ____
# | _ \ _____ _____ _ __
# | |_) / _ \ \ /\ / / _ \ '__|
# | __/ (_) \ V V / __/ |
# |_| \___/ \_/\_/ \___|_|
#
if [[ "$1" == "exit" ]]; then
echo ":: Exit"
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"
sleep 0.5
systemctl reboot
fi
if [[ "$1" == "shutdown" ]]; then
echo ":: Shutdown"
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

View File

@@ -0,0 +1,3 @@
#!/bin/bash
sleep 0.5
systemctl reboot

View File

@@ -0,0 +1,5 @@
#!/bin/bash
killall hypridle
sleep 1
hypridle &
notify-send "hypridle has been restarted."

View File

@@ -0,0 +1,45 @@
#!/bin/bash
# ____ _ _
# / ___| ___ _ __ ___ ___ _ __ ___| |__ ___ | |_
# \___ \ / __| '__/ _ \/ _ \ '_ \/ __| '_ \ / _ \| __|
# ___) | (__| | | __/ __/ | | \__ \ | | | (_) | |_
# |____/ \___|_| \___|\___|_| |_|___/_| |_|\___/ \__|
#
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
DIR="$HOME/Pictures/screenshots/"
NAME="screenshot_$(date +%d%m%Y_%H%M%S).png"
option2="Selected area"
option3="Fullscreen (delay 3 sec)"
option4="Current display (delay 3 sec)"
options="$option2\n$option3\n$option4"
choice=$(echo -e "$options" | rofi -dmenu -replace -config ~/dotfiles/rofi/config-screenshot.rasi -i -no-show-icons -l 3 -width 30 -p "Take Screenshot")
case $choice in
$option2)
grim -g "$(slurp)" "$DIR$NAME"
xclip -selection clipboard -t image/png -i "$DIR$NAME"
notify-send "Screenshot created and copied to clipboard" "Mode: Selected area"
swappy -f "$DIR$NAME"
;;
$option3)
sleep 3
grim "$DIR$NAME"
xclip -selection clipboard -t image/png -i "$DIR$NAME"
notify-send "Screenshot created and copied to clipboard" "Mode: Fullscreen"
swappy -f "$DIR$NAME"
;;
$option4)
sleep 3
monitor="$(hyprctl monitors | awk '/Monitor/{monitor=$2} /focused: yes/{print monitor; exit}')"
grim -o "$monitor" "$DIR$NAME"
xclip -selection clipboard -t image/png -i "$DIR$NAME"
notify-send "Screenshot created and copied to clipboard" "Mode: Fullscreen"
swappy -f "$DIR$NAME"
;;
esac

View File

@@ -0,0 +1,3 @@
#!/bin/bash
sleep 0.5
systemctl poweroff

View File

@@ -0,0 +1,3 @@
#!/bin/bash
sleep 0.5
systemctl suspend

View File

@@ -0,0 +1,13 @@
#!/bin/bash
cache_file="$HOME/.cache/toggle_animation"
if [[ $(cat $HOME/dotfiles/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

View File

@@ -0,0 +1,11 @@
#!/bin/bash
# _ _ _ __ _ _
# / \ | | |/ _| | ___ __ _| |_
# / _ \ | | | |_| |/ _ \ / _` | __|
# / ___ \| | | _| | (_) | (_| | |_
# /_/ \_\_|_|_| |_|\___/ \__,_|\__|
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
hyprctl dispatch workspaceopt allfloat

View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Open rofi to select the Hyprshade filter for toggle
options="$(ls ~/dotfiles/hypr/effects/wallpaper/)\noff"
# Open rofi
choice=$(echo -e "$options" | rofi -dmenu -replace -config ~/dotfiles/rofi/config-themes.rasi -i -no-show-icons -l 5 -width 30 -p "Hyprshade")
if [ ! -z $choice ] ;then
echo "$choice" > ~/dotfiles/.settings/wallpaper-effect.sh
dunstify "Changing Wallpaper Effect to " "$choice"
~/dotfiles/hypr/scripts/wallpaper.sh init
fi

View File

@@ -0,0 +1,185 @@
#!/bin/bash
# _ _
# __ ____ _| | |_ __ __ _ _ __ ___ _ __
# \ \ /\ / / _` | | | '_ \ / _` | '_ \ / _ \ '__|
# \ V V / (_| | | | |_) | (_| | |_) | __/ |
# \_/\_/ \__,_|_|_| .__/ \__,_| .__/ \___|_|
# |_| |_|
#
# by Stephan Raabe (2024)
# -----------------------------------------------------
# Cache file for holding the current wallpaper
wallpaper_folder="$HOME/wallpaper"
if [ -f ~/dotfiles/.settings/wallpaper-folder.sh ] ;then
source ~/dotfiles/.settings/wallpaper-folder.sh
fi
used_wallpaper="$HOME/.cache/used_wallpaper"
cache_file="$HOME/.cache/current_wallpaper"
blurred="$HOME/.cache/blurred_wallpaper.png"
square="$HOME/.cache/square_wallpaper.png"
rasi_file="$HOME/.cache/current_wallpaper.rasi"
blur_file="$HOME/dotfiles/.settings/blur.sh"
blur="50x30"
blur=$(cat $blur_file)
# Create cache file if not exists
if [ ! -f $cache_file ] ;then
touch $cache_file
echo "$wallpaper_folder/default.jpg" > "$cache_file"
fi
# Create rasi file if not exists
if [ ! -f $rasi_file ] ;then
touch $rasi_file
echo "* { current-image: url(\"$wallpaper_folder/default.jpg\", height); }" > "$rasi_file"
fi
current_wallpaper=$(cat "$cache_file")
case $1 in
# Load wallpaper from .cache of last session
"init")
sleep 1
if [ -f $cache_file ]; then
wal -q -i $current_wallpaper
else
wal -q -i $wallpaper_folder/
fi
;;
# Select wallpaper with rofi
"select")
sleep 0.2
selected=$( find "$wallpaper_folder" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) -exec basename {} \; | sort -R | while read rfile
do
echo -en "$rfile\x00icon\x1f$wallpaper_folder/${rfile}\n"
done | rofi -dmenu -i -replace -config ~/dotfiles/rofi/config-wallpaper.rasi)
if [ ! "$selected" ]; then
echo "No wallpaper selected"
exit
fi
wal -q -i $wallpaper_folder/$selected
;;
# Randomly select wallpaper
*)
wal -q -i $wallpaper_folder/
;;
esac
# -----------------------------------------------------
# Load current pywal color scheme
# -----------------------------------------------------
source "$HOME/.cache/wal/colors.sh"
# -----------------------------------------------------
# get wallpaper image name
# -----------------------------------------------------
newwall=$(echo $wallpaper | sed "s|$wallpaper_folder/||g")
# -----------------------------------------------------
# Reload waybar with new colors
# -----------------------------------------------------
~/dotfiles/waybar/launch.sh
# -----------------------------------------------------
# Set the new wallpaper
# -----------------------------------------------------
transition_type="wipe"
# transition_type="outer"
# transition_type="random"
cp $wallpaper $HOME/.cache/
mv $HOME/.cache/$newwall $used_wallpaper
# Load Wallpaper Effect
if [ -f $HOME/dotfiles/.settings/wallpaper-effect.sh ] ;then
effect=$(cat $HOME/dotfiles/.settings/wallpaper-effect.sh)
if [ ! "$effect" == "off" ] ;then
if [ "$1" == "init" ] ;then
echo ":: Init"
else
dunstify "Using wallpaper effect $effect..." "with image $newwall" -h int:value:10 -h string:x-dunst-stack-tag:wallpaper
fi
source $HOME/dotfiles/hypr/effects/wallpaper/$effect
fi
fi
wallpaper_engine=$(cat $HOME/dotfiles/.settings/wallpaper-engine.sh)
if [ "$wallpaper_engine" == "swww" ] ;then
# swww
echo ":: Using swww"
swww img $used_wallpaper \
--transition-bezier .43,1.19,1,.4 \
--transition-fps=60 \
--transition-type=$transition_type \
--transition-duration=0.7 \
--transition-pos "$( hyprctl cursorpos )"
elif [ "$wallpaper_engine" == "hyprpaper" ] ;then
# hyprpaper
echo ":: Using hyprpaper"
killall hyprpaper
wal_tpl=$(cat $HOME/dotfiles/.settings/hyprpaper.tpl)
output=${wal_tpl//WALLPAPER/$used_wallpaper}
echo "$output" > $HOME/dotfiles/hypr/hyprpaper.conf
hyprpaper &
else
echo ":: Wallpaper Engine disabled"
fi
if [ "$1" == "init" ] ;then
echo ":: Init"
else
sleep 1
dunstify "Changing wallpaper ..." "with image $newwall" -h int:value:25 -h string:x-dunst-stack-tag:wallpaper
fi
# -----------------------------------------------------
# Created blurred wallpaper
# -----------------------------------------------------
if [ "$1" == "init" ] ;then
echo ":: Init"
else
dunstify "Creating blurred version ..." "with image $newwall" -h int:value:50 -h string:x-dunst-stack-tag:wallpaper
fi
magick $used_wallpaper -resize 75% $blurred
echo ":: Resized to 75%"
if [ ! "$blur" == "0x0" ] ;then
magick $blurred -blur $blur $blurred
echo ":: Blurred"
fi
# -----------------------------------------------------
# Created quare wallpaper
# -----------------------------------------------------
if [ "$1" == "init" ] ;then
echo ":: Init"
else
dunstify "Creating square version ..." "with image $newwall" -h int:value:75 -h string:x-dunst-stack-tag:wallpaper
fi
magick $wallpaper -gravity Center -extent 1:1 $square
echo ":: Square version created"
# -----------------------------------------------------
# Write selected wallpaper into .cache files
# -----------------------------------------------------
echo "$wallpaper" > "$cache_file"
echo "* { current-image: url(\"$blurred\", height); }" > "$rasi_file"
# -----------------------------------------------------
# Send notification
# -----------------------------------------------------
if [ "$1" == "init" ] ;then
echo ":: Init"
else
dunstify "Wallpaper procedure complete!" "with image $newwall" -h int:value:100 -h string:x-dunst-stack-tag:wallpaper
fi
echo "DONE!"

27
dotfiles/hypr/scripts/xdg.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/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 xdg-desktop-portal
sleep 1
# start xdg-desktop-portal-hyprland
/usr/libexec/xdg-desktop-portal-hyprland &
sleep 2
# start xdg-desktop-portal
/usr/libexec/xdg-desktop-portal &
sleep 1