From yuriy.halytskyy at gmail.com Mon Jun 6 05:14:14 2016 From: yuriy.halytskyy at gmail.com (Yuriy Halytskyy) Date: Mon, 6 Jun 2016 17:14:14 +1200 Subject: [xmonad] Xmonad and multiple screens Message-ID: I am trying to use xmonad on a laptop connected to two monitors, via VGA and HDMI outputs. Laptop screen is disabled and both external monitors configured using xrandr: xrandr --output LVDS1 --off xrandr --output HDMI-0 --right-of VGA1 xrandr --output VGA1 --right-of LVDS1 But mod+{w,e,r} does not work and the only way to have windows on one of my screens is to move floating window. Xinerama shows only right monitor: ghc -e "Graphics.X11.openDisplay [] >>= Graphics.X11.Xinerama.getScreenInfo" [Rectangle {rect_x = 1920, rect_y = 0, rect_width = 1920, rect_height = 1200}] Is it possible to somehow overwrite getScreenInfo for xmonad or configure Xinerama propertly? nvidia-setting can only see one screen and one display. xrandr output shows one huge 3840 x 1200 display and all screens: Screen 0: minimum 8 x 8, current 3840 x 1200, maximum 16384 x 16384 LVDS-0 disconnected primary (normal left inverted right x axis y axis) DP-0 disconnected (normal left inverted right x axis y axis) DP-1 disconnected (normal left inverted right x axis y axis) HDMI-0 connected 1920x1200+1920+0 (normal left inverted right x axis y axis) 518mm x 324mm 1920x1200 60.0*+ 1920x1080 60.0 1680x1050 60.0 1600x1200 60.0 1280x1024 60.0 1280x960 60.0 1024x768 60.0 800x600 60.3 640x480 59.9 DP-2 disconnected (normal left inverted right x axis y axis) DP-3 disconnected (normal left inverted right x axis y axis) LVDS1 connected 1600x900 60.0 + 40.0 1440x900 59.9 1360x768 59.8 60.0 1152x864 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 connected 1920x1200+0+0 518mm x 324mm 1920x1200 60.0*+ 1920x1080 60.0 1680x1050 60.0 1600x900 60.0 1280x1024 60.0 1440x900 59.9 1280x800 59.8 1280x720 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 60.0 VIRTUAL1 disconnected 1024x768 (0x2ce) 65.0MHz h: width 1024 start 1048 end 1184 total 1344 skew 0 clock 48.4KHz v: height 768 start 771 end 777 total 806 clock 60.0Hz 800x600 (0x2cf) 40.0MHz h: width 800 start 840 end 968 total 1056 skew 0 clock 37.9KHz v: height 600 start 601 end 605 total 628 clock 60.3Hz 640x480 (0x2d0) 25.2MHz h: width 640 start 656 end 752 total 800 skew 0 clock 31.5KHz v: height 480 start 490 end 492 total 525 clock 59.9Hz 1920x1200 (0x2c8) 154.0MHz h: width 1920 start 1968 end 2000 total 2080 skew 0 clock 74.0KHz v: height 1200 start 1203 end 1209 total 1235 clock 60.0Hz 1680x1050 (0x2ca) 146.2MHz h: width 1680 start 1784 end 1960 total 2240 skew 0 clock 65.3KHz v: height 1050 start 1053 end 1059 total 1089 clock 60.0Hz 1280x1024 (0x2cc) 108.0MHz h: width 1280 start 1328 end 1440 total 1688 skew 0 clock 64.0KHz v: height 1024 start 1025 end 1028 total 1066 clock 60.0Hz Cheers, Yuriy -------------- next part -------------- An HTML attachment was scrubbed... URL: From jschoett at gmail.com Mon Jun 6 05:31:10 2016 From: jschoett at gmail.com (=?UTF-8?Q?Jakob_Sch=c3=b6ttl?=) Date: Mon, 6 Jun 2016 07:31:10 +0200 Subject: [xmonad] Xmonad and multiple screens In-Reply-To: References: Message-ID: Hi Yuriy, I have a similar setup on my ThinkPad, but I use three monitors. What I do first, is disable all outputs (I had other kind of problems before): xrandr --output $left --off xrandr --output $right --off xrandr --output $primary --off xrandr --output $primary --auto xrandr --output $right --auto --left-of $primary xrandr --output $left --auto --left-of $right You press mod+shift+{w,e,r} to shift a window to another screen, don't you? I copied and adapted this key bindings from the default config for a different keyboard layout: -- mod-{i,a,e} %! Switch to physical/Xinerama screens 1, 2, or 3 -- mod-shift-{i,a,e} %! Move client to screen 1, 2, or 3 [ (mod ++ key, screenWorkspace sc >>= flip whenJust (windows . f)) | (key, sc) <- zip ["i", "a", "e"] [2, 0, 1] -- [0..] is weired! -- now middle finger (a) is primary (laptop) monitor, -- pointer finger (e) is second (external) monitor , (f, mod) <- [(W.view, "M-"), (W.shift, "M-S-")] ] My xrandr -q output looks similar to your's: Screen 0: minimum 8 x 8, current 5520 x 1080, maximum 32767 x 32767 eDP1 connected 1920x1080+3600+0 (normal left inverted right x axis y axis) 309mm x 173mm 1920x1080 60.05*+ 1400x1050 59.98 1600x900 60.00 1280x1024 60.02 1280x960 60.00 1368x768 60.00 1280x720 60.00 1024x768 60.00 1024x576 60.00 960x540 60.00 800x600 60.32 56.25 864x486 60.00 640x480 59.94 720x405 60.00 640x360 60.00 DP1 disconnected (normal left inverted right x axis y axis) DP2 connected 1680x1050+1920+0 (normal left inverted right x axis y axis) 474mm x 296mm 1680x1050 59.88*+ 59.95 1280x1024 75.02 60.02 1440x900 74.98 59.89 1280x960 60.00 1152x864 75.00 1024x768 75.08 60.00 832x624 74.55 800x600 75.00 60.32 56.25 640x480 75.00 60.00 720x400 70.08 HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 530mm x 300mm 1920x1080 60.00*+ 1600x1200 60.00 1680x1050 59.88 1280x1024 60.02 1440x900 59.90 1280x960 60.00 1280x800 59.91 1024x768 60.00 800x600 60.32 56.25 640x480 60.00 HDMI2 disconnected (normal left inverted right x axis y axis) VIRTUAL1 disconnected (normal left inverted right x axis y axis) Cheers, Jakob Am 06.06.2016 um 07:14 schrieb Yuriy Halytskyy: > I am trying to use xmonad on a laptop connected to two monitors, via > VGA and HDMI outputs. Laptop screen is disabled and both external > monitors configured using xrandr: > > xrandr --output LVDS1 --off > xrandr --output HDMI-0 --right-of VGA1 > xrandr --output VGA1 --right-of LVDS1 > > > > But mod+{w,e,r} does not work and the only way to have windows on > one of my screens is to move floating window. Xinerama shows only > right monitor: > ghc -e "Graphics.X11.openDisplay [] >>= > Graphics.X11.Xinerama.getScreenInfo" > [Rectangle {rect_x = 1920, rect_y = 0, rect_width = 1920, rect_height > = 1200}] > > Is it possible to somehow overwrite getScreenInfo for xmonad or > configure Xinerama propertly? > > nvidia-setting can only see one screen and one display. > xrandr output shows one huge 3840 x 1200 display and all screens: > > Screen 0: minimum 8 x 8, current 3840 x 1200, maximum 16384 x 16384 > LVDS-0 disconnected primary (normal left inverted right x axis y axis) > DP-0 disconnected (normal left inverted right x axis y axis) > DP-1 disconnected (normal left inverted right x axis y axis) > HDMI-0 connected 1920x1200+1920+0 (normal left inverted right x axis y > axis) 518mm x 324mm > 1920x1200 60.0*+ > 1920x1080 60.0 > 1680x1050 60.0 > 1600x1200 60.0 > 1280x1024 60.0 > 1280x960 60.0 > 1024x768 60.0 > 800x600 60.3 > 640x480 59.9 > DP-2 disconnected (normal left inverted right x axis y axis) > DP-3 disconnected (normal left inverted right x axis y axis) > LVDS1 connected > 1600x900 60.0 + 40.0 > 1440x900 59.9 > 1360x768 59.8 60.0 > 1152x864 60.0 > 1024x768 60.0 > 800x600 60.3 56.2 > 640x480 59.9 > VGA1 connected 1920x1200+0+0 518mm x 324mm > 1920x1200 60.0*+ > 1920x1080 60.0 > 1680x1050 60.0 > 1600x900 60.0 > 1280x1024 60.0 > 1440x900 59.9 > 1280x800 59.8 > 1280x720 60.0 > 1024x768 60.0 > 800x600 60.3 56.2 > 640x480 60.0 > VIRTUAL1 disconnected > 1024x768 (0x2ce) 65.0MHz > h: width 1024 start 1048 end 1184 total 1344 skew 0 clock > 48.4KHz > v: height 768 start 771 end 777 total 806 clock > 60.0Hz > 800x600 (0x2cf) 40.0MHz > h: width 800 start 840 end 968 total 1056 skew 0 clock > 37.9KHz > v: height 600 start 601 end 605 total 628 clock > 60.3Hz > 640x480 (0x2d0) 25.2MHz > h: width 640 start 656 end 752 total 800 skew 0 clock > 31.5KHz > v: height 480 start 490 end 492 total 525 clock > 59.9Hz > 1920x1200 (0x2c8) 154.0MHz > h: width 1920 start 1968 end 2000 total 2080 skew 0 clock > 74.0KHz > v: height 1200 start 1203 end 1209 total 1235 > clock 60.0Hz > 1680x1050 (0x2ca) 146.2MHz > h: width 1680 start 1784 end 1960 total 2240 skew 0 clock > 65.3KHz > v: height 1050 start 1053 end 1059 total 1089 > clock 60.0Hz > 1280x1024 (0x2cc) 108.0MHz > h: width 1280 start 1328 end 1440 total 1688 skew 0 clock > 64.0KHz > v: height 1024 start 1025 end 1028 total 1066 > clock 60.0Hz > > > Cheers, > Yuriy > > > _______________________________________________ > xmonad mailing list > xmonad at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuriy.halytskyy at gmail.com Mon Jun 6 06:19:20 2016 From: yuriy.halytskyy at gmail.com (Yuriy Halytskyy) Date: Mon, 6 Jun 2016 18:19:20 +1200 Subject: [xmonad] Xmonad and multiple screens In-Reply-To: References: Message-ID: OK, it kind of works with fake Xinerama library inserted via LD_PRELOAD. cat ~/.fakexinerama # 2 screens: 2 # VGA display 0 0 1920 1200 # External LCD screen "HDMI1": 1920 0 1920 1200 ghc -e "Graphics.X11.openDisplay [] >>= Graphics.X11.Xinerama.getScreenInfo" [Rectangle {rect_x = 0, rect_y = 0, rect_width = 1920, rect_height = 1200},Rectangle {rect_x = 1920, rect_y = 0, rect_width = 1920, rect_height = 1200} Would be good if this ugly hack was unnecessary. Cheers, Yuriy On Mon, Jun 6, 2016 at 5:14 PM, Yuriy Halytskyy wrote: > I am trying to use xmonad on a laptop connected to two monitors, via VGA > and HDMI outputs. Laptop screen is disabled and both external monitors > configured using xrandr: > > xrandr --output LVDS1 --off > xrandr --output HDMI-0 --right-of VGA1 > xrandr --output VGA1 --right-of LVDS1 > > > > But mod+{w,e,r} does not work and the only way to have windows on one of > my screens is to move floating window. Xinerama shows only right monitor: > ghc -e "Graphics.X11.openDisplay [] >>= > Graphics.X11.Xinerama.getScreenInfo" > [Rectangle {rect_x = 1920, rect_y = 0, rect_width = 1920, rect_height = > 1200}] > > Is it possible to somehow overwrite getScreenInfo for xmonad or configure > Xinerama propertly? > > nvidia-setting can only see one screen and one display. > xrandr output shows one huge 3840 x 1200 display and all screens: > > Screen 0: minimum 8 x 8, current 3840 x 1200, maximum 16384 x 16384 > LVDS-0 disconnected primary (normal left inverted right x axis y axis) > DP-0 disconnected (normal left inverted right x axis y axis) > DP-1 disconnected (normal left inverted right x axis y axis) > HDMI-0 connected 1920x1200+1920+0 (normal left inverted right x axis y > axis) 518mm x 324mm > 1920x1200 60.0*+ > 1920x1080 60.0 > 1680x1050 60.0 > 1600x1200 60.0 > 1280x1024 60.0 > 1280x960 60.0 > 1024x768 60.0 > 800x600 60.3 > 640x480 59.9 > DP-2 disconnected (normal left inverted right x axis y axis) > DP-3 disconnected (normal left inverted right x axis y axis) > LVDS1 connected > 1600x900 60.0 + 40.0 > 1440x900 59.9 > 1360x768 59.8 60.0 > 1152x864 60.0 > 1024x768 60.0 > 800x600 60.3 56.2 > 640x480 59.9 > VGA1 connected 1920x1200+0+0 518mm x 324mm > 1920x1200 60.0*+ > 1920x1080 60.0 > 1680x1050 60.0 > 1600x900 60.0 > 1280x1024 60.0 > 1440x900 59.9 > 1280x800 59.8 > 1280x720 60.0 > 1024x768 60.0 > 800x600 60.3 56.2 > 640x480 60.0 > VIRTUAL1 disconnected > 1024x768 (0x2ce) 65.0MHz > h: width 1024 start 1048 end 1184 total 1344 skew 0 clock > 48.4KHz > v: height 768 start 771 end 777 total 806 clock > 60.0Hz > 800x600 (0x2cf) 40.0MHz > h: width 800 start 840 end 968 total 1056 skew 0 clock > 37.9KHz > v: height 600 start 601 end 605 total 628 clock > 60.3Hz > 640x480 (0x2d0) 25.2MHz > h: width 640 start 656 end 752 total 800 skew 0 clock > 31.5KHz > v: height 480 start 490 end 492 total 525 clock > 59.9Hz > 1920x1200 (0x2c8) 154.0MHz > h: width 1920 start 1968 end 2000 total 2080 skew 0 clock > 74.0KHz > v: height 1200 start 1203 end 1209 total 1235 clock > 60.0Hz > 1680x1050 (0x2ca) 146.2MHz > h: width 1680 start 1784 end 1960 total 2240 skew 0 clock > 65.3KHz > v: height 1050 start 1053 end 1059 total 1089 clock > 60.0Hz > 1280x1024 (0x2cc) 108.0MHz > h: width 1280 start 1328 end 1440 total 1688 skew 0 clock > 64.0KHz > v: height 1024 start 1025 end 1028 total 1066 clock > 60.0Hz > > > Cheers, > Yuriy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Mon Jun 6 13:04:34 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 6 Jun 2016 09:04:34 -0400 Subject: [xmonad] Xmonad and multiple screens In-Reply-To: References: Message-ID: On Mon, Jun 6, 2016 at 1:14 AM, Yuriy Halytskyy wrote: > I am trying to use xmonad on a laptop connected to two monitors, via VGA > and HDMI outputs. Laptop screen is disabled and both external monitors > configured using xrandr: What does "xmonad --verbose -version" say? If you are running a distribution package (e.g. via yum or apt-get) or you built it without the Xinerama developer libraries installed, it won't be using Xinerama. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuriy.halytskyy at gmail.com Mon Jun 6 21:21:32 2016 From: yuriy.halytskyy at gmail.com (Yuriy Halytskyy) Date: Tue, 7 Jun 2016 09:21:32 +1200 Subject: [xmonad] Xmonad and multiple screens In-Reply-To: References: Message-ID: $ xmonad --verbose -version xmonad: user error (unrecognized flags $ xmonad --version xmonad 0.11 It is installed via apt but xinerama is supported (?): $ ghc -e Graphics.X11.Xinerama.compiledWithXinerama True Cheers, Yuriy -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Mon Jun 6 21:23:58 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 6 Jun 2016 17:23:58 -0400 Subject: [xmonad] Xmonad and multiple screens In-Reply-To: References: Message-ID: On Mon, Jun 6, 2016 at 5:21 PM, Yuriy Halytskyy wrote: > $ xmonad --verbose -version Not sure if I typoed or you misread, but that is all one option: --verbose-version without a space. pyanfar Z$ xmonad --verbose-version xmonad 0.12 compiled by ghc 7.10 for x86_64-linux Xinerama: True -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuriy.halytskyy at gmail.com Mon Jun 6 21:26:14 2016 From: yuriy.halytskyy at gmail.com (Yuriy Halytskyy) Date: Tue, 7 Jun 2016 09:26:14 +1200 Subject: [xmonad] Xmonad and multiple screens In-Reply-To: References: Message-ID: $ xmonad --verbose-version xmonad 0.11 compiled by ghc 7.6 for x86_64-linux Xinerama: True On Tue, Jun 7, 2016 at 9:23 AM, Brandon Allbery wrote: > > On Mon, Jun 6, 2016 at 5:21 PM, Yuriy Halytskyy > wrote: > >> $ xmonad --verbose -version > > > Not sure if I typoed or you misread, but that is all one option: > --verbose-version without a space. > > pyanfar Z$ xmonad --verbose-version > xmonad 0.12 compiled by ghc 7.10 for x86_64-linux > Xinerama: True > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Mon Jun 6 21:30:12 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 6 Jun 2016 17:30:12 -0400 Subject: [xmonad] Xmonad and multiple screens In-Reply-To: References: Message-ID: So I just looked back at your original message and saw nvidia-setting can only see one screen and one display. If NVidia's driver is only reporting one screen, that's all we or any other program will see. I think you'll need to figure out how to get this reported correctly. On Mon, Jun 6, 2016 at 5:26 PM, Yuriy Halytskyy wrote: > $ xmonad --verbose-version > xmonad 0.11 compiled by ghc 7.6 for x86_64-linux > Xinerama: True > > > On Tue, Jun 7, 2016 at 9:23 AM, Brandon Allbery > wrote: > >> >> On Mon, Jun 6, 2016 at 5:21 PM, Yuriy Halytskyy < >> yuriy.halytskyy at gmail.com> wrote: >> >>> $ xmonad --verbose -version >> >> >> Not sure if I typoed or you misread, but that is all one option: >> --verbose-version without a space. >> >> pyanfar Z$ xmonad --verbose-version >> xmonad 0.12 compiled by ghc 7.10 for x86_64-linux >> Xinerama: True >> >> -- >> brandon s allbery kf8nh sine nomine >> associates >> allbery.b at gmail.com >> ballbery at sinenomine.net >> unix, openafs, kerberos, infrastructure, xmonad >> http://sinenomine.net >> > > -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuriy.halytskyy at gmail.com Mon Jun 6 21:43:45 2016 From: yuriy.halytskyy at gmail.com (Yuriy Halytskyy) Date: Tue, 7 Jun 2016 09:43:45 +1200 Subject: [xmonad] Xmonad and multiple screens In-Reply-To: References: Message-ID: It is not that xmonad does not see the screen, I can move floating windows to it. It could be xorg.conf problem but xrandr works OK, and everything I read says xinerama is an "old" way of doing things. Is it possible to tell xmonad explicitly about my screen arrangement in the config bypassing xinerama? Or at least set LD_PRELOAD for it, as the command launches ~/.xmonad/xmonad-x86_64-linux so variable setting does not work. At the moment I use /etc/ld.so.preload which is terrible. On Tue, Jun 7, 2016 at 9:30 AM, Brandon Allbery wrote: > So I just looked back at your original message and saw > > nvidia-setting can only see one screen and one display. > > > If NVidia's driver is only reporting one screen, that's all we or any > other program will see. I think you'll need to figure out how to get this > reported correctly. > > > On Mon, Jun 6, 2016 at 5:26 PM, Yuriy Halytskyy > wrote: > >> $ xmonad --verbose-version >> xmonad 0.11 compiled by ghc 7.6 for x86_64-linux >> Xinerama: True >> >> >> On Tue, Jun 7, 2016 at 9:23 AM, Brandon Allbery >> wrote: >> >>> >>> On Mon, Jun 6, 2016 at 5:21 PM, Yuriy Halytskyy < >>> yuriy.halytskyy at gmail.com> wrote: >>> >>>> $ xmonad --verbose -version >>> >>> >>> Not sure if I typoed or you misread, but that is all one option: >>> --verbose-version without a space. >>> >>> pyanfar Z$ xmonad --verbose-version >>> xmonad 0.12 compiled by ghc 7.10 for x86_64-linux >>> Xinerama: True >>> >>> -- >>> brandon s allbery kf8nh sine nomine >>> associates >>> allbery.b at gmail.com >>> ballbery at sinenomine.net >>> unix, openafs, kerberos, infrastructure, xmonad >>> http://sinenomine.net >>> >> >> > > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Mon Jun 6 21:55:26 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 6 Jun 2016 17:55:26 -0400 Subject: [xmonad] Xmonad and multiple screens In-Reply-To: References: Message-ID: On Mon, Jun 6, 2016 at 5:43 PM, Yuriy Halytskyy wrote: > everything I read says xinerama is an "old" way of doing things Everything you read is partially wrong. Xinerama consisted of a low level protocol for carving up the root window into screens, and a high level multiple monitor protocol. The high level support was removed in favor of XRandR. ALL existing multiple monitor support, except for "zaphod mode" which you almost certainly do not want, absolutely requires the low level Xinerama component. This includes but is not limited to XRandR, which xmonad uses for multiple monitor support. It still lives in libXinerama, all the API calls are named for it, etc. It causes remarkable amounts of confusion. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From davama at gmail.com Wed Jun 8 16:18:30 2016 From: davama at gmail.com (Dave Macias) Date: Wed, 8 Jun 2016 12:18:30 -0400 Subject: [xmonad] Xmonad: Get NSP Workspace Message-ID: Hello xmonad! Recently i change myWorkspaces from strings to numbers to be able to use the dice font in ppCurrent/Visible. (it's pretty cool) Formerly myWorkspace was defined as so: *--myWorkspaces = ["1","2","3","4","5","6","7","8","9"] ++ ["NSP"]* Now: *myWorkspaces = map show $ [1..9] ++ [0] -- 0 is the NSP ws* Everything has been working fine. The only issue is in my keybindings. specifically in CycleWS. So i have some keybindings as so: ... ... * , ((mod, xK_Up), windows . W.greedyView =<< findWorkspace getSortByIndexNoNSP Next HiddenNonEmptyWS 1) -- move to next WS non NSP* *...* *...* *where* * getSortByIndexNoNSP = fmap (.namedScratchpadFilterOutWorkspace) getSortByIndex* So, if i understand this correctly, "namedScratchpadFilterOutWorkspace" doesnt work because the "name" of the workspace is now the number "0" when it formerly was the string "NSP". How can i get the keybinding to work when i've changed the NSP workpace name to an actual number? Please let me know if more info is needed. Thank you in advance. -Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Wed Jun 8 17:07:30 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 8 Jun 2016 13:07:30 -0400 Subject: [xmonad] Xmonad: Get NSP Workspace In-Reply-To: References: Message-ID: On Wed, Jun 8, 2016 at 12:18 PM, Dave Macias wrote: > How can i get the keybinding to work when i've changed the NSP workpace > name to an actual number? NamedScratchpad is still using the name "NSP" internally; you can only change this by editing the module source and rebuilding. What happened is that you added the workspace "0", and that is where "NSP" was in the StackSet, so that is where they got put after mod-q. So both xmonad and the NamedScratchpad module now think all those windows are on workspace "0" instead of in "NSP". If you go to that workspace and press the toggle key for each window, the window will be moved to the new "NSP"; likewise if you don't go there and press the toggle key twice (once will bring it to the current workspace, second will move it to the new "NSP"). -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From davama at gmail.com Wed Jun 8 18:20:12 2016 From: davama at gmail.com (Dave Macias) Date: Wed, 8 Jun 2016 14:20:12 -0400 Subject: [xmonad] Xmonad: Get NSP Workspace In-Reply-To: References: Message-ID: Thank you for replying Brandon. I think i understood some of it but i know i didnt understand this: > If you go to that workspace and press the toggle key for each window, the > window will be moved to the new "NSP"; likewise if you don't go there and > press the toggle key twice (once will bring it to the current workspace, > second will move it to the new "NSP"). But reading your comment made realize something, (note: my haskelling is close to zero) 1. NSP still exist. how do i know? i have several scratchpads and when i hide them they actually go to the ws NSP but I myself cannot go to that workspace. (mod-0) but this is probably a separate/related issue. 2. ws 0 (mod-0) is not the same as NSP, but that is what i want WS 0 to be used for So perhaps i didnt phrase my question correctly, or i just didnt understand what was really happening. The keybinding should skip the NSP workspace when i cycle through them. It worked before because i actually defined the NSP workspace as "NSP". Now that i have a workspace 0, how can i make it behave as the NSP workspace so that the keybinding works? Or would it be easier to define "myWorkspaces" as?: *myWorkspaces = map show $ [1..9] ++ ["NSP"]* But i had tried that before but it didnt work. My assumption was because i was using an init and not a char data type. Thanks On Wed, Jun 8, 2016 at 1:07 PM, Brandon Allbery wrote: > On Wed, Jun 8, 2016 at 12:18 PM, Dave Macias wrote: > >> How can i get the keybinding to work when i've changed the NSP workpace >> name to an actual number? > > > NamedScratchpad is still using the name "NSP" internally; you can only > change this by editing the module source and rebuilding. > > What happened is that you added the workspace "0", and that is where "NSP" > was in the StackSet, so that is where they got put after mod-q. So both > xmonad and the NamedScratchpad module now think all those windows are on > workspace "0" instead of in "NSP". If you go to that workspace and press > the toggle key for each window, the window will be moved to the new "NSP"; > likewise if you don't go there and press the toggle key twice (once will > bring it to the current workspace, second will move it to the new "NSP"). > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Wed Jun 8 18:24:04 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 8 Jun 2016 14:24:04 -0400 Subject: [xmonad] Xmonad: Get NSP Workspace In-Reply-To: References: Message-ID: On Wed, Jun 8, 2016 at 2:20 PM, Dave Macias wrote: > But reading your comment made realize something, (note: my haskelling is > close to zero) > 1. NSP still exist. how do i know? i have several scratchpads and when i > hide them they actually go to the ws NSP but I myself cannot go to that > workspace. (mod-0) but this is probably a separate/related issue. > 2. ws 0 (mod-0) is not the same as NSP, but that is what i want WS 0 to be > used for > If you have EwmhDesktops configured then you can use xdotool or wmctrl to switch to the new NSP workspace. (Note that it won't exist until something is moved there, unless you list it explicitly in your workspaces.) As I said previously, you must modify the NamedScratchpad module in order to use a different workspace name. It does not work by slots (like the reloading of workspaces across mod-q does), it looks for NSP by name. https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Util/NamedScratchpad.hs#L153 -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From davama at gmail.com Wed Jun 8 19:39:50 2016 From: davama at gmail.com (Dave Macias) Date: Wed, 8 Jun 2016 15:39:50 -0400 Subject: [xmonad] Xmonad: Get NSP Workspace In-Reply-To: References: Message-ID: Ok, that makes sense. So in essence i could have up to 11 ws if NSP has a window. So that being the case is either of these possible? *myWorkspaces = map show $ [1..9] ++ [0] ++ ["NSP"]* myWorkspaces = map show $ [1..9] ++ ["NSP"] This, i believe, will solve the keybinding issue and still allow me to use the dice.ttf font. On Wed, Jun 8, 2016 at 2:24 PM, Brandon Allbery wrote: > > On Wed, Jun 8, 2016 at 2:20 PM, Dave Macias wrote: > >> But reading your comment made realize something, (note: my haskelling is >> close to zero) >> 1. NSP still exist. how do i know? i have several scratchpads and when i >> hide them they actually go to the ws NSP but I myself cannot go to that >> workspace. (mod-0) but this is probably a separate/related issue. >> 2. ws 0 (mod-0) is not the same as NSP, but that is what i want WS 0 to >> be used for >> > > If you have EwmhDesktops configured then you can use xdotool or wmctrl to > switch to the new NSP workspace. (Note that it won't exist until something > is moved there, unless you list it explicitly in your workspaces.) > > As I said previously, you must modify the NamedScratchpad module in order > to use a different workspace name. It does not work by slots (like the > reloading of workspaces across mod-q does), it looks for NSP by name. > > https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Util/NamedScratchpad.hs#L153 > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Wed Jun 8 19:52:01 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 8 Jun 2016 15:52:01 -0400 Subject: [xmonad] Xmonad: Get NSP Workspace In-Reply-To: References: Message-ID: On Wed, Jun 8, 2016 at 3:39 PM, Dave Macias wrote: > Ok, that makes sense. So in essence i could have up to 11 ws if NSP has a > window. > > So that being the case is either of these possible? > *myWorkspaces = map show $ [1..9] ++ [0] ++ ["NSP"]* > You're using ($) wrong and will get a type error from trying to append a list of strings to a list of numbers. myWorkspaces = map show [1..9] ++ ["0","NSP"] is what I'd write, if I were using numeric workspaces (I use words). It's still possible you'd need to move stuff off of "0" back to "NSP". This, i believe, will solve the keybinding issue and still allow me to use > the dice.ttf font. > -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From davama at gmail.com Wed Jun 8 20:22:09 2016 From: davama at gmail.com (Dave Macias) Date: Wed, 8 Jun 2016 16:22:09 -0400 Subject: [xmonad] Xmonad: Get NSP Workspace In-Reply-To: References: Message-ID: > > You're using ($) wrong and will get a type error from trying to append a > list of strings to a list of numbers. I figure appending a string to numbers was the issue. The code worked. Thank you for the continue support. -Dave On Wed, Jun 8, 2016 at 3:52 PM, Brandon Allbery wrote: > On Wed, Jun 8, 2016 at 3:39 PM, Dave Macias wrote: > >> Ok, that makes sense. So in essence i could have up to 11 ws if NSP has a >> window. >> >> So that being the case is either of these possible? >> *myWorkspaces = map show $ [1..9] ++ [0] ++ ["NSP"]* >> > > You're using ($) wrong and will get a type error from trying to append a > list of strings to a list of numbers. > > myWorkspaces = map show [1..9] ++ ["0","NSP"] > > is what I'd write, if I were using numeric workspaces (I use words). > > It's still possible you'd need to move stuff off of "0" back to "NSP". > > This, i believe, will solve the keybinding issue and still allow me to use >> the dice.ttf font. >> > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From asjo at koldfront.dk Sun Jun 12 16:09:02 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Sun, 12 Jun 2016 18:09:02 +0200 Subject: [xmonad] How to run xmonad from development repository Message-ID: <87fusifkyp.fsf@tullinup.koldfront.dk> I am trying to get back into fixing the border colormap stuff? that I got half way through last year?. I am wondering - still being new to this - how to efficiently do development of xmonad. What I did previous was to rebuild Debian packages with my changes, installing them, and then "xmonad --recompile" and restarting xmonad. That is quite cumbersome, as Debian has dependencies between the X11 code, X11 xft and xmonad, so there is a lot of rebuilding just to realize that I made a(nother) mistake. How do you run xmonad from a cloned git repository and do a change-compile-run cycle efficiently? Is there a way to point "xmonad --recompile" at my local repository, or? Best regards, Adam ? https://github.com/asjo/xmonad/commit/e7d0e004d0a1acfd1ff149eaabf274fe2519c4fc ? https://github.com/xmonad/X11/pull/35 -- "Close the door to it all Adam Sj?gren A crash and a fireball asjo at koldfront.dk If that feels good This is the end" From asjo at koldfront.dk Sun Jun 12 16:45:53 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Sun, 12 Jun 2016 18:45:53 +0200 Subject: [xmonad] How to run xmonad from development repository References: <87fusifkyp.fsf@tullinup.koldfront.dk> Message-ID: <87bn36fj9a.fsf@tullinup.koldfront.dk> Ok, I found that simply uninstalling the Debian packages (maybe that wasn't even necessary), and then doing cabal configure && cabal build && cabal install in X11, xmonad, and xmonad-contrib repositories allows me to "xmonad --recompile" and use my modified code. Cool! Best regards, Adam -- "Accept failure gracefully." Adam Sj?gren asjo at koldfront.dk From steffen.schuldenzucker at gmail.com Sun Jun 12 16:58:37 2016 From: steffen.schuldenzucker at gmail.com (Steffen Schuldenzucker) Date: Sun, 12 Jun 2016 18:58:37 +0200 Subject: [xmonad] How to run xmonad from development repository In-Reply-To: <87bn36fj9a.fsf@tullinup.koldfront.dk> References: <87fusifkyp.fsf@tullinup.koldfront.dk> <87bn36fj9a.fsf@tullinup.koldfront.dk> Message-ID: As a side note, it is also possible to place modules in ~/.xmonad/lib/ and import them into ~/.xmonad/xmonad.hs. I've been doing this for prototype extensions not quite ready for inclusion in xmonad-contrib. ---- asjo at koldfront.dk wrote ---- >Ok, I found that simply uninstalling the Debian packages (maybe that >wasn't even necessary), and then doing cabal configure && cabal build && >cabal install in X11, xmonad, and xmonad-contrib repositories allows me >to "xmonad --recompile" and use my modified code. > >Cool! > > > Best regards, > > Adam > >-- > "Accept failure gracefully." Adam Sj?gren > asjo at koldfront.dk > >_______________________________________________ >xmonad mailing list >xmonad at haskell.org >http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad -------------- next part -------------- An HTML attachment was scrubbed... URL: From asjo at koldfront.dk Sun Jun 12 17:24:17 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Sun, 12 Jun 2016 19:24:17 +0200 Subject: [xmonad] Catching exceptions from getWindowAttributes Message-ID: <8737oifhha.fsf@tullinup.koldfront.dk> I am trying to modify xmonad to handle exceptions thrown in getWindowAttributes. Since I am still copy/paste-coding, I need some help. Take a function like this, which I have seen crashes in (especially when using Gimp): floatLocation :: Window -> X (ScreenId, W.RationalRect) floatLocation w = withDisplay $ \d -> do ws <- gets windowset wa <- io $ getWindowAttributes d w let bw = (fromIntegral . wa_border_width) wa sc <- fromMaybe (W.current ws) <$> pointScreen (fi $ wa_x wa) (fi $ wa_y wa) let sr = screenRect . W.screenDetail $ sc rr = W.RationalRect ((fi (wa_x wa) - fi (rect_x sr)) % fi (rect_width sr)) ((fi (wa_y wa) - fi (rect_y sr)) % fi (rect_height sr)) (fi (wa_width wa + bw*2) % fi (rect_width sr)) (fi (wa_height wa + bw*2) % fi (rect_height sr)) return (W.screen sc, rr) where fi x = fromIntegral x I somehow need to wrap the code from getWindowAttributes and on, in something that "does the right thing" if gWA throws an exception. In other places, I have done something like this: sendConfigureEvent :: Display -> XEventPtr -> Window -> Event -> IO () sendConfigureEvent dpy ev w e = C.handle (\(C.SomeException _) -> putStrLn "sendConfigureEvent failed") $ do wa <- io $ getWindowAttributes dpy w setEventType ev configureNotify setConfigureEvent ev w w (wa_x wa) (wa_y wa) (wa_width wa) (wa_height wa) (ev_border_width e) none (wa_override_redirect wa) sendEvent dpy w False 0 ev which works, but in floatLocation the type is X and not IO, and ... well, what's a boy to do? Best regards, Adam -- "It's part of our policy not to be taken seriously" Adam Sj?gren asjo at koldfront.dk From asjo at koldfront.dk Sun Jun 12 19:53:23 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Sun, 12 Jun 2016 21:53:23 +0200 Subject: [xmonad] kill -STOP/-CONT hack References: <87io0udym0.fsf@tullinup.koldfront.dk> Message-ID: <87y46adw0c.fsf@tullinup.koldfront.dk> Brandon writes: > http://hackage.haskell.org/package/xmonad-contrib-0.12/docs/XMonad-Layout-Stoppable.html I have been looking at the documentation there, and searching around. It says this is how you use it: import XMonad import XMonad.Layout.Stoppable main = xmonad def { layoutHook = layoutHook def ||| stoppable (layoutHook def) } But. Uhm. What if I only want to apply it to some programs (Firefox), or one workspace (say, "3")? Best regards, Adam -- "It's part of our policy not to be taken seriously" Adam Sj?gren asjo at koldfront.dk From allbery.b at gmail.com Sun Jun 12 20:04:43 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Sun, 12 Jun 2016 16:04:43 -0400 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: <87y46adw0c.fsf@tullinup.koldfront.dk> References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> Message-ID: On Sun, Jun 12, 2016 at 3:53 PM, Adam Sj?gren wrote: > But. Uhm. What if I only want to apply it to some programs (Firefox), or > one workspace (say, "3")? > Since it's a layout, you can't apply it to individual windows (or programs --- in fact you cannot with 100% reliably map a window to a program, by X11's design). For workspaces, consider XMonad.Layout.PerWorkspace. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From asjo at koldfront.dk Sun Jun 12 20:40:08 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Sun, 12 Jun 2016 22:40:08 +0200 Subject: [xmonad] XMonad.Prompt font Message-ID: <87oa76dtuf.fsf@tullinup.koldfront.dk> I was experimenting with switching from dmenu to XMonad.Prompt.Shell. With dmenu I can get the font I want by passing the argument '-fn "DejaVu Sans Condensed-8:normal"' (a truetype font, using xft). I would like the same in XMonad.Prompt.Shell. xfontsel(1) of course does not list truetype fonts, and the documentation only says: "data XPConfig Constructors XPC font :: String Font" - http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Prompt.html So if anyone else runs into this: what you need to know/guess is to prefix the 'font' with "xft:" in your configuration; i.e.: myPromptConfig = defaultXPConfig { position = Top -- ... , font = "xft:DejaVu Sans Condensed-8" } Best regards, Adam -- "How are you this tiny and this strong? You are Adam Sj?gren like an ant!" asjo at koldfront.dk From asjo at koldfront.dk Sun Jun 12 21:02:13 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Sun, 12 Jun 2016 23:02:13 +0200 Subject: [xmonad] kill -STOP/-CONT hack References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> Message-ID: <87fusidstm.fsf@tullinup.koldfront.dk> Brandon writes: > For workspaces, consider XMonad.Layout.PerWorkspace. Thanks for the tip. The documentation is confusing to me - some places '|||' is used to combine things, other places it isn't. Anyway, this is what I tried first: , layoutHook = avoidStruts $ layoutHook defaultConfig ||| modWorkspace "3" stoppable (layoutHook defaultConfig) which doesn't seem to work, as the browser running on workspace 3 (mod-3 takes me there), keeps using 5-8% CPU according to top when another workspace is active. Taking the example from the XMonad.Layout.Stoppable directly: , layoutHook = layoutHook defaultConfig ||| stoppable (layoutHook defaultConfig) doesn't stop the programs on the other workspaces either, so I guess I've misunderstood something fundamental :-) (This on Debian unstable, Linux 4.6.1, xmonad, X11, xmonad-contrib from git.) Best regards, Adam -- "Sometimes it pays to stay in bed on Monday, rather Adam Sj?gren than spending the rest of the week debugging asjo at koldfront.dk Monday's code." From asjo at koldfront.dk Sun Jun 12 21:37:42 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Sun, 12 Jun 2016 23:37:42 +0200 Subject: [xmonad] XMonad.Promp.Shell matching function Message-ID: <87bn36dr6h.fsf@tullinup.koldfront.dk> I would like shellPrompt to match anywhere in the command, not only from the beginning. E.g. if I have a command called "run_icesocial", I would like that to appear if I type "icesoc", rather than having to type "run_" first. It looks like XMonad.Prompt.Shell.commandCompletionFunction is the function to modify: commandCompletionFunction :: [String] -> String -> [String] commandCompletionFunction cmds str | '/' `elem` str = [] | otherwise = filter (isPrefixOf str) cmds Changing isPrefixOf to isInfixOf I would guess - does that sound right? Is there an easy way to "override" that function from my xmonad.hs? If not, would it be reasonable to make it configurable, so e.g. you could put in a fuzzy matching function, or something even weirder? (I'll give that a go, if so.) Best regards, Adam -- "Sunday morning when the rain begins to fall Adam Sj?gren I've got the cure for it all" asjo at koldfront.dk From asjo at koldfront.dk Sun Jun 12 21:51:54 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Sun, 12 Jun 2016 23:51:54 +0200 Subject: [xmonad] XMonad.Promp.Shell matching function References: <87bn36dr6h.fsf@tullinup.koldfront.dk> Message-ID: <877fdudqit.fsf@tullinup.koldfront.dk> This already exists (thanks, Google, for not finding the latest code), just put: , searchPredicate = isInfixOf in the XPconfig. Great! Adam -- "Det er jo bare punk, forkl?dt som Bubbers badekar!" Adam Sj?gren asjo at koldfront.dk From allbery.b at gmail.com Sun Jun 12 22:53:41 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Sun, 12 Jun 2016 18:53:41 -0400 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: <87fusidstm.fsf@tullinup.koldfront.dk> References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> Message-ID: On Sun, Jun 12, 2016 at 5:02 PM, Adam Sj?gren wrote: > The documentation is confusing to me - some places '|||' is used to > combine things, other places it isn't. > ||| separates layouts. Layouts are complete in and of themselves. Other things are layout modifiers. As the name suggests, they modify other layouts; the layout to be modified is a parameter, and there may be other parameters which may also be workspaces. Maybe this will be clearer: Full -- this is a layout, it can stand by itself or be modified smartBorders Full -- this is a layout modifier applied to a layout smartBorders -- this is an error, because it is not applied to a layout. "It is a purple." -- a purple *what*? smartBorders ||| Full -- this is an error because you are saying "either use smartBorders or use Full". But smartBorders is not a layout , layoutHook = avoidStruts $ layoutHook defaultConfig ||| > modWorkspace "3" stoppable (layoutHook defaultConfig) > > which doesn't seem to work, as the browser running on workspace 3 (mod-3 > takes me there), keeps using 5-8% CPU according to top when another > workspace is active. > I hate their example because it is not clear that it has all the layouts in defaultConfig twice and only the second list has the stop behavior. You need to mod-space 3 times to get to a stoppable layout. If you want stoppable to always be active on workspace 3: layoutHook = avoidStruts $ modWorkspace "3" stoppable $ layoutHook defaultConfig (I find it interesting that you were able to figure out that modWorkspace applies only to layout modifiers as opposed to layouts, but you couldn't recognize that (|||) only works with layouts, not layout modifiers.) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From asjo at koldfront.dk Mon Jun 13 15:43:34 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Mon, 13 Jun 2016 17:43:34 +0200 Subject: [xmonad] kill -STOP/-CONT hack References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> Message-ID: <87wpltjdqx.fsf@tullinup.koldfront.dk> Brandon writes: > I hate their example because it is not clear that it has all the layouts in > defaultConfig twice and only the second list has the stop behavior. You > need to mod-space 3 times to get to a stoppable layout. Oh. No, that was very unclear to me. I was wondering about the duplication, but I glossed it over as yet another subtle point I did not comprehend. I guess my point is that expanding the examples - in general - would help people, like me, get further into these things. > If you want stoppable to always be active on workspace 3: > > layoutHook = avoidStruts $ modWorkspace "3" stoppable $ layoutHook > defaultConfig Thanks! I am trying that now, and it doesn't seem to work for me - the Firefox on workspace 3 is still using 5-10% CPU, regardless of how long I have been on another workspace. > (I find it interesting that you were able to figure out that modWorkspace > applies only to layout modifiers as opposed to layouts, but you couldn't > recognize that (|||) only works with layouts, not layout modifiers.) (Well, I just kept taking stuff from the examples and combining them until the compiler stopped complaining. I don't have much experience with Haskell, but I do with debugging/pattern matching/guessing.) Best regards, Adam -- "Come on ask me anything Adam Sj?gren I'm the king of not very much" asjo at koldfront.dk From allbery.b at gmail.com Tue Jun 14 21:36:04 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 14 Jun 2016 17:36:04 -0400 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: <87wpltjdqx.fsf@tullinup.koldfront.dk> References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> <87wpltjdqx.fsf@tullinup.koldfront.dk> Message-ID: On Mon, Jun 13, 2016 at 11:43 AM, Adam Sj?gren wrote: > > I am trying that now, and it doesn't seem to work for me - the Firefox > on workspace 3 is still using 5-10% CPU, regardless of how long I have > been on another workspace. I was waiting to see if the author of the contrib would jump in, but I guess not. (Contribs are contributed, as the name suggests, and we can't necessarily support all of them directly.) That said, browsers are likely to be a specific screw case these days because sandboxing means that windows or even individual tabs may be running in their own processes (they certainly are in Chrome / chromium). It is not reliably possible (indeed, not necessarily possible at all) to go from an X11 window to all the associated processes, especially going in both directions (that is, downward from a window to tab sandbox processes *and* up from it to the parent browser process(es)), so stopping the whole browser is not going to happen and individual tab processes may well keep running as well, with only the process that created the window itself stopped. (I can't speak for Firefox, but for Chrome this will be a process largely independent of all the tabs, other windows, and various other working processes including any installed apps.) I could also imagine the browser not handling this well since it might well not expect a single process in the chain to be stopped (...or it might handle it by sending SIGCONT on seeing a process come back to waitpid() with WSTOPPED, defeating the layout modifier). -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From asjo at koldfront.dk Tue Jun 14 21:52:14 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Tue, 14 Jun 2016 23:52:14 +0200 Subject: [xmonad] kill -STOP/-CONT hack References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> <87wpltjdqx.fsf@tullinup.koldfront.dk> Message-ID: <877fdrzbe9.fsf@tullinup.koldfront.dk> Brandon writes: > I was waiting to see if the author of the contrib would jump in, but I > guess not. (Contribs are contributed, as the name suggests, and we can't > necessarily support all of them directly.) That is, of course, fair. It is ok to discuss contrib stuff on this mailing list, though, right? > That said, browsers are likely to be a specific screw case these days > because sandboxing means that windows or even individual tabs may be > running in their own processes (they certainly are in Chrome / chromium). Ok, let's take out the complexity that is webbrowsers and try something simpler. If I start another program, say xeyes, on workspace 1, its state is reported by "ps faux" as 'S', and eyes are following my mouse pointer. If I then "killall -STOP xeyes", the eyes stop moving, and the state is reported as 'T' by ps. When I "killall -CONT xeyes", the eyes move again, and the state is back to 'S'. If I move xeyes to workspace 3, the state keeps being reported as 'S' by ps. It never changes to 'T', even 15 seconds after switching to workspace 1. This makes me think that something might not be working in my setup. This is with: , layoutHook = avoidStruts $ modWorkspace "3" stoppable $ layoutHook defaultConfig in my xmonad.hs. Have I misunderstood what is supposed to happen? Best regards, Adam -- "Sunday morning when the rain begins to fall Adam Sj?gren I believe I have seen the end of it all" asjo at koldfront.dk From allbery.b at gmail.com Tue Jun 14 22:00:09 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 14 Jun 2016 18:00:09 -0400 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: <877fdrzbe9.fsf@tullinup.koldfront.dk> References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> <87wpltjdqx.fsf@tullinup.koldfront.dk> <877fdrzbe9.fsf@tullinup.koldfront.dk> Message-ID: On Tue, Jun 14, 2016 at 5:52 PM, Adam Sj?gren wrote: > If I move xeyes to workspace 3, the state keeps being reported as 'S' by > ps. It never changes to 'T', even 15 seconds after switching to > workspace 1. > Wait, are you ever making workspace 3 current in this, or just moving with mod-shift-3? Layouts don't (and can't) react to the latter; the layout can only stop and start processes when you switch to or away from a workspace. The shift operation only manipulates the StackSet without informing the layout. (In theory a layout could be notified, but it'd require more layout methods and those methods would have to guarantee they don't try to draw anything or manipulate the screen / windows directly because the workspace might not be current.) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From asjo at koldfront.dk Tue Jun 14 22:11:41 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Wed, 15 Jun 2016 00:11:41 +0200 Subject: [xmonad] kill -STOP/-CONT hack References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> <87wpltjdqx.fsf@tullinup.koldfront.dk> <877fdrzbe9.fsf@tullinup.koldfront.dk> Message-ID: <87y467xvxe.fsf@tullinup.koldfront.dk> Brandon writes: > On Tue, Jun 14, 2016 at 5:52 PM, Adam Sj?gren wrote: >> If I move xeyes to workspace 3, the state keeps being reported as 'S' by >> ps. It never changes to 'T', even 15 seconds after switching to >> workspace 1. > Wait, are you ever making workspace 3 current in this, or just moving with > mod-shift-3? Layouts don't (and can't) react to the latter; the layout can > only stop and start processes when you switch to or away from a workspace. Makes no difference either way. Does it work for you? Best regards, Adam -- "Don't give me those sandy metal eyes Adam Sj?gren 'Cause I'm proud, and my hair is nice" asjo at koldfront.dk From allbery.b at gmail.com Tue Jun 14 22:19:19 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 14 Jun 2016 18:19:19 -0400 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: <87y467xvxe.fsf@tullinup.koldfront.dk> References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> <87wpltjdqx.fsf@tullinup.koldfront.dk> <877fdrzbe9.fsf@tullinup.koldfront.dk> <87y467xvxe.fsf@tullinup.koldfront.dk> Message-ID: On Tue, Jun 14, 2016 at 6:11 PM, Adam Sj?gren wrote: > Brandon writes: > > On Tue, Jun 14, 2016 at 5:52 PM, Adam Sj?gren wrote: > > >> If I move xeyes to workspace 3, the state keeps being reported as 'S' by > >> ps. It never changes to 'T', even 15 seconds after switching to > >> workspace 1. > > > Wait, are you ever making workspace 3 current in this, or just moving > with > > mod-shift-3? Layouts don't (and can't) react to the latter; the layout > can > > only stop and start processes when you switch to or away from a > workspace. > > Makes no difference either way. Does it work for you? Haven't tried because I don't have a sandbox setup on this machine (to run a separate xmonad setup from my main one in xephyr). I just realized xeyes was a bad choice; Stoppable relies on _NET_WM_PID, and... pyanfar ?.xmonad*pyanfar? Z$ xeyes & sleep 3; xprop -name xeyes _NET_WM_PID; kill $! [1] 14711 _NET_WM_PID: not found. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Tue Jun 14 22:23:21 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 14 Jun 2016 18:23:21 -0400 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> <87wpltjdqx.fsf@tullinup.koldfront.dk> <877fdrzbe9.fsf@tullinup.koldfront.dk> <87y467xvxe.fsf@tullinup.koldfront.dk> Message-ID: On Tue, Jun 14, 2016 at 6:19 PM, Brandon Allbery wrote: > I just realized xeyes was a bad choice; Stoppable relies on _NET_WM_PID, > and... > If you test this with a terminal, use one that doesn't use factory backends (like xterm or urxvt --- NOT urxvtc!) or suppress the backend factory; otherwise you get the pid of the factory and will be very unhappy when it suspends every terminal instance because they're all owned by the factory. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Tue Jun 14 22:35:37 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 14 Jun 2016 18:35:37 -0400 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> <87wpltjdqx.fsf@tullinup.koldfront.dk> <877fdrzbe9.fsf@tullinup.koldfront.dk> <87y467xvxe.fsf@tullinup.koldfront.dk> Message-ID: On Tue, Jun 14, 2016 at 6:23 PM, Brandon Allbery wrote: > On Tue, Jun 14, 2016 at 6:19 PM, Brandon Allbery > wrote: > >> I just realized xeyes was a bad choice; Stoppable relies on _NET_WM_PID, >> and... >> > > If you test this with a terminal, use one that doesn't use factory > backends (like xterm or urxvt --- NOT urxvtc!) or suppress the backend > factory; otherwise you get the pid of the factory and will be very unhappy > when it suspends every terminal instance because they're all owned by the > factory. > I should also mention that I pointed out these and other shortcomings of the information any implementation could rely on for this --- which isn't much --- to the author back when they were writing it. You seem to be hitting all the pain spots where it can't work sensibly. (Very recent xorg has a call that could make the xeyes case work, but would not help with the other cases I mentioned. It would also open an interesting potential issue with remote windows via ssh X11 forwarding, where it could suspend the ssh as the apparent owner of the window and cause the remote to time out and drop the connection.) X11 *really* does not want this kind of thing to work. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From asjo at koldfront.dk Tue Jun 14 22:56:42 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Wed, 15 Jun 2016 00:56:42 +0200 Subject: [xmonad] kill -STOP/-CONT hack References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> <87wpltjdqx.fsf@tullinup.koldfront.dk> <877fdrzbe9.fsf@tullinup.koldfront.dk> <87y467xvxe.fsf@tullinup.koldfront.dk> Message-ID: <87h9cvxtud.fsf@tullinup.koldfront.dk> Brandon writes: > X11 *really* does not want this kind of thing to work. Maybe the documentation of the module could be amended with a paragraph outlining this. (I definitely would not have wasted (your) time trying to get it to run, if it had.) Thanks for all the tips! Best regards, Adam -- "It's part of our policy not to be taken seriously" Adam Sj?gren asjo at koldfront.dk From asjo at koldfront.dk Tue Jun 14 23:24:58 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Wed, 15 Jun 2016 01:24:58 +0200 Subject: [xmonad] kill -STOP/-CONT hack References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> <87wpltjdqx.fsf@tullinup.koldfront.dk> <877fdrzbe9.fsf@tullinup.koldfront.dk> <87y467xvxe.fsf@tullinup.koldfront.dk> <87h9cvxtud.fsf@tullinup.koldfront.dk> Message-ID: <87d1njxsj9.fsf@tullinup.koldfront.dk> Adam writes: > Brandon writes: > >> X11 *really* does not want this kind of thing to work. > > Maybe the documentation of the module could be amended with a paragraph > outlining this. Putting my keyboard where my mouth is, as a start: ? https://github.com/asjo/xmonad-contrib/commit/b2ecbe7471a5d519fc03288614c6df393cab1e7a > (I definitely would not have wasted (your) time trying to get it to run, > if it had.) I don't, however, understand why it doesn't work on Firefox. kill -STOP manually _does_ work on Firefox. And Firefox sets _NET_WM_PID. Best regards, Adam -- "I say, either agree with me or take a hike! I'm Adam Sj?gren right, period! End of discussion!" asjo at koldfront.dk From fercerpav at gmail.com Wed Jun 15 06:46:32 2016 From: fercerpav at gmail.com (Paul Fertser) Date: Wed, 15 Jun 2016 09:46:32 +0300 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: <87d1njxsj9.fsf@tullinup.koldfront.dk> References: <87wpltjdqx.fsf@tullinup.koldfront.dk> <877fdrzbe9.fsf@tullinup.koldfront.dk> <87y467xvxe.fsf@tullinup.koldfront.dk> <87h9cvxtud.fsf@tullinup.koldfront.dk> <87d1njxsj9.fsf@tullinup.koldfront.dk> Message-ID: <20160615064632.GL1008@home.paul.comp> Hey Adam, On Wed, Jun 15, 2016 at 01:24:58AM +0200, Adam Sj?gren wrote: > > (I definitely would not have wasted (your) time trying to get it to run, > > if it had.) > > I don't, however, understand why it doesn't work on Firefox. kill -STOP > manually _does_ work on Firefox. And Firefox sets _NET_WM_PID. I can add another datapoint here: it works with Firefox on my machine, but the exact config and firefox version will be available only later today, when I get back home. -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fercerpav at gmail.com From asjo at koldfront.dk Wed Jun 15 11:04:30 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Wed, 15 Jun 2016 13:04:30 +0200 Subject: [xmonad] kill -STOP/-CONT hack References: <87wpltjdqx.fsf@tullinup.koldfront.dk> <877fdrzbe9.fsf@tullinup.koldfront.dk> <87y467xvxe.fsf@tullinup.koldfront.dk> <87h9cvxtud.fsf@tullinup.koldfront.dk> <87d1njxsj9.fsf@tullinup.koldfront.dk> <20160615064632.GL1008@home.paul.comp> Message-ID: <87ziqmaf29.fsf@tullinup.koldfront.dk> Paul writes: > I can add another datapoint here: it works with Firefox on my machine, > but the exact config and firefox version will be available only later > today, when I get back home. Cool, that would be fun to see. (I'm on 45.2.0) Best regards, Adam -- "You make a hit by putting two flops together" Adam Sj?gren asjo at koldfront.dk From fercerpav at gmail.com Mon Jun 20 07:47:55 2016 From: fercerpav at gmail.com (Paul Fertser) Date: Mon, 20 Jun 2016 10:47:55 +0300 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: <87ziqmaf29.fsf@tullinup.koldfront.dk> References: <877fdrzbe9.fsf@tullinup.koldfront.dk> <87y467xvxe.fsf@tullinup.koldfront.dk> <87h9cvxtud.fsf@tullinup.koldfront.dk> <87d1njxsj9.fsf@tullinup.koldfront.dk> <20160615064632.GL1008@home.paul.comp> <87ziqmaf29.fsf@tullinup.koldfront.dk> Message-ID: <20160620074755.GD2802@home.paul.comp> Sorry for the slow reply, On Wed, Jun 15, 2016 at 01:04:30PM +0200, Adam Sjøgren wrote: > > I can add another datapoint here: it works with Firefox on my machine, > > but the exact config and firefox version will be available only later > > today, when I get back home. > > Cool, that would be fun to see. > > (I'm on 45.2.0) I've seen a report that 47 doesn't work but I haven't tried it myself yet (I'm in the middle of a system upgrade so I can't even say what version worked for me). I've tried with starting gqview, moving it to my stoppable workspace, then switching to that workspace and back and after 5 seconds gqview was stopped, ps output showed T status. Here's the relevant part of my config: layoutHook = modWorkspace "stop" (ModifiedLayout (Stoppable "S" 5 Nothing)) $ reflectHoriz $ layoutHook defaultConfig XMonad.workspaces = map show [1..8] ++ ["stop"] (full config attached) That's with xmonad 0.11.1. -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fercerpav at gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: laptop-xmonad.hs Type: text/x-haskell Size: 2101 bytes Desc: not available URL: From fercerpav at gmail.com Mon Jun 20 16:11:38 2016 From: fercerpav at gmail.com (Paul Fertser) Date: Mon, 20 Jun 2016 19:11:38 +0300 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: <20160620074755.GD2802@home.paul.comp> References: <87y467xvxe.fsf@tullinup.koldfront.dk> <87h9cvxtud.fsf@tullinup.koldfront.dk> <87d1njxsj9.fsf@tullinup.koldfront.dk> <20160615064632.GL1008@home.paul.comp> <87ziqmaf29.fsf@tullinup.koldfront.dk> <20160620074755.GD2802@home.paul.comp> Message-ID: <20160620161137.GE2802@home.paul.comp> On Mon, Jun 20, 2016 at 10:47:55AM +0300, Paul Fertser wrote: > I've seen a report that 47 doesn't work but I haven't tried it myself Now I can confirm that Firefox 47.0 can be stopped as well. The report I was talking about was due to running it in firejail. -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fercerpav at gmail.com From asjo at koldfront.dk Mon Jun 20 16:33:40 2016 From: asjo at koldfront.dk (Adam =?utf-8?Q?Sj=C3=B8gren?=) Date: Mon, 20 Jun 2016 18:33:40 +0200 Subject: [xmonad] kill -STOP/-CONT hack References: <87y467xvxe.fsf@tullinup.koldfront.dk> <87h9cvxtud.fsf@tullinup.koldfront.dk> <87d1njxsj9.fsf@tullinup.koldfront.dk> <20160615064632.GL1008@home.paul.comp> <87ziqmaf29.fsf@tullinup.koldfront.dk> <20160620074755.GD2802@home.paul.comp> <20160620161137.GE2802@home.paul.comp> Message-ID: <87vb13om57.fsf@tullinup.koldfront.dk> Paul writes: > On Mon, Jun 20, 2016 at 10:47:55AM +0300, Paul Fertser wrote: >> I've seen a report that 47 doesn't work but I haven't tried it myself > > Now I can confirm that Firefox 47.0 can be stopped as well. The > report I was talking about was due to running it in firejail. Ok, thanks for checking! Nothing gets stopped for me (even when trying something different from xeyes, say, eog, which does set _NET_WM_PID), so I'm probably doing something wrong. I am running xmonad and xmonad-contrib from the development repository, though, and this layoutHook: layoutHook = avoidStruts $ modWorkspace "3" stoppable $ layoutHook defaultConfig Best regards, Adam -- "Why should they care Adam Sjøgren With bitter eyes asjo at koldfront.dk They've already paid the price Money always takes the place of life" From dmwit at dmwit.com Wed Jun 22 19:55:38 2016 From: dmwit at dmwit.com (Daniel Wagner) Date: Wed, 22 Jun 2016 12:55:38 -0700 Subject: [xmonad] Catching exceptions from getWindowAttributes In-Reply-To: <8737oifhha.fsf@tullinup.koldfront.dk> References: <8737oifhha.fsf@tullinup.koldfront.dk> Message-ID: The simplest thing will be to wrap just the call to `getWindowAttributes`, if that's the one you expect to fail. It is not conveniently possible to wrap `X` actions; so instead, something like withDisplay $ \d -> do ws <- gets windowset ewa <- io $ try (getWindowAttributes d w) case ewa of Left e -> io (putStrLn "HELP! do something!") Right wa -> do let bw = (fromIntegral . wa_border_width) wa {- ... etc. -} ~d On Sun, Jun 12, 2016 at 10:24 AM, Adam Sjøgren wrote: > I am trying to modify xmonad to handle exceptions thrown in > getWindowAttributes. > > Since I am still copy/paste-coding, I need some help. > > Take a function like this, which I have seen crashes in (especially when > using Gimp): > > floatLocation :: Window -> X (ScreenId, W.RationalRect) > floatLocation w = withDisplay $ \d -> do > ws <- gets windowset > wa <- io $ getWindowAttributes d w > let bw = (fromIntegral . wa_border_width) wa > sc <- fromMaybe (W.current ws) <$> pointScreen (fi $ wa_x wa) (fi $ > wa_y wa) > > let sr = screenRect . W.screenDetail $ sc > rr = W.RationalRect ((fi (wa_x wa) - fi (rect_x sr)) % fi > (rect_width sr)) > ((fi (wa_y wa) - fi (rect_y sr)) % fi > (rect_height sr)) > (fi (wa_width wa + bw*2) % fi (rect_width > sr)) > (fi (wa_height wa + bw*2) % fi (rect_height > sr)) > > return (W.screen sc, rr) > where fi x = fromIntegral x > > I somehow need to wrap the code from getWindowAttributes and on, in > something that "does the right thing" if gWA throws an exception. > > In other places, I have done something like this: > > sendConfigureEvent :: Display -> XEventPtr -> Window -> Event -> IO () > sendConfigureEvent dpy ev w e = C.handle (\(C.SomeException _) -> > putStrLn "sendConfigureEvent failed") $ do > wa <- io $ getWindowAttributes dpy w > setEventType ev configureNotify > setConfigureEvent ev w w > (wa_x wa) (wa_y wa) (wa_width wa) > (wa_height wa) (ev_border_width e) none > (wa_override_redirect wa) > sendEvent dpy w False 0 ev > > which works, but in floatLocation the type is X and not IO, and ... > well, what's a boy to do? > > > Best regards, > > Adam > > -- > "It's part of our policy not to be taken seriously" Adam Sjøgren > asjo at koldfront.dk > > _______________________________________________ > xmonad mailing list > xmonad at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Wed Jun 22 20:00:23 2016 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 22 Jun 2016 16:00:23 -0400 Subject: [xmonad] Catching exceptions from getWindowAttributes In-Reply-To: References: <8737oifhha.fsf@tullinup.koldfront.dk> Message-ID: On Wed, Jun 22, 2016 at 3:55 PM, Daniel Wagner wrote: > It is not conveniently possible to wrap `X` actions userCode and userCodeDef, in XMonad.Core. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmwit at dmwit.com Wed Jun 22 20:17:44 2016 From: dmwit at dmwit.com (Daniel Wagner) Date: Wed, 22 Jun 2016 13:17:44 -0700 Subject: [xmonad] XMonad.Prompt font In-Reply-To: <87oa76dtuf.fsf@tullinup.koldfront.dk> References: <87oa76dtuf.fsf@tullinup.koldfront.dk> Message-ID: Thanks, I've pushed an improvement to the docs that mentions this. ~d On Sun, Jun 12, 2016 at 1:40 PM, Adam Sjøgren wrote: > I was experimenting with switching from dmenu to XMonad.Prompt.Shell. > > With dmenu I can get the font I want by passing the argument '-fn "DejaVu > Sans Condensed-8:normal"' (a truetype font, using xft). > > I would like the same in XMonad.Prompt.Shell. > > xfontsel(1) of course does not list truetype fonts, and the > documentation only says: > > "data XPConfig > Constructors > XPC > font :: String Font" > > - http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Prompt.html > > So if anyone else runs into this: what you need to know/guess is to > prefix the 'font' with "xft:" in your configuration; i.e.: > > myPromptConfig = defaultXPConfig > { > position = Top > -- ... > , font = "xft:DejaVu Sans Condensed-8" > } > > > Best regards, > > Adam > > -- > "How are you this tiny and this strong? You are Adam Sjøgren > like an ant!" asjo at koldfront.dk > > _______________________________________________ > xmonad mailing list > xmonad at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmwit at dmwit.com Thu Jun 23 21:38:33 2016 From: dmwit at dmwit.com (Daniel Wagner) Date: Thu, 23 Jun 2016 14:38:33 -0700 Subject: [xmonad] kill -STOP/-CONT hack In-Reply-To: <87d1njxsj9.fsf@tullinup.koldfront.dk> References: <87io0udym0.fsf@tullinup.koldfront.dk> <87y46adw0c.fsf@tullinup.koldfront.dk> <87fusidstm.fsf@tullinup.koldfront.dk> <87wpltjdqx.fsf@tullinup.koldfront.dk> <877fdrzbe9.fsf@tullinup.koldfront.dk> <87y467xvxe.fsf@tullinup.koldfront.dk> <87h9cvxtud.fsf@tullinup.koldfront.dk> <87d1njxsj9.fsf@tullinup.koldfront.dk> Message-ID: On Tue, Jun 14, 2016 at 4:24 PM, Adam Sjøgren wrote: > Putting my keyboard where my mouth is, as a start: > · > https://github.com/asjo/xmonad-contrib/commit/b2ecbe7471a5d519fc03288614c6df393cab1e7a If you can turn this change into a clean, one-commit pull request against xmonad/xmonad-contrib, I'll happily merge it. Or I'll be happy to make the change myself if you don't care about attribution in the git log. ~d -------------- next part -------------- An HTML attachment was scrubbed... URL: