You are not logged in.

#1 2021-12-19 23:46:07

GMON
Member
Registered: 2021-12-19
Posts: 14

[solved] Cant run Daemon script with "mons" for Multiple Monitor setup

Im running mons to automatically change my monitor configuration if it detects a new monitor being plugged in. I should be able to start mons in Deamon mode by running this command

 mons -a -x "./home-profile.sh" 

This outputs the following:

/usr/bin/mons: illegal option -- x
Usage: mons [OPTION]...

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).

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.

Daemon mode:
  -a    Performs an automatic display if it detects only one monitor.

home-profile.sh looks like this and is in the same directory:

#!/bin/sh

case ${MONS_NUMBER} in
        1)
                mons -o
                echo "this works"
                ;;
        2)
                mons -e right
                sh ./home-screens.sh
                ;;
        *)
                # Handle it manually
                ;;

esac

Please let me know if you can spot what I'm doing wrong or if you know of any alternatives to mons. Thanks!

Last edited by GMON (2021-12-20 15:23:37)

Offline

#2 2021-12-20 09:26:15

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [solved] Cant run Daemon script with "mons" for Multiple Monitor setup

I'm not familiar with mons, but this seems clear enough:

GMON wrote:

This outputs the following:

/usr/bin/mons: illegal option -- x

If you check on github, that option was added after the last release was tagged. You can try building from git if you really want it.

Offline

#3 2021-12-20 12:32:19

GMON
Member
Registered: 2021-12-19
Posts: 14

Re: [solved] Cant run Daemon script with "mons" for Multiple Monitor setup

Ah what a silly mistake, ill keep that in mind when installing packages in the future. Building manually like this made everything work:

$ git clone --recursive https://github.com/Ventto/mons.git
$ cd mons
$ sudo make install

Thanks!

Offline

#4 2021-12-20 13:09:32

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,081

Re: [solved] Cant run Daemon script with "mons" for Multiple Monitor setup

Now you have files on your system that pacman doesn't track, using https://aur.archlinux.org/packages/mons-git would be a better option to make sure you have logical consistency here.

Offline

#5 2021-12-20 20:27:01

GMON
Member
Registered: 2021-12-19
Posts: 14

Re: [solved] Cant run Daemon script with "mons" for Multiple Monitor setup

Thats odd, having the mons-git package from the aur and simply running it with no arguments gives me this output

/usr/bin/mons: line 86: /home/nici/.cache/yay/mons-git/pkg/mons-git/usr/lib/libshlist/liblist.sh: library not found.: No such file or directory

instead of the expected one:

Monitors: 2
Mode: extend
0:*  eDP-1    (enabled)
1:   DP-1     (enabled)

Most other functions also break for some reason...

Though seeing as the github repo hasnt been updated in years i doubts this will be a big issue. Thank you!

Offline

Board footer

Powered by FluxBB