Set opacity and always on top for any X11 window
ghost-m is a lightweight command-line tool that lets you make any window transparent and/or always on top by just clicking on them! Made for Muffin but works for any X11-based desktop
- Set any window to any opacity level (0-100%)
- Set "always on top" for any window
- Save and load window presets
- Select windows by mouse-click, title, or class
- Linux with X11
wmctrl,xdotool,xprop
Install dependencies
sudo apt install wmctrl xdotool x11-utils
-
Download ghost-m script
- click on the ghost-m script and go to the right of where it says raw then click download raw file
-
Move it to ~/.local/bin/
- if you don't see .local right click in /home and show hidden files
-
Make the script executable
-
Open a terminal by going to menu and searching terminal
-
Type and hit enter
chmod +x ~/.local/bin/ghost-m -
Then type
ghost-mto bring up help menu
Type in terminal: ghost-m COMMAND [arguments]
-
| Command | Description |
|---|---|
ghost-m opacity <0-100> --click/--title <name>/--class <name> |
Set opacity for window by click, title, or class |
ghost-m ontop --click/--title <name>/--class <name> |
Set always on top for window |
ghost-m clear --click/--title <name>/--class <name> |
Reset window to 100% opacity and ontop off |
ghost-m preset save <name> --click/--title <name>/--class <name> |
Save preset for window |
ghost-m preset load <name> |
Loads preset for specific window (window must be open) |
ghost-m preset list |
Lists saved presets |
ghost-m help |
Shows help menu |
Examples
Set opacity to 50% by clicking on window
ghost-m opacity 50 --click
Set opacity to 70% for window titled "chat:"
ghost-m opacity 70 --title "Chat:"
Set window class to always on top
ghost-m ontop --class "firefox"
Reset window to 100% opacity and ontop off
ghost-m clear --click
Save window opacity and/or on top status as a preset
ghost-m preset save mychat --click
Load saved preset for opened window
ghost-m preset load mychat
Presets are saved to ~/.config/ghost-m/presets/
Some applications (certain games or hardware-accelerated windows) ignore opacity requests.
Delete ghost-m from ~/.local/bin
Delete ~/.config/ghost-m
When setting always on top and then starting a full-screen application mouse input will be locked between them;this is a known muffin bug when using Linux Cinnamon. To correct alt + tab into fullscreen app and always on top window or start fullscreen application first and then set always on top window.
--title and --class may fail to find correct window. Listing window titles and classes will help but still may fail with certain windows. Fallback to --click command and click on specific window