PyQt6 system tray app for switching between Hybrid and NVIDIA-only GPU modes via lenovolegionlinux (legion_cli). Includes polkit policy for passwordless switching, KDE autostart entry, and install script. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
21 lines
684 B
Bash
21 lines
684 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
POLICY_FILE="com.lenovolegion.gpumodetray.policy"
|
|
POLICY_DST="/usr/share/polkit-1/actions/$POLICY_FILE"
|
|
APP_DST="/usr/local/bin/gpu-mode-tray"
|
|
AUTOSTART_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/autostart"
|
|
DESKTOP_FILE="gpu-mode-tray.desktop"
|
|
|
|
echo "Installing polkit policy -> $POLICY_DST"
|
|
sudo install -m 644 "$POLICY_FILE" "$POLICY_DST"
|
|
|
|
echo "Installing app -> $APP_DST"
|
|
sudo install -m 755 main.py "$APP_DST"
|
|
|
|
echo "Installing autostart entry -> $AUTOSTART_DIR/$DESKTOP_FILE"
|
|
mkdir -p "$AUTOSTART_DIR"
|
|
install -m 644 "$DESKTOP_FILE" "$AUTOSTART_DIR/$DESKTOP_FILE"
|
|
|
|
echo "Done. Run now with: gpu-mode-tray"
|
|
echo "Will autostart on next login."
|