Comments (5)
from mons.
Hi @AdamSLevy,
Thanks for the feedback and future contributions perhaps.
set the display to some pre configured state, from either ... just by remembering how the user had it set previously.
It seems to be linked with #20. Initially, @pkhamutou had set his two monitors via a specific xrandr command but after running mons, he got an unexpected display. Indeed, mons turns off monitors and resets display in certain cases with xrandr --auto
that definitely breaks the previous very-specific settings (but of course, not the simplest ones).
Right. I've been investigating for few days on xrandr options but none have turned up yet.
from either a configuration file
Priority: keeping mons as simplest as possible.
Assigning a rc file to mons sounds like a risky bet.
Leveraging the Xorg /etc/X11/xorg.conf.d/*.conf
configuration files or X11 existing features as post-detection hook could help.
To be honest, I feel like let's make out the tip of the iceberg to finally decide.
from mons.
how do you feel about parsing the -e option along with the -a option.
EDIT: Why not ?
Adding an option in conjunction with -a
that will be triggered after plugging-in a monitor:
# mons -a [OPTION]
$ mons -a -e left
$ mons -a -d
$ mons -a -S 0,2:R
[and so on...]
from mons.
I'm just commenting to share a script that I wrote to solve this issue for my specific use case. I have a udev rule that detects changes to my specific monitor and then calls this script. When two displays are detected, and it is not already in extend mode, it extends the display and moves all of my i3 windows over to the new display.
I doubt much of this will be useful to you for use in mons but it might give others who come here searching for a solution an idea of how they can solve it themselves. Thanks again for your awesome minimalist software! I am using mons, xpub, batify, and pug!
My script, called by my udev rule on display change:
#!/bin/bash
logfile="/tmp/setup-display"
if [[ -f "$logfile" ]]; then
cat $logfile | tail -n10 > $logfile.tmp
mv $logfile.tmp $logfile
fi
exec >> $logfile
exec 2>&1
sleep 3
mons_out=$(mons)
num_monitors=$(echo "$mons_out" | grep "Monitors" | awk '{print $2}')
mons_mode=$(echo "$mons_out" | grep "Mode" | awk '{print $2}')
edp=$(echo "$mons_out" | grep "eDP" | awk '{print $2}')
hdmi=$(echo "$mons_out" | grep "HDMI" | awk '{print $2}')
echo
date
echo "$mons_out"
if [[ $num_monitors -eq 2 ]]; then
echo "Two displays."
if [[ "$mons_mode" == "extend" ]]; then
echo "Already extended."
exit 0
fi
echo "Extending..."
mons -e left
while [[ "$ret" != '[{"success":true}]' ]]; do
echo "Moving workspaces to output $hdmi..."
ret=$(i3-msg "[class=\".*\"] move workspace to output $hdmi" | grep '"success"')
sleep .25
done
else
echo "One display."
mons -o
fi
from mons.
Thanks @AdamSLevy for contribution.
I've just read your answer. I'll handle it soon.
from mons.
Related Issues (20)
- Feature Request: Flag to trigger optional rotation HOT 2
- Bug: mons -s works only one time HOT 5
- mons -a; problem going from 4:3 external to 16:9 internal HOT 3
- Unable to install mons HOT 3
- Add mons to the FreeBSD ports HOT 4
- Tagging recent commits
- Please provide examples in --help and README.md HOT 2
- Feature Request: --verbose mode to print all xrandr calls executed, and --dry-run to print but not call
- Feature Request: Ability to supply scale setting for a given monitor
- Mirroring makes primary montior blank
- Feature Request: set refresh rate
- Makefile installs an empty manpage if help2man isn't present
- Daemon mode doesn't work on Ubuntu with dash as /bin/sh
- Is it possible to use 2 monitors in extended mode with a third monitor mirroring one of them?
- Ignore intel VIRTUAL[1-9] outputs HOT 1
- AUR packages outdated / broken HOT 1
- PKGBUILD Arch Linux mons-git "broken"
- Daemon mode fails due to non-existing "/sys/class/drm/*/status"
- ./mons.sh: line 86: fg: no job control HOT 1
- RAM usage goes up when switching i3 workspaces in secondary monitor only mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mons.