mirror of
https://github.com/gustavosett/Windows-11-Clipboard-History-For-Linux
synced 2026-04-25 17:15:35 +02:00
refactor: multi distro overhaul (#52)
* feat: enhance capabilities and permissions for autostart and global shortcuts * feat: implement desktop environment detection and global shortcut registration * feat: add permission checker module for uinput access verification and configuration * feat: add autostart and global shortcut plugins; integrate permission checker functions * feat: add LXQt and LXDE support for global shortcuts * feat: add permission_checker and shortcut_setup modules to the library * feat: implement SetupWizard for first-run setup and autostart configuration * feat: overhaul install script for improved distribution detection and installation methods * feat: add autostart and global shortcut plugins to dependencies * feat: enhance Makefile with improved installation and cleanup processes * feat: enhance release workflow with version syncing and installation instructions * docs: update contributing guidelines to include required dependencies * docs: update README with Rust version, installation instructions, and new features * feat: improve installation process for uinput module and udev rules * feat: add support for AlmaLinux and improve WebKitGTK compatibility handling * feat: enhance post-removal script to handle multiple module configuration filenames * feat: add XDG_SESSION_CLASS to environment variables in wrapper script * fix: improve error handling for MATE keybinding slots * chore: remove xml formatting * feat: ensure input group exists and add user only on live system during installation * feat: add architecture detection for DEB and RPM packages * fix: correct logic for uinput module configuration in post-installation script * fix: improve error message for missing win11-clipboard-history binary * feat: enhance permission fixing by checking for required commands * fix: improve shortcut registration by ensuring thread completion * style: shortcut registration formatting * feat: add support for CachyOS * feat: enhance distribution detection and installation process * chore: update version to 0.4.0 in package.json, Cargo.toml, and tauri.conf.json * chore: update version to 0.4.0 in package-lock.json * fix: update Cloudsmith repository name to clipboard-manager * feat: add PKGBUILD and installation script for win11-clipboard-history-bin * chore: remove VERSION variable from Makefile * fix: improve error message for binary not found in wrapper script * feat: enhance installation process with Cloudsmith repository support
This commit is contained in:
@@ -1,31 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Wrapper script for win11-clipboard-history
|
||||
# Cleans environment to avoid Snap library conflicts
|
||||
# Wrapper for win11-clipboard-history
|
||||
# Purpose: Clean environment to avoid Snap/Flatpak library conflicts
|
||||
# and force X11/XWayland for window positioning on Wayland
|
||||
|
||||
# Binary location
|
||||
BINARY="/usr/lib/win11-clipboard-history/win11-clipboard-history-bin"
|
||||
set -e
|
||||
|
||||
# Force X11/XWayland for better window positioning support
|
||||
# Wayland restricts cursor_position() and set_position() for security
|
||||
# XWayland allows these operations while still running on Wayland session
|
||||
WEBKIT_DISABLE_COMPOSITING_MODE=1
|
||||
BINARY_LOCATIONS=(
|
||||
"/usr/bin/win11-clipboard-history-bin"
|
||||
"/usr/lib/win11-clipboard-history/win11-clipboard-history-bin"
|
||||
"/usr/local/lib/win11-clipboard-history/win11-clipboard-history-bin"
|
||||
)
|
||||
|
||||
# Always use clean environment to avoid library conflicts from Snap, Flatpak, etc.
|
||||
# Find the binary
|
||||
BINARY=""
|
||||
for loc in "${BINARY_LOCATIONS[@]}"; do
|
||||
if [ -x "$loc" ]; then
|
||||
BINARY="$loc"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Verify binary was found
|
||||
if [ -z "$BINARY" ]; then
|
||||
echo "Error: win11-clipboard-history binary not found." >&2
|
||||
echo "The wrapper searched for an executable in the following locations (in order):" >&2
|
||||
for loc in "${BINARY_LOCATIONS[@]}"; do
|
||||
echo " - $loc" >&2
|
||||
done
|
||||
echo "" >&2
|
||||
echo "If you installed via package manager, try reinstalling the package." >&2
|
||||
echo "If you installed manually with a custom PREFIX, ensure the binary is in one of the locations above." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Execute with clean environment
|
||||
# env -i clears ALL environment variables, then we re-export only what's needed
|
||||
exec env -i \
|
||||
HOME="$HOME" \
|
||||
USER="$USER" \
|
||||
SHELL="$SHELL" \
|
||||
TERM="$TERM" \
|
||||
DISPLAY="${DISPLAY:-:0}" \
|
||||
XAUTHORITY="$XAUTHORITY" \
|
||||
WAYLAND_DISPLAY="$WAYLAND_DISPLAY" \
|
||||
XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
|
||||
XDG_SESSION_TYPE="$XDG_SESSION_TYPE" \
|
||||
XDG_CURRENT_DESKTOP="$XDG_CURRENT_DESKTOP" \
|
||||
XDG_SESSION_CLASS="$XDG_SESSION_CLASS" \
|
||||
DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
|
||||
PATH="/usr/local/bin:/usr/bin:/bin" \
|
||||
LANG="${LANG:-en_US.UTF-8}" \
|
||||
LC_ALL="${LC_ALL:-}" \
|
||||
GDK_BACKEND="x11" \
|
||||
"$BINARY" "$@"
|
||||
HOME="$HOME" \
|
||||
USER="$USER" \
|
||||
SHELL="$SHELL" \
|
||||
TERM="$TERM" \
|
||||
DISPLAY="${DISPLAY:-:0}" \
|
||||
XAUTHORITY="$XAUTHORITY" \
|
||||
WAYLAND_DISPLAY="$WAYLAND_DISPLAY" \
|
||||
XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
|
||||
XDG_SESSION_TYPE="$XDG_SESSION_TYPE" \
|
||||
XDG_SESSION_CLASS="$XDG_SESSION_CLASS" \
|
||||
XDG_CURRENT_DESKTOP="$XDG_CURRENT_DESKTOP" \
|
||||
XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" \
|
||||
DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
|
||||
PATH="/usr/local/bin:/usr/bin:/bin" \
|
||||
LANG="${LANG:-en_US.UTF-8}" \
|
||||
GDK_BACKEND="x11" \
|
||||
GDK_SCALE="${GDK_SCALE:-1}" \
|
||||
GDK_DPI_SCALE="${GDK_DPI_SCALE:-1}" \
|
||||
NO_AT_BRIDGE=1 \
|
||||
"$BINARY" "$@"
|
||||
|
||||
Reference in New Issue
Block a user