Discussion:
[xmonad] How to use PhysicalScreens?
Robert Sawko
2018-08-29 07:04:57 UTC
Permalink
Hi,

I just got myself a second screen which I daisy-chained with the first one, but
I am having issues with getting screens to be identified properly. I use xrandr
to configure display. The screens are identified as:

$ xrandr

DP-1-1-8 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
2560x1440 59.95*+
...
DP-1-1-1-8 connected 2560x1440+2560+0 (normal left inverted right x axis y axis) 597mm x 336mm
2560x1440 59.95*+
...
DP-1-1-1-1 disconnected (normal left inverted right x axis y axis)

And I set the screen with:

xrandr \
--output DP-1-1-1-8 --mode 2560x1440 --right-of DP-1-1-8 \
--output DP-1-1-8 --mode 2560x1440 \
--output eDP-1-1 --off

I am reading in here that using Actions.Physical screens involves importing and
changing the mapping(?).

https://hackage.haskell.org/package/xmonad-contrib-0.14/docs/XMonad-Actions-PhysicalScreens.html

If I include only the import then nothing changes. The mappings don't compile
for me. I am attaching the error below. Not sure, if I am doing something wrong
or if the docs are incomplete. What is "W" meant to be?

Best wishes,
Robert


Error detected while loading xmonad configuration file: /home/rsa/.xmonad/xmonad.hs

xmonad.hs:171:49: error:
Not in scope: ‘W.view’
No module named ‘W’ is imported.
|
171 | , ((modMask, xK_a), onPrevNeighbour def W.view)
| ^^^^^^

xmonad.hs:172:49: error:
Not in scope: ‘W.view’
No module named ‘W’ is imported.
|
172 | , ((modMask, xK_o), onNextNeighbour def W.view)
| ^^^^^^

xmonad.hs:173:63: error:
Not in scope: ‘W.shift’
No module named ‘W’ is imported.
|
173 | , ((modMask .|. shiftMask, xK_a), onPrevNeighbour def W.shift)
| ^^^^^^^

xmonad.hs:174:63: error:
Not in scope: ‘W.shift’
No module named ‘W’ is imported.
|
174 | , ((modMask .|. shiftMask, xK_o), onNextNeighbour def W.shift)
| ^^^^^^^
--
Blood moon rising!
http://time.com/3479189/blood-moon/
Brandon Allbery
2018-08-29 13:16:42 UTC
Permalink
W comes from "import qualified XMonad.StackSet as W" which needs to go up
with the other imports.
Post by Robert Sawko
Hi,
I just got myself a second screen which I daisy-chained with the first one, but
I am having issues with getting screens to be identified properly. I use xrandr
$ xrandr
DP-1-1-8 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 597mm x 336mm
2560x1440 59.95*+
...
DP-1-1-1-8 connected 2560x1440+2560+0 (normal left inverted right x axis y
axis) 597mm x 336mm
2560x1440 59.95*+
...
DP-1-1-1-1 disconnected (normal left inverted right x axis y axis)
xrandr \
--output DP-1-1-1-8 --mode 2560x1440 --right-of DP-1-1-8 \
--output DP-1-1-8 --mode 2560x1440 \
--output eDP-1-1 --off
I am reading in here that using Actions.Physical screens involves importing and
changing the mapping(?).
https://hackage.haskell.org/package/xmonad-contrib-0.14/docs/XMonad-Actions-PhysicalScreens.html
If I include only the import then nothing changes. The mappings don't compile
for me. I am attaching the error below. Not sure, if I am doing something wrong
or if the docs are incomplete. What is "W" meant to be?
Best wishes,
Robert
/home/rsa/.xmonad/xmonad.hs
Not in scope: ‘W.view’
No module named ‘W’ is imported.
|
171 | , ((modMask, xK_a), onPrevNeighbour def W.view)
| ^^^^^^
Not in scope: ‘W.view’
No module named ‘W’ is imported.
|
172 | , ((modMask, xK_o), onNextNeighbour def W.view)
| ^^^^^^
Not in scope: ‘W.shift’
No module named ‘W’ is imported.
|
173 | , ((modMask .|. shiftMask, xK_a), onPrevNeighbour def W.shift)
| ^^^^^^^
Not in scope: ‘W.shift’
No module named ‘W’ is imported.
|
174 | , ((modMask .|. shiftMask, xK_o), onNextNeighbour def W.shift)
| ^^^^^^^
--
Blood moon rising!
http://time.com/3479189/blood-moon/
_______________________________________________
xmonad mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
--
brandon s allbery kf8nh
***@gmail.com
Robert Sawko
2018-08-29 13:43:54 UTC
Permalink
Brandon,

Thanks for the reply. I actually did come across it before and tried it out!
But... I wasn't sure if the context was right and I was getting errors. I have
now retried adding the import qualified... and I found out that the modMask
from the doc had to be changed to mod4Mask in my case? Previously Xmonad was
compiling that modMask had too few arguments.

Thanks,
Robert
--
I am really afraid of the power of authority
http://en.wikipedia.org/wiki/Milgram_experiment
Brandon Allbery
2018-08-29 13:43:35 UTC
Permalink
modMask is usually a projection function that takes an XConfig record and
produces the modMask field from it. Some key mapping functions define it
locally, which is a bit confusing because then it's a simple value instead
of a function.

PhysicalScreens is the most difficult way to deal with screen ordering;
usually it makes more sense to simply swap the mod-{w,e,r} bindings around.
Post by Robert Sawko
Brandon,
Thanks for the reply. I actually did come across it before and tried it out!
But... I wasn't sure if the context was right and I was getting errors. I have
now retried adding the import qualified... and I found out that the modMask
from the doc had to be changed to mod4Mask in my case? Previously Xmonad was
compiling that modMask had too few arguments.
Thanks,
Robert
--
I am really afraid of the power of authority
http://en.wikipedia.org/wiki/Milgram_experiment
--
brandon s allbery kf8nh
***@gmail.com
Loading...