From dcca852a05e7a563a4835dbb2c2f5a66d5a24d67 Mon Sep 17 00:00:00 2001 From: "Gu://em_" Date: Mon, 23 Dec 2024 16:56:15 +0100 Subject: [PATCH] Added the local scripts/binaries directory --- .local/bin/codium-patch.sh | 17 +++++++++++++++++ .local/bin/set-wallpaper | 29 +++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100755 .local/bin/codium-patch.sh create mode 100755 .local/bin/set-wallpaper diff --git a/.local/bin/codium-patch.sh b/.local/bin/codium-patch.sh new file mode 100755 index 0000000..a744225 --- /dev/null +++ b/.local/bin/codium-patch.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +if [ $(whoami) != root ]; then + echo "- Please run this script as root" + echo "sudo $0" + echo + sudo $0 + exit $? +fi + +apps_path=/usr/share/applications + +rm $apps_path/codium.desktop +sed -i "s/Name=VSCodium - Wayland/Name=VSCodium/g" $apps_path/codium-wayland.desktop + +echo "- Done" +exit 0 diff --git a/.local/bin/set-wallpaper b/.local/bin/set-wallpaper new file mode 100755 index 0000000..e0aba77 --- /dev/null +++ b/.local/bin/set-wallpaper @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check if file exists +if [ -e $1 ]; then + + # Variables declaration + wallpaper_config=~/.config/hypr/hyprpaper.conf + wallpaper_path=~/.config/hypr/images/wallpaper # Doesn't contain file extension + file_extension="${1##*.}" + + # Remove old wallpaper + rm $wallpaper_path* + + # Copy file + cp $1 "${wallpaper_path}.${file_extension}" + + # Update config + sed -i "s/wallpaper\.[^[:space:]]*/wallpaper.$file_extension/g" $wallpaper_config # Replace current extension by new extension + + # Reload Hyprpaper + pkill hyprpaper + nohup hyprpaper /dev/null 2>&1 & + + echo "Done" + exit 0 +else + echo "Couldn't find '${1}': No such file or directory" + exit 1 +fi