You are not logged in.
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
;;
esacPlease 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
I'm not familiar with mons, but this seems clear enough:
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
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 installThanks!
Offline
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
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 directoryinstead 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