
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Minimalist package to manage a layout of windows in Python. Currently, only windows is supported, and I've only used this on Windows 10.
I have a lot of monitor space and got tired of rearranging my windows manually. I quickly cobbled together a tool to let me save and restore window arrangements. You are now reading about this tool.
pip install windowlayout
) on Python 3.6 or greaterpython -m windowlayout save
~/.windowlayout.json
to tweak it (see below)python -m windowlayout apply
save
or apply
.By default, layout data is stored in ~/.windowlayout.json
.
The -f
/--layout-file
argument can be used to specify another file.
The layout data has two main sections: programs
, and layouts
.
NOTE: Usually you will have all sorts of vauge background windows you can't identify after running save. You should remove anything from your layout that you don't recognize. Also, if you don't need the title or class fields to distinguish between programs, don't use them.
The "programs"
json object specifies named programs that you may use in layouts.
They have the following fields
command
: The command line string to run to start the program (required)detected_command
: The command line string to look for to find an already running window of this program (if not specified, command
is used)detected_title
: If specified, the window title must match this string when finding an already running instance of the windowdetected_class
: If specified, the window class must match this string when finding an already running instance of the windowsuppress_start
: If true (default is false if unspecified), do not attempt to start the program if a pre-existing window is not foundThe detected_command
field exists because sometimes you need run one command to start a program but the process owning the window doesn't have the same command.
The detected_title
is useful when a process may have multiple windows but only one is the "real" one.
The suppress_start
flag was added because when I start Spotify while this program is running, the Spotify UI freezes and I haven't debugged why.
The "layouts"
json object contains definitions for the available layouts you can apply.
The default layout when no layout is specified is named "default"
.
Each layout is a json object where the property names reference a named program in the "programs"
object.
If you want to have multiple windows with the same program, you need multiple entries in the "programs"
object.
Normally you need this anyway so you can specify command-line arguments for the different windows.
The property value is another json object specifying the left, top, bottom, and right coordinates of the window. These coordinates are in pixels and may be negative depending on the monitor layout. The top / left coordinates are 0, and values increase towards bottom / right.
The simplest way to define a layout is to arrange the windows roughly how you want them and save the layout.
Then prune the list of programs down to what you care about and remove restrictions you don't need (like detected_title
being the empty string).
If you want to create a second layout and have already crafted an initial one, consider using the -f
argument to specify an alternate file.
That way, all the stuff you removed the first time doesn't get added back when it is detected again.
FAQs
Manages a layout of windows
We found that windowlayout demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.