Giter Club home page Giter Club logo

x11-window-hider's Introduction

x11-window-hider

Easily hide and show (unmap and map) X11 windows.

I wrote the shell scripts first, using xdotool as my interface with the X server. Later, because I was having a hard time finding C projects that hadn't been done yet, I 'ported' the shell scripts into K&R C.

I recommend binding these programs to keyboard shortcuts, as they operate on whichever window currently has focus.

The Shell Scripts:

These are what you should use if you have xdotool and bash and GNU sed. The hiding script doesn't require any of those but xdotool, but the unhiding script requires bash and GNU sed. You can probably replace those with other tools or options in exotic linuxes/unixes, but I was targeting my personal Debian machine.

C programs:

If you want something that will work on basically any POSIX OS, try the C programs. You only need libxcb's headers and library for them to work.

(Update: 2017: for some reason, the C programs don't work on my 64 bitlaptop with Intel graphics. I'm probably doing something wrong with the X11 protocol or making bad assumptions. It was an early C program I wrote, just to try to do it, so I'm not too concerned with fixing it right now.

The shell scripts still work fine, so I recommend using those. I have no idea exactly why the C programs broke, and I don't have time to mess with them at the moment.)

The C Programs: I chose K&R C because I happened to have a book written in 1989 on C handy. The book is called "Programming in C: Revised Edition" By Stephen Kochan. It covers K&R C for most of the book, and then has an appendix of the then-recent ANSI C standard's differences. I believe I used only K&R C in this program, but I wrote it months ago so I may have forgotten something. Anyway, K&R is what I learned C in.

It should compile on basically any C compiler as long as you have a POSIX system. By replacing the check for a file's existance with access() and the code to find the path of the user's home directory (which uses getpwuid()), you can probably even make this code compile in Windows for use with XMing (a Win32 X11 server). I tried to avoid any external libraries where possible, so it is highly portable.

To compile, run ./compile.sh from the root of the repository.

x11-window-hider's People

Contributors

wyatt8740 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

typedlambda

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.