A modern GTK4/Libadwaita application for fast user switching on Ubuntu and other Linux distributions. Switch between user accounts without logging out, preserving your current session and applications.
🚀 Intelligent Session Switching
- Direct switching to users with active sessions (no password required)
- Preserves your current session and running applications
- Smart detection of existing user sessions using systemd loginctl
👤 Modern User Interface
- Clean GTK4/Libadwaita design following GNOME HIG
- Profile picture support from AccountsService and ~/.face
- User-friendly confirmation dialogs and status messages
⚡ Multiple Switching Methods
loginctl activate- Direct session activation (fastest)dm-tool switch-to-user- LightDM integration- GDM D-Bus interface - Native GNOME support
- Fallback to login screen for new users
🔒 Session Preservation
- Your current session stays active in the background
- All applications continue running
- Return to your work exactly where you left off
git clone https://github.com/ecappa/ubuntuQuickUserSwitcher.git
cd ubuntuQuickUserSwitcher
chmod +x install.sh
./install.sh# Install system dependencies
sudo apt update
sudo apt install -y python3-gi python3-gi-cairo gir1.2-gtk-4.0 libadwaita-1-dev gir1.2-adw-1
# Install Python dependencies
pip3 install -r requirements.txt
# Make executable
chmod +x quick_switch.py
# Create desktop shortcut (optional)
cp quick-switch.desktop ~/.local/share/applications/./quick_switch.pyAfter installation, search for "Quick Switch" in your applications menu.
- Launch the application
- Select a user from the list
- Confirm the switch
- The app will:
- Switch directly to active sessions (instant)
- Open login screen for new users
- Preserve your current session
- OS: Ubuntu 20.04+ (or any Linux with systemd)
- Python: 3.8+
- Desktop: GTK4-compatible environment (GNOME, etc.)
- Display Manager: GDM, LightDM, or compatible
- Uses
loginctl list-sessionsto detect active user sessions - Parses session state, user ID, and session ID
- Intelligently chooses switching method based on session status
- loginctl activate [session-id] - For existing sessions
- dm-tool switch-to-user [username] - LightDM direct switching
- GDM D-Bus interface - Native GNOME switching
- dm-tool switch-to-greeter - Fallback to login screen
Searches for user avatars in:
/var/lib/AccountsService/icons/[username]~/.face~/.face.{jpg,jpeg,png,gif}
- Ensure your display manager supports user switching
- Check that systemd-logind is running:
systemctl status systemd-logind - Verify loginctl works:
loginctl list-sessions
- Make sure the script is executable:
chmod +x quick_switch.py - Check that your user has access to loginctl commands
- Ensure GTK4 and Libadwaita are installed
- Update your system:
sudo apt update && sudo apt upgrade
quick_switch.py- Main applicationrequirements.txt- Python dependenciesinstall.sh- Installation scriptquick-switch.desktop- Desktop entryCLAUDE.md- Development documentation
- Fork the repository
- Create a feature branch
- Make your changes
- Test on Ubuntu/GNOME
- Submit a pull request
This project is open source. Feel free to use, modify, and distribute.
Developed with assistance from Claude Code for modern Ubuntu user switching needs.