Coding is a personal script used to launch instances of gnome-terminal in pre-defined sizes and display positions.
Coding is combined with the Gnome 3 method of launching apps via the 'Super' key and .desktop configuration files to call coding.
When properly deployed, a user can tap the Super key, type a keyword such as 'west' and coding will follow a 'west' rule in a configuration file to launch a gnome-terminal instance of 80x25 in the lower left part of a multi-monitor display.
Using this combination of Gnome 3 and coding, the user can quickly launch windows and avoid mouse interactions.
-
Allows the user to quickly launch a terminal of a specific size and position which should also receive keyboard focus in order to let the user start typing commands.
-
Named positions should work consistently across different display configurations if the rules are setup correctly.
- This lets a user type 'right' (for example) to have a terminal instance in the right side of their screen regardless of whether they are on a single low resolution laptop display, a single high resolution monitor display or some combination of two or more monitors.
These are the keywords I currently use based on professional work requiring a lot of simultaneously open terminal windows:
'left', 'mid' and 'right' launch taller than normal displays on my primary display. I often code in multiple windows with 'vim' using these terminals.
'west', 'center' and 'east' launch standard (80x24) terminals in the lower portion of my primary display. I issue commands to take actions and work with remote systems in these instances.
'test' and 'far' launch very tall terminals on the auxillary monitor to the right of my main display. I view log files and debug program output on these instances.
'sideleft' and 'sideright' launch standard size instances in the lower portion of my portrait-orientation auxillary display. This lets me use some additional screen space for odd jobs or monitoring remote work.
This script uses the gnome-terminal parameter '--geometry' to specify a terminal size in rows and columns as well as an X, Y position where the terminal should appear on the desktop.
Launching a terminal of a specific size is available in the X-Windows and Wayland display servers, but gnome-terminal has lost the ability to position windows in Wayland.
I continue to run my Linux systems in X-Windows in order to keep the ability to position windows with 'coding'.
The following components must be deployed for all of this to work:
-
The coding script, usually at /usr/local/bin/coding
-
A configuration file with rules in the user's home directory at $HOME/.coding.conf
-
Gnome .desktop files that allow the user to press the Super key, type the name of a launcher (such as right, left, east, west) and have the launcher call 'coding' with the named position as a parameter
This installation method should work:
- Clone this git repo
- Install the components provided
sudo ./coding-install.sh
- Copy 'coding.conf' to $HOME/.coding.conf and edit rules
- Try it! At a terminal, type 'coding right' and see if it launches. Try additional named positiones and adjust the rule file as needed.
The configuration file defines a 'monitor-config' associated with the X/Y resolution of each physical display configuration you use.
# Home office, two Dell 24" monitors, one landscape, one portrait`
`monitor-config: display-home-office: "3120x1920"
# When no exact H x V resolution is found, the system will look for a
# special type rule to match on horizontal resolution Only
monitor-config: display-home-office: "4320x9999"
You can find this resolution with the command line tool 'xrandr':
xrandr | grep 'Screen 0'
Screen 0: minimum 320 x 200, current 3120 x 1920, maximum 16384 x 16384
Each monitor config can have any number of named size and position rules:
# Home office uses a primary 1920x1200 monitor in landscape and a 1920x1200
# monitor in portrait mode to the right.
# 2019-12-22 tested
display-home-office: "right" "--geometry 85x37+1139+27"
display-home-office: "mid" "--geometry 85x37+358+27"
display-home-office: "left" "--geometry 85x37+0+27"
display-home-office: "east" "--geometry 85x24+1184+1102"
display-home-office: "center" "--geometry 85x24+358+1102"
display-home-office: "west" "--geometry 85x24+0+935"
display-home-office: "test" "--geometry 85x72+1921+0"
display-home-office: "far" "--geometry 85x72+2700+0"
display-home-office: "sideleft" "--geometry 85x24+1920+893"
display-home-office: "sideright" "--geometry 85x24+2700+893"
display-home-office: "bastionprod" "--geometry 85x7+0+1024"
display-home-office: "bastionstaging" "--geometry 85x7+0+1200"
Typing 'center' in a home office will identify the 'display-home-office' monitor-config and use only rules associated with that monitor config.
My normal process to adjust positioning rules is to manually size and position a terminal, then use the 'xwininfo' command line program to reveal the details of its size and position. I'd then drop the row x column size and X, Y position information into a rule and use 'coding' to launch that terminal.
Recently I've found 'xwininfo' values to conflict with what I actually see on screen. It's reporting the absolute Y position of a window as being on display row 1226 although my physical mointor only has 1200 rows of pixels.
So I use 'xwininfo' as a guide and experiment with values until they perform the right positioning action.