mfe5003 / mons

POSIX Shell script to quickly manage 2-monitors display.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mons

License Language (XRandR)

"Mons is a Shell script to quickly manage 2-monitors display using xrandr."

*Edited deamon to also automatically configure the second monitor when detected.

Perks

  • No requirement: POSIX-compliant.
  • Useful: Perfectly fit for laptops, quick and daily use.
  • Well known: Laptop mode, projector mode, duplicate and extend.
  • More: Select, move monitors and switch modes easily.
  • Extra: Deamon mode option to reset display if detects only one monitor.

Installation

  • Package (AUR)
$ pacaur -S mons
  • Manual
$ git clone --recursive https://github.com/mfe5003/mons.git
$ cd mons
$ sudo make install

Note: --recursive is needed for git submodule

Usage

Usage: mons [OPTION]...

Options can not be used in conjunction.
If no argument, prints plugged-in monitor ID list.

Information:
  -h:   Prints this help and exits.
  -v:   Prints version and exits.

Two monitors:
  -o:   Preferred monitor only.
  -s:   Second monitor only.
  -d:   Duplicates.
  -e:   Extends [ top | left | right | bottom ].

More monitors:
  -O:   Enables only the selected monitor.
  -S:   Enables only two monitors [MON1,MON2:P],
        MON1 and MON2 are monitor IDs,
        P takes the value [R] right or [T] top for the MON2's placement.

Daemon mode:
  -m:   Re-establishs the display if it detects only one monitor.

Examples

Two monitors

Displays monitor list:

$ mons
0: LVDS-1   (enabled)
5: VGA-1

You have an enabled one, you want to extends the second one on the right:

$ mons -e right

You want to only display the second one:

$ mons -s

Three monitors

Displays monitor list:

$ mons
0: LVDS-1   (enabled)
1: DP-1     (enabled)
5: VGA-1

You may need to display only the third one:

$ mons -O 5

You may need to display the first and the third one on the right:

$ mons -S 0,5:R

Like above but you want to inverse the placement:

$ mons -S 5,0:R

Daemon mode

Especially for laptops, after unplugging the additional monitors, it might be convenient to reset automatically the display for the remaining one.

Run mons as daemon with nohup:

$ nohup mons -m > /dev/null 2>&1 &

About

POSIX Shell script to quickly manage 2-monitors display.

License:MIT License


Languages

Language:Shell 96.8%Language:Makefile 3.2%