-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
frostwong
committed
Dec 5, 2024
1 parent
2d2c3b0
commit 44f84f4
Showing
2 changed files
with
35 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,27 +30,31 @@ else | |
exit 1 | ||
fi | ||
|
||
# Download latest release from GitHub | ||
wget https://github.com/xremap/xremap/releases/latest/download/$ARCHIVE_NAME | ||
|
||
# Extract the archive | ||
echo "INFO: Extracting the archive..." | ||
if ! command -v unzip &> /dev/null; then | ||
echo "ERROR: Command \"unzip\" not found." | ||
exit 0 | ||
fi | ||
unzip -o ./xremap-linux-${ARCH}-*.zip | ||
|
||
# Remove old binary (if any) | ||
if command -v gnome-terminal &> /dev/null ; then | ||
echo "INFO: Removing old binary..." | ||
sudo rm -rf /usr/local/bin/xremap | ||
if which xremap > /dev/null 2>&1; then | ||
echo "INFO: xremap is already installed. Skipping... | ||
else | ||
# Download latest release from GitHub | ||
wget https://github.com/xremap/xremap/releases/latest/download/$ARCHIVE_NAME | ||
# Extract the archive | ||
echo "INFO: Extracting the archive..." | ||
if ! command -v unzip &> /dev/null; then | ||
echo "ERROR: Command \"unzip\" not found." | ||
exit 0 | ||
fi | ||
unzip -o ./xremap-linux-${ARCH}-*.zip | ||
# Remove old binary (if any) | ||
if command -v gnome-terminal &> /dev/null ; then | ||
echo "INFO: Removing old binary..." | ||
sudo rm -rf /usr/local/bin/xremap | ||
fi | ||
# Install new binary (if any) | ||
echo "INFO: Installing the binary..." | ||
sudo cp ./xremap /usr/local/bin | ||
fi | ||
# Install new binary (if any) | ||
echo "INFO: Installing the binary..." | ||
sudo cp ./xremap /usr/local/bin | ||
|
||
# Tweaking server access control for X11 | ||
# https://github.com/k0kubun/xremap#x11 | ||
if [ "${XDG_SESSION_TYPE}" == "x11" ]; then | ||
|
@@ -156,12 +160,18 @@ gsettings set org.gnome.settings-daemon.plugins.media-keys screensaver "[]" | |
# Download and enable Xremap GNOME extension (for Wayland only) | ||
systemctl --user status gnome-macos-remap | ||
if [ "${XDG_SESSION_TYPE}" == "wayland" ]; then | ||
RED=`tput setaf 1` | ||
RESET=`tput sgr0` | ||
echo "INFO: ${RED}Action Required${RESET}. Install the xremap extension and restart your PC." | ||
echo " https://extensions.gnome.org/extension/5060/xremap/" | ||
# Check if xremap extension is enabled | ||
if gnome-extensions list | grep -q "[email protected]"; then | ||
echo "INFO: The xremap extension is already enabled." | ||
else | ||
RED=`tput setaf 1` | ||
RESET=`tput sgr0` | ||
echo "INFO: ${RED}Action Required${RESET}. Install the xremap extension and restart your PC." | ||
echo " https://extensions.gnome.org/extension/5060/xremap/" | ||
fi | ||
else | ||
gnome-extensions disable [email protected] | ||
echo "INFO: Please restart your computer." | ||
fi | ||
fi |