Updating for Plasma

This commit is contained in:
2024-01-21 17:42:05 +00:00
parent c7c78f26b7
commit 32c0d93f45
11 changed files with 142 additions and 81 deletions

View File

@@ -24,10 +24,10 @@ done
if [ -n $exe_name ]; then
basename="${exe_name%.*}"
dest="/opt/$basename"
[ -d $dest ] && doas rm -rf "$dest"
doas mv -f "$dir" "$dest"
doas chmod 755 "$dest"
[ -d $dest ] && sudo rm -rf "$dest"
sudo mv -f "$dir" "$dest"
sudo chmod 755 "$dest"
exe=$(echo "$basename" | tr '[:upper:]' '[:lower:]')
doas ln -fs "$dest/$exe_name" "/usr/bin/$exe"
sudo ln -fs "$dest/$exe_name" "/usr/bin/$exe"
fi

View File

@@ -19,8 +19,26 @@ esac
[ -z "$trueloc" ] && trueloc="$(readlink -f "$bgloc")"
# If pywal is installed, use it.
command -v wal >/dev/null 2>&1 &&
wal -i "$trueloc" -n -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 &&
dwmc xrdb
# command -v wal >/dev/null 2>&1 &&
# wal -i "$trueloc" -n -o "${XDG_CONFIG_HOME:-$HOME/.config}/wal/postrun" >/dev/null 2>&1 &&
# dwmc xrdb
xwallpaper --no-randr --zoom "$bgloc"
parent_dir=$(dirname "$trueloc")
filename=$(basename "$trueloc")
filename_without_extension=${filename%.*}
split_dir="${parent_dir}_split"
left_image="${split_dir}/${filename_without_extension}_left.jpg"
right_image="${split_dir}/${filename_without_extension}_right.jpg"
# Check if left and right images exist
if [ -e "$left_image" ] && [ -e "$right_image" ]; then
kwriteconfig5 --file "$HOME/.config/plasma-org.kde.plasma.desktop-appletsrc" \
--group 'Containments' --group '127' --group 'Wallpaper' --group 'org.kde.image' \
--group 'General' --key 'Image' "$left_image"
kwriteconfig5 --file "$HOME/.config/plasma-org.kde.plasma.desktop-appletsrc" \
--group 'Containments' --group '94' --group 'Wallpaper' --group 'org.kde.image' \
--group 'General' --key 'Image' "$right_image"
fi

View File

@@ -5,7 +5,7 @@ echo "Setting up SSH"
# Extract the login details from enpass
LABS=$(enpasscli -vault="$HOME/Documents/Enpass/Vaults/primary" -sort show "Scarif: Labs" 2>&1)
LABSUN=$(echo "$LABS" | grep -Po "(?<=login: )\w+")
LABSPW=$(echo "$LABS" | grep -Po "(?<=pass : ).+(?=\")")
LABSPW=$(echo "$LABS" | grep -Po "(?<=password: ).+(?=\")")
SSHPATH="$HOME/.ssh/id_ed25519" # The path to the SSH key file
TITLE="$USER@$(cat /etc/hostname)" # The title for the SSH key
@@ -62,14 +62,14 @@ curl -X POST \
HTTP_REPLACE="s/https:\/\/labs\.scarif\.space\//git@labs.scarif.space:/"
for dir in $(ls "$HOME/.local/src"); do
dir="$HOME/.local/src/$dir"
if [ -d $dir ]; then
cd "$dir"
SSH_URL=$(git remote get-url origin | sed "$HTTP_REPLACE")
git remote set-url origin "$SSH_URL"
fi
done
# for dir in $(ls "$HOME/.local/src"); do
# dir="$HOME/.local/src/$dir"
# if [ -d $dir ]; then
# cd "$dir"
# SSH_URL=$(git remote get-url origin | sed "$HTTP_REPLACE")
# git remote set-url origin "$SSH_URL"
# fi
# done
DOTFILES_SSH_URL=$(git --git-dir "$HOME/.config/dotfiles/.git" --work-tree="$HOME" remote get-url origin | sed "$HTTP_REPLACE")
git --git-dir "$HOME/.config/dotfiles/.git" --work-tree="$HOME" remote set-url origin "$DOTFILES_SSH_URL"

29
.local/bin/splitbg Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
input_dir="$1" # Replace with your input directory path
output_dir="$2" # Replace with your output directory path
# Ensure the output directory exists or create it
mkdir -p "$output_dir"
# Loop through all JPEG files in the input directory
for file in "$input_dir"/*.jpg; do
if [ -e "$file" ]; then
filename=$(basename "$file")
filename_without_extension="${filename%.*}"
output_file1="$output_dir/${filename_without_extension}_left.jpg"
output_file2="$output_dir/${filename_without_extension}_right.jpg"
# Get the width of the image
width=$(identify -format "%w" "$file")
# Use ImageMagick to split the image in half
convert "$file" -crop "50%x100%+0+0" "$output_file1"
convert "$file" -crop "50%x100%+$((width / 2))+0" "$output_file2"
echo "Split $filename into $output_file1 and $output_file2"
fi
done
echo "Splitting completed."