Note: This version works on KDE Plasma 5. If you're using KDE Plasma 6, see the newer version here.
Installation
This script depends on a helper program to actually launch the terminal app via D-Bus when it's not already running, because there is no API for KWin scripts to start programs directly. Without it this script can toggle your terminal when its already running but not start a new instance of it.
Install dbus-app-launcher to enable starting new instances of your terminal app.
Configuration
After installation the script can be found in System Settings > Window Management > KWin Scripts.
Enable it, and optionally change the configuration to your own terminal. By default this script starts foot.
You can configure the hotkey by going to System Settings > Shortcuts and searching for the "Toggle Terminal" action in the KWin category. Configure any custom shortcut you like.
Note: KWin doesn't always correctly detect changes to the configuration. If your changes are not applied, either log out and in again to restart KWin or run:
qdbus org.kde.KWin /KWin reconfigure
Usage
Press the configured hotkey to summon or hide your terminal.
A few recommendations to make it more seamless:
- Use an easy to access hotkey. I personally use Meta+` since it's similar to what I'm used to from most Quake-style terminals.
- Set up Window Rules to exclude the terminal window from the taskbar, pager and switcher.
- Configure your terminal to run in full-screen mode. For foot this can be done by adding this option to ~/.config/foot/foot.ini:
initial-window-mode=fullscreen
Troubleshooting
- If your terminal is not starting, check that the dbus-app-launcher service is working:
qdbus nl.dvdgiessen.dbusapplauncher /nl/dvdgiessen/DBusAppLauncher nl.dvdgiessen.dbusapplauncher.Exec.Cmd /usr/bin/foot
- If your terminal does not minimize and maximize, check that the window name prefix and suffix are correctly configured.
License and contributing
kwin-toggleterminal is free software licensed under the GPLv3.
If you have fixed a bug or want to contribute a feature, feel free to open a pull request on GitHub.
Ratings & Comments
0 Comments