All Projects → Ventto → Mons

Ventto / Mons

Licence: mit
POSIX Shell script to quickly manage monitors on X

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Mons

Kanshi
Dynamic display configuration
Stars: ✭ 448 (-1.97%)
Mutual labels:  display, monitor
BetterDummy
Unlock your displays on your Mac! Smooth scaling, HiDPI unlock, XDR/HDR extra brightness upscale, DDC, brightness and dimming, dummy displays, PIP and lots more!
Stars: ✭ 9,601 (+2000.88%)
Mutual labels:  display, screen
Caffeine Ng
☕ Tray bar application able to temporarily inhibits the screensaver and sleep mode.
Stars: ✭ 72 (-84.25%)
Mutual labels:  display, screen
Termite Style
Simple script to change color-schemes and fonts for Termite.
Stars: ✭ 224 (-50.98%)
Mutual labels:  ubuntu, arch-linux
choco-screen-resolution
Sets the screen resolution on Windows virtual machines (VMs)
Stars: ✭ 24 (-94.75%)
Mutual labels:  display, screen
Disablemonitor
Easily disable or enable a monitor on your Mac.
Stars: ✭ 1,221 (+167.18%)
Mutual labels:  screen, monitor
Nocturnal
A Dimness and Night Shift menu bar app for macOS 🌙
Stars: ✭ 199 (-56.46%)
Mutual labels:  display, screen
Anlinux Resources
Image and Script for LinuxOnAndroid App
Stars: ✭ 135 (-70.46%)
Mutual labels:  ubuntu, arch-linux
chrome-extension-aspectratio219
🖥️ Fit the screen properly in fullscreen mode on monitor ultrawide with 21:9 aspect ratio (Netflix, Youtube, PrimeVideo, Crunchyroll)
Stars: ✭ 28 (-93.87%)
Mutual labels:  monitor, display
RS232-Monitor-Database
🔌📺 This is a public database for all the known RS232 commands for professionnal screens, monitors and projectors. Feel free to contribute !
Stars: ✭ 22 (-95.19%)
Mutual labels:  monitor, screen
Howdy
🛡️ Windows Hello™ style facial authentication for Linux
Stars: ✭ 3,237 (+608.32%)
Mutual labels:  ubuntu, arch-linux
Battery Wallpaper
Simple bash script to set wallpaper according to battery percentage with charging animations.
Stars: ✭ 314 (-31.29%)
Mutual labels:  ubuntu, arch-linux
Rpi Pxe Server
setup a Raspberry Pi as an PXE-Server
Stars: ✭ 197 (-56.89%)
Mutual labels:  ubuntu, arch-linux
Monitorian
A Windows desktop tool to adjust the brightness of multiple monitors with ease
Stars: ✭ 559 (+22.32%)
Mutual labels:  display, monitor
Spotcommander
The most intuitive and feature-rich remote control for Spotify for Linux
Stars: ✭ 152 (-66.74%)
Mutual labels:  ubuntu, arch-linux
Lunar
Intelligent adaptive brightness for your external monitors
Stars: ✭ 2,712 (+493.44%)
Mutual labels:  display, monitor
Wslu
A collection of utilities for Windows 10 Linux Subsystems
Stars: ✭ 2,020 (+342.01%)
Mutual labels:  ubuntu, arch-linux
Anlinux Adfree
AnLinux, Ad free version.
Stars: ✭ 127 (-72.21%)
Mutual labels:  ubuntu, arch-linux
lantern
[Android Library] Handling device flash as torch for Android.
Stars: ✭ 81 (-82.28%)
Mutual labels:  display, screen
i3-workscreen
In i3wm compatible manner - dynamically re-configures your (multi)-monitor setup on the fly when you hotplug/unplug display cabel(s)
Stars: ✭ 29 (-93.65%)
Mutual labels:  monitor, display

Mons

License Language (XRandR) Vote for mons Donate

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

Perks

  • [x] No requirement: POSIX-compliant (minimal: xorg-xrandr)
  • [x] Useful: Perfectly fit for laptops, quick and daily use
  • [x] Well known: Laptop mode, projector mode, duplicate, mirror and extend
  • [x] More: Select one or two monitors over several others
  • [x] Extra: Cycle through every mode with only one shortcut
  • [x] Auto: Daemon mode to automatically reset display

Installation

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

Note: --recursive is needed for git submodule

Usage

Without argument, it prints connected monitors list with their names and ids.
Options are exclusive and can be used in conjunction with extra options.

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

Two monitors:
  -o    Primary monitor only.
  -s    Second monitor only.
  -d    Duplicates the primary monitor.
  -m    Mirrors the primary monitor.
  -e <side>
         Extends the primary monitor to the selected side
         [ top | left | right | bottom ].
  -n <side>
         This mode selects the previous ones, one after another. The argument
         sets the side for the extend mode.

More monitors:
  -O <mon>
        Only enables the monitor with a specified id.
  -S <mon1>,<mon2>:<pos>
        Only enables two monitors with specified ids. The specified position
        places the second monitor on the right (R) or at the top (T).

Daemon mode:
  -a    Performs an automatic display if it detects only one monitor.
  -x <script>
        Must be used in conjunction with the -a option. Every time the number
        of connected monitors changes, mons calls the given script with the
        MONS_NUMBER environment variable.

Extra (in-conjunction or alone):
  --dpi <dpi>
        Set the DPI, a strictly positive value within the range [0 ; 27432].
  --primary <mon_name>
        Select a connected monitor as the primary output. Run the script
        without argument to print monitors information, the names are in the
        second column between ids and status. The primary monitor is marked
        by an asterisk.

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

With the -n option, go through every 2-mons mode consecutively:

  1. Primary monitor only
  2. Second monitor only
  3. Extend mode whose the side is set with -n <side>
  4. Mirror
  5. Duplicate

This mode is useful if you want to switch to every mode with only one shortcut.

alt 2-monitors modes

# Now in 'Second monitor mode'
$ mons -n right # -> 'Extend mode'
# Now in 'Extend mode'
$ mons -n right # -> 'Mirror mode'

Three monitors (selection mode)

Displays monitor list:

$ mons
Monitors: 3
Mode: Selection
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

DPI value

You might want to switch mode and set the DPI value. Use the --dpi <dpi> option in conjunction with all others options.

$ mons [OPTIONS] --dpi <dpi>

Primary monitor

You might choose one of your monitors as the main one. You can use the --primary <mon_name> option alone or in conjunction with all others options. <mon_name> refers to the monitor name that appears in the list of connected monitors (ex: LVDS-1 or VGA-1):

$ mons
Monitors: 3
Mode: Primary
0:* LVDS-1   (enabled)
5:  VGA-1

The * character means that the monitor is the primary one:

$ mons --primary VGA-1
Monitors: 3
Mode: Primary
0:  LVDS-1   (enabled)
5:* VGA-1

Daemon mode

This mode is useful for laptops. After unplugging all monitors except the last one, mons's "daemon" mode will reset the display and enable the latter.

Use case: "I connect a monitor to my laptop and I only want to work with that one, so I disable the native one. After a while, I will unplug the additional monitor and I need reset my display to re-activate the native one."

  • Run it as following:
$ nohup mons -a > /dev/null 2>&1 &  (all shells)
$ mons -a &!                        (zsh)
$ mons -a &; disown                 (bash)
  • You can handle N-monitors on your own by using the -x option. mons will export the ${MONS_NUMBER} environment variable and run the given Shell script everytime the number of connected monitors changes:
$ mons -a -x "<path>/generic-handler.sh"

# Use it as configuration profiles:
$ mons -a -x "<path>/home-profile.sh"
$ mons -a -x "<path>/work-profile.sh"
  • Example of script.sh:
#!/bin/sh

case ${MONS_NUMBER} in
    1)
        mons -o
        feh --no-fehbg --bg-fill "${HOME}/wallpapers/a.jpg"
        ;;
    2)
        mons -e top
        feh --no-fehbg --bg-fill "${HOME}/wallpapers/a.jpg" \
                       --bg-fill "${HOME}/wallpapers/b.jpg"
        ;;
    *)
        # Handle it manually
        ;;
esac
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].