Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hezkore/x11-toggle-desktop
Utility for toggling the visibility of your desktop on a Linux machine running an X11-based window system
https://github.com/hezkore/x11-toggle-desktop
Last synced: 20 days ago
JSON representation
Utility for toggling the visibility of your desktop on a Linux machine running an X11-based window system
- Host: GitHub
- URL: https://github.com/hezkore/x11-toggle-desktop
- Owner: Hezkore
- Created: 2024-03-12T21:51:46.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-12T21:51:49.000Z (10 months ago)
- Last Synced: 2024-12-13T11:59:14.586Z (21 days ago)
- Language: C
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# X11 Toggle Desktop Visibility
A very simple C program that allows you to toggle the visibility of your desktop on a Linux machine running an X11-based window system.\
Should work on all desktop environments, but tested only on XFCE.## What does the code do?
The code uses the X11 library to interact with the X server and send a client message event to toggle the visibility of the desktop. It first opens a connection to the X server and gets the root window. It then retrieves the current state of the desktop visibility using the `_NET_SHOWING_DESKTOP` atom. Finally, it sends a client message event to the X server to toggle the visibility of the desktop.
## What is it good for?
* You can bind it to a keyboard shortcut.
* You can use it in a launcher application.
* You can use it in your own program to toggle the desktop visibility.
* You can use it as a desktop widget or action to toggle the desktop visibility.Or just as a starting point for your own X11 program.
## Prerequisites
* libx11-dev
## How to build
```bash
gcc -o toggle_desktop toggle_desktop.c -lX11
```
Test it with:
```bash
./toggle_desktop; sleep 1; ./toggle_desktop
```