forked from JaKooLit/Arch-Hyprland
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxdph.sh
executable file
·69 lines (58 loc) · 2.2 KB
/
xdph.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 #
# XDG-Desktop-Portals #
xdg=(
xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
)
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
# Determine the directory where the script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || exit 1
source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"
# Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_xdph.log"
# XDG-DESKTOP-PORTAL-HYPRLAND
for xdgs in "${xdg[@]}"; do
install_package "$xdgs" 2>&1 | tee -a "$LOG"
if [ $? -ne 0 ]; then
echo -e "\e[1A\e[K${ERROR} - $xdph install had failed, please check the install.log"
exit 1
fi
done
printf "\n"
printf "${NOTE} Checking for other XDG-Desktop-Portal-Implementations....\n"
sleep 1
printf "\n"
printf "${NOTE} XDG-desktop-portal-KDE & GNOME (if installed) should be manually disabled or removed! I can't remove it... sorry...\n"
while true; do
read -rp "${CAT} Would you like to try to remove other XDG-Desktop-Portal-Implementations? (y/n) " XDPH1
echo
sleep 1
case $XDPH1 in
[Yy])
# Clean out other portals
printf "${NOTE} Clearing any other xdg-desktop-portal implementations...\n"
# Check if packages are installed and uninstall if present
if pacman -Qs xdg-desktop-portal-wlr > /dev/null ; then
echo "Removing xdg-desktop-portal-wlr..."
sudo pacman -R --noconfirm xdg-desktop-portal-wlr 2>&1 | tee -a "$LOG"
fi
if pacman -Qs xdg-desktop-portal-lxqt > /dev/null ; then
echo "Removing xdg-desktop-portal-lxqt..."
sudo pacman -R --noconfirm xdg-desktop-portal-lxqt 2>&1 | tee -a "$LOG"
fi
break
;;
[Nn])
echo "no other XDG-implementations will be removed." >> "$LOG"
break
;;
*)
echo "Invalid input. Please enter 'y' for yes or 'n' for no."
;;
esac
done
clear