Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,45 @@ Use the KDE autostart option in the installer (or set it manually) to reapply yo



## Graphical Interface (vrgb-gui)

A PyQt6 desktop frontend is included. It is a thin GUI over the CLI: it imports
`vrgb` as a module and drives the keyboard in-process, so the HID protocol and
config logic are shared with the command line — no duplicated device code.

**Features**

- HS color wheel + value slider, hex entry, and preset swatches
- Live preview while you drag (throttled), persisted on release
- Unified brightness slider (0–100%) that is **tied to the FN+F4 / FN+F3 keys**: it
decomposes brightness into the firmware backlight step (`asus::kbd_backlight`, set
via logind) and vrgb's HID intensity so the two layers never double-dim, and it
polls the firmware level so the hardware keys move the slider too. Falls back to
pure-HID brightness if the LED node / logind is unavailable.
- A power on/off toggle
- Firmware/autonomous mode toggle
- OEM rainbow toggle (auto-disabled on device mappings that do not support it)
- Profile manager (save / load / delete)
- "Start at login" toggles (restore lighting / start tray) managed from inside the app
- System-tray applet: on/off, a Brightness submenu (discrete steps, current one
ticked), a Color submenu (preset swatches + a "More colors…" dialog), and profile
loading; closing the window hides it to the tray. (The tray uses submenus rather
than embedded widgets because KDE renders tray menus over DBusMenu, which does not
support embedded slider/widget items.)
- Falls back to a Polkit (`pkexec`) password prompt if the `vrgb` group is not yet
active in your session (i.e. before the first logout/login after install)

**Install (after `./install.sh`)**

chmod +x install-gui.sh
./install-gui.sh

Requires `PyQt6` (`sudo dnf install python3-pyqt6` on Fedora). Launch it from your
application menu (search "VRGB") or run `vrgb-gui`. Start the tray on login with
the installer's autostart option, or run `vrgb-gui --tray`.



## Command List

Show Current Status
Expand Down Expand Up @@ -297,9 +336,10 @@ Removes:
## Future Development

- expanded ASUS hardware compatibility
- simple GUI frontend
- color picker / brightness control
- profile management
- ~~simple GUI frontend~~ — added (`vrgb-gui`, PyQt6)
- ~~color picker / brightness control~~ — added
- ~~profile management~~ — added (CLI + GUI)
- packaged distribution (RPM / Flatpak)

With future updates in mind, this project will aim to continue to be as efficient and lightweight as possible.

Expand Down
67 changes: 67 additions & 0 deletions install-gui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash

set -e

# Run from the script's own directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"

echo "VRGB GUI Installer"
echo "------------------"

# 1. Require the vrgb CLI (the GUI imports it as a module + uses it for pkexec)
if [ ! -x /usr/local/bin/vrgb ]; then
echo "The 'vrgb' CLI is not installed at /usr/local/bin/vrgb."
echo "Run ./install.sh first, then re-run this script."
exit 1
fi

# 2. Check PyQt6
if ! python3 -c "import PyQt6.QtWidgets" 2>/dev/null; then
echo "PyQt6 is missing. Install it with one of:"
echo " sudo dnf install python3-pyqt6 # Fedora"
echo " pip install --user PyQt6"
exit 1
fi

echo "[1/4] Installing GUI to /usr/local/bin/vrgb-gui ..."
sudo install -m 755 vrgb-gui.py /usr/local/bin/vrgb-gui

echo "[2/4] Installing icon ..."
if [ -f assets/vrgblogodark.png ]; then
sudo install -m 644 assets/vrgblogodark.png /usr/share/pixmaps/vrgb.png
# Also drop into the hicolor theme so menus/tray resolve "vrgb"
sudo install -d /usr/share/icons/hicolor/256x256/apps
sudo install -m 644 assets/vrgblogodark.png /usr/share/icons/hicolor/256x256/apps/vrgb.png
fi

echo "[3/4] Installing desktop launcher ..."
sudo install -m 644 vrgb-gui.desktop /usr/share/applications/vrgb-gui.desktop
sudo update-desktop-database /usr/share/applications 2>/dev/null || true
sudo gtk-update-icon-cache -f /usr/share/icons/hicolor 2>/dev/null || true

echo "[4/4] Optional: start the GUI (tray) automatically on login"
read -p "Add login autostart for the tray? (y/n): " AUTOSTART
if [[ "$AUTOSTART" == "y" || "$AUTOSTART" == "Y" ]]; then
mkdir -p ~/.config/autostart
cat > ~/.config/autostart/vrgb-gui.desktop <<EOF
[Desktop Entry]
Type=Application
Name=VRGB (tray)
Comment=Keyboard RGB control tray applet
Exec=/usr/local/bin/vrgb-gui --tray
Icon=vrgb
Terminal=false
X-GNOME-Autostart-enabled=true
EOF
echo "Autostart (tray) installed."
fi

echo
echo "GUI installation complete."
echo "Launch it from your app menu (search 'VRGB') or run: vrgb-gui"
echo
echo "NOTE: For non-root keyboard access, you must be in the 'vrgb' group."
echo "If you just ran ./install.sh, log out and back in once so the group"
echo "becomes active. Until then the GUI falls back to a Polkit password"
echo "prompt (pkexec) when it writes to the keyboard."
11 changes: 11 additions & 0 deletions vrgb-gui.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Name=VRGB
GenericName=Keyboard RGB Control
Comment=Control your ASUS Vivobook RGB keyboard
Exec=/usr/local/bin/vrgb-gui
Icon=vrgb
Terminal=false
Categories=Utility;Settings;HardwareSettings;
Keywords=rgb;keyboard;led;backlight;asus;vivobook;color;
StartupNotify=true
Loading