From mathstuf at gmail.com Sat Jun 1 00:58:45 2013 From: mathstuf at gmail.com (Ben Boeckel) Date: Fri, 31 May 2013 23:58:45 +0000 (UTC) Subject: bug: icon endless read References: <20130529192243.GB11357@notvery> Message-ID: On Wed, 29 May, 2013 at 19:22:44 GMT, Artur Zimmer wrote: > xmonad + xmobar(commit 99e1e9c122c0bc5ca509912e26920317517b2215) with StdinReader activ: > > so the window title is parsed by xmobar, > if you have a window named: "" you get a cpu-load of 100%. > > > for example: firefox title is the head-title of the html. > > so following website will produce a cpu-load of 100%: > > > > <icon=/dev/null>title</icon> > > > > > and this website will produce anpother color-schema: > > > ><fc=red>title</fc> > > > > If any template variable expansion were HTML escaped, would that work? Are there any variables which expand with a color sequence already? --Ben From jao at gnu.org Sun Jun 2 03:25:51 2013 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Sun, 02 Jun 2013 04:25:51 +0200 Subject: bug: icon endless read References: <20130529192243.GB11357@notvery> Message-ID: <87zjv945ao.fsf@gnu.org> On Sat, Jun 01 2013, Ben Boeckel wrote: > If any template variable expansion were HTML escaped, would that work? > Are there any variables which expand with a color sequence already? It's typical use StdinReader (and XmonadProp) values with color markup to highlight the current workspace number; we would break those usage cases if we HTML-escape the received string. I suspect Pipe is used in similar ways too. But perhaps i'm missing your point? An alternative to address the specific window title problem could also be providing a CurrentWindowTitle plugin. jao From artur128 at 3dzimmer.de Sun Jun 2 16:49:19 2013 From: artur128 at 3dzimmer.de (Artur Zimmer) Date: Sun, 2 Jun 2013 17:49:19 +0200 Subject: bug: icon endless read In-Reply-To: <87zjv945ao.fsf@gnu.org> References: <20130529192243.GB11357@notvery> <87zjv945ao.fsf@gnu.org> Message-ID: <20130602154918.GA28252@notvery> > > If any template variable expansion were HTML escaped, would that work? > > Are there any variables which expand with a color sequence already? > > It's typical use StdinReader (and XmonadProp) values with color markup > to highlight the current workspace number; we would break those usage > cases if we HTML-escape the received string. I suspect Pipe is used in > similar ways too. But perhaps i'm missing your point? the html escape will be used by for example xmonad to escape the window-title and for example mark the current window-page without escape (2 escaped_by_xmonad_the_window_title xmonaduptime) but the xmobar-parse should reverse the escaping after markuping (for example: coloring) that would be backward-compatible and easy to implement into xmonad-config and xmobar. xmobar-example: ------------------- import Web.Encodings ... main = do xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmobarrc" ..... logHook = dynamicLogWithPP $ xmobarPP { ppOutput = hPutStrLn xmproc , ppTitle = xmobarColor "green" "" . shorten 50 . encodeHtml } -------------- > > An alternative to address the specific window title problem could also > be providing a CurrentWindowTitle plugin. not so good idea bye, Artur From jao at gnu.org Sun Jun 2 21:26:52 2013 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Sun, 02 Jun 2013 22:26:52 +0200 Subject: bug: icon endless read In-Reply-To: <20130602154918.GA28252@notvery> (Artur Zimmer's message of "Sun, 2 Jun 2013 17:49:19 +0200") References: <20130529192243.GB11357@notvery> <87zjv945ao.fsf@gnu.org> <20130602154918.GA28252@notvery> Message-ID: <87ehck45tf.fsf@gnu.org> On Sun, Jun 02 2013, Artur Zimmer wrote: >> > If any template variable expansion were HTML escaped, would that work? >> > Are there any variables which expand with a color sequence already? >> >> It's typical use StdinReader (and XmonadProp) values with color markup >> to highlight the current workspace number; we would break those usage >> cases if we HTML-escape the received string. I suspect Pipe is used in >> similar ways too. But perhaps i'm missing your point? > > the html escape will be used by for example xmonad to escape the > window-title and for example mark the current window-page without > escape (2 escaped_by_xmonad_the_window_title > xmonaduptime) > > but the xmobar-parse should reverse the escaping after markuping (for > example: coloring) A window title can contain literal HTML escapes. For this to work, you're imposing on the user the obligation, that she doesn't have now, of escaping what's passed to xmobar. That's not transparent. From jao at gnu.org Sun Jun 2 21:30:02 2013 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Sun, 02 Jun 2013 22:30:02 +0200 Subject: bug: icon endless read In-Reply-To: <20130602154918.GA28252@notvery> (Artur Zimmer's message of "Sun, 2 Jun 2013 17:49:19 +0200") References: <20130529192243.GB11357@notvery> <87zjv945ao.fsf@gnu.org> <20130602154918.GA28252@notvery> Message-ID: <87a9n845o5.fsf@gnu.org> On Sun, Jun 02 2013, Artur Zimmer wrote: [...] > that would be backward-compatible and easy to implement into > xmonad-config and xmobar. that would oblige xmonad users to change their configuration. more importantly, users of other window managers would be affected too, without a ready-to-hand solution. on the other hand, if it's really easy to implement in xmobar and someone sends a patch, i'll be happy to include it in the distribution, although i'll probably provide it as an opt-in configuration parameter in StdinReader. From jao at gnu.org Sun Jun 2 21:38:11 2013 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Sun, 02 Jun 2013 22:38:11 +0200 Subject: bug: icon endless read In-Reply-To: <20130602154918.GA28252@notvery> (Artur Zimmer's message of "Sun, 2 Jun 2013 17:49:19 +0200") References: <20130529192243.GB11357@notvery> <87zjv945ao.fsf@gnu.org> <20130602154918.GA28252@notvery> Message-ID: <8738t045ak.fsf@gnu.org> >> An alternative to address the specific window title problem could also >> be providing a CurrentWindowTitle plugin. > > not so good idea care to explain why do you think so? on the user side, it'd be a solution needing less changes to their setup, and usable out of the box in any window manager. what are the downsides you see? From jao at gnu.org Wed Jun 5 00:12:46 2013 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Wed, 05 Jun 2013 01:12:46 +0200 Subject: 0.18 released References: <20130529192243.GB11357@notvery> <87zjv945ao.fsf@gnu.org> Message-ID: <87li6pxyfl.fsf_-_@gnu.org> I've made a quick release of version 0.18, which deactivates markup in StdinReader and XmonadProp to avoid injections from funny webpages that codify a mouse action in their titles. Of course that's only a quick hack and not a neat solution to the generic problem of what to do with markup in those inputs, which we're discussing on a separtate thread. Upgrade recommended :) Cheers, jao From artur128 at 3dzimmer.de Thu Jun 6 12:57:57 2013 From: artur128 at 3dzimmer.de (Artur Zimmer) Date: Thu, 6 Jun 2013 13:57:57 +0200 Subject: bug: icon endless read In-Reply-To: <8738t045ak.fsf@gnu.org> References: <20130529192243.GB11357@notvery> <87zjv945ao.fsf@gnu.org> <20130602154918.GA28252@notvery> <8738t045ak.fsf@gnu.org> Message-ID: <20130606115756.GA20976@notvery> > >> An alternative to address the specific window title problem could also > >> be providing a CurrentWindowTitle plugin. > > > > not so good idea > > care to explain why do you think so? on the user side, it'd be a > solution needing less changes to their setup, and usable out of the box > in any window manager. what are the downsides you see? for the window-manager it must be possible to change the color/icon/action in xmobar ... but text that came from other "apps" like window-title must be escaped by the window-manager, he is the only one who knows the active window The only pipe i know, between window-manager and xmobar, is the Stdin. So how do you wanne split CurrentWindowTitle and WindowManagerInformations(like active window-page) via Stdin? bye, Artur From jao at gnu.org Thu Jun 6 16:45:01 2013 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Thu, 06 Jun 2013 17:45:01 +0200 Subject: bug: icon endless read In-Reply-To: <20130606115756.GA20976@notvery> (Artur Zimmer's message of "Thu, 6 Jun 2013 13:57:57 +0200") References: <20130529192243.GB11357@notvery> <87zjv945ao.fsf@gnu.org> <20130602154918.GA28252@notvery> <8738t045ak.fsf@gnu.org> <20130606115756.GA20976@notvery> Message-ID: <87ehcfp7k2.fsf@gnu.org> On Thu, Jun 06 2013, Artur Zimmer wrote: >> >> An alternative to address the specific window title problem could also >> >> be providing a CurrentWindowTitle plugin. >> > >> > not so good idea >> >> care to explain why do you think so? on the user side, it'd be a >> solution needing less changes to their setup, and usable out of the box >> in any window manager. what are the downsides you see? > > > for the window-manager it must be possible to change the > color/icon/action in xmobar ... but text that came from other "apps" > like window-title must be escaped by the window-manager, he is the > only one who knows the active window > > The only pipe i know, between window-manager and xmobar, is the Stdin. (There's also XPropertyLog, by which xmobar reads an arbitrary X property, and PipeReader, which reads from a given pipe.) > > So how do you wanne split CurrentWindowTitle and > WindowManagerInformations(like active window-page) via Stdin? By reading the _NET_ACTIVE_WINDOW X atom (which is set by the window manager), one can obtain the id of the currently active window. From there, one can get its title. Unfortunately, i just checked xmonad and, unlike sawfish or openbox, it doesn't seem to set it. We would need to provide a code snippet that sets that property explicitly. jao From artur128 at 3dzimmer.de Tue Jun 11 21:01:21 2013 From: artur128 at 3dzimmer.de (Artur Zimmer) Date: Tue, 11 Jun 2013 22:01:21 +0200 Subject: 0.18 released In-Reply-To: <87li6pxyfl.fsf_-_@gnu.org> References: <20130529192243.GB11357@notvery> <87zjv945ao.fsf@gnu.org> <87li6pxyfl.fsf_-_@gnu.org> Message-ID: <20130611200120.GA4333@notvery> > > I've made a quick release of version 0.18, which deactivates and what about ? is that disabled too? bye, Artur From jao at gnu.org Tue Jun 11 21:09:20 2013 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Tue, 11 Jun 2013 22:09:20 +0200 Subject: 0.18 released In-Reply-To: <20130611200120.GA4333@notvery> (Artur Zimmer's message of "Tue, 11 Jun 2013 22:01:21 +0200") References: <20130529192243.GB11357@notvery> <87zjv945ao.fsf@gnu.org> <87li6pxyfl.fsf_-_@gnu.org> <20130611200120.GA4333@notvery> Message-ID: <8761xkv28f.fsf@gnu.org> On Tue, Jun 11 2013, Artur Zimmer wrote: >> >> I've made a quick release of version 0.18, which deactivates > > and what about ? > > is that disabled too? I'm afraid i forgot that case (i was mainly scared about side effecting action instances). Do you (or anyone else) feel it's worth deactivating? jao From tkpapp at gmail.com Fri Jun 28 09:44:04 2013 From: tkpapp at gmail.com (Tamas Papp) Date: Fri, 28 Jun 2013 10:44:04 +0200 Subject: information for multiple batteries Message-ID: <8738s2vd4b.fsf@tamas.ihs.ac.at> Hi, I have a laptop with 2 batteries (a main one and one in the ultrabay). I am trying to have xmonad display information (at least percentage of charge left, and charge/discharge status) for both. But I could not figure out how to do this, I can use two BatteryP commands but the %battery% alias will always use only one of them. Is there a way to do this with xmobar, or should I just hack something together using external commands and a shell script? Best, Tamas From jao at gnu.org Fri Jun 28 14:28:32 2013 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Fri, 28 Jun 2013 15:28:32 +0200 Subject: information for multiple batteries In-Reply-To: <8738s2vd4b.fsf@tamas.ihs.ac.at> (Tamas Papp's message of "Fri, 28 Jun 2013 10:44:04 +0200") References: <8738s2vd4b.fsf@tamas.ihs.ac.at> Message-ID: <87vc4ygy9r.fsf@gnu.org> Hi Tamas, On Fri, Jun 28 2013, Tamas Papp wrote: > Hi, > > I have a laptop with 2 batteries (a main one and one in the ultrabay). > I am trying to have xmonad display information (at least percentage of > charge left, and charge/discharge status) for both. But I could not > figure out how to do this, I can use two BatteryP commands but the > %battery% alias will always use only one of them. Actually, what BatteryP is doing is showing a combination of the values for all supplied batteries (or at least, that's what the code tries to do). But yes, it doesn't provide separate readings. > Is there a way to do this with xmobar, or should I just hack something > together using external commands and a shell script? There was no way... if you can use the git version of xmobar, i've just pushed a patch that provides BatteryN, which works like BatteryP except that in the configuration you pass a name for the alias; that should allow you set up a monitor per battery. If you have a chance to try it, let me know if it works! Cheers, jao -- Be humble, for you are made of earth. Be noble, for you are made of stars. -Serbian proverb From tkpapp at gmail.com Sun Jun 30 15:06:51 2013 From: tkpapp at gmail.com (Tamas Papp) Date: Sun, 30 Jun 2013 16:06:51 +0200 Subject: information for multiple batteries In-Reply-To: <87vc4ygy9r.fsf@gnu.org> References: <8738s2vd4b.fsf@tamas.ihs.ac.at> <87vc4ygy9r.fsf@gnu.org> Message-ID: <87ehbjoftf.fsf@tamas.ihs.ac.at> Hi Jose, On Fri, Jun 28 2013, jao at gnu.org wrote: > On Fri, Jun 28 2013, Tamas Papp wrote: > >> Is there a way to do this with xmobar, or should I just hack something >> together using external commands and a shell script? > > There was no way... if you can use the git version of xmobar, i've just > pushed a patch that provides BatteryN, which works like BatteryP except > that in the configuration you pass a name for the alias; that should > allow you set up a monitor per battery. If you have a chance to try it, > let me know if it works! Thanks for the quick fix -- I managed to recompile from source and now it works fine. I have a couple of (somewhat unrelated) questions: 1. How can I restart xmobar, eg with a signal? Currently I use $ killall xmobar; ~/.cabal/bin/xmobar 2. Can I start xmobar from xmonad? Using suggestions on the web, my xmonad.hs now looks like this: --8<---------------cut here---------------start------------->8--- import XMonad import XMonad.Hooks.ManageDocks import XMonad.Config.Desktop import XMonad import XMonad.Hooks.DynamicLog (xmobar) main = xmonad =<< xmobar desktopConfig { modMask = mod4Mask , terminal = "xfce4-terminal -e screen" } --8<---------------cut here---------------end--------------->8--- but when xmonad is restarted (Mod4-Q) xmobar is not started, I still have to start it manually. I am using the latest xmonad, xmonad-contrib and xmobar from cabal. 3. I cannot install xmobar with all extensions, because I am missing alsa-core: --8<---------------cut here---------------start------------->8--- ~/src/xmobar$ cabal install -fall_extensions Resolving dependencies... Configuring alsa-core-0.5.0.1... cabal: The pkg-config package alsa version >=1.0.14 is required but it could not be found. Failed to install alsa-core-0.5.0.1 cabal: Error: some packages failed to install: alsa-core-0.5.0.1 failed during the configure step. The exception was: ExitFailure 1 alsa-mixer-0.1.2 depends on alsa-core-0.5.0.1 which failed to install. xmobar-0.18 depends on alsa-core-0.5.0.1 which failed to install. --8<---------------cut here---------------end--------------->8--- What can I do to remedy this (I am on Debian, could not figure out which package to install). Best, Tamas From jao at gnu.org Sun Jun 30 15:33:29 2013 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Sun, 30 Jun 2013 16:33:29 +0200 Subject: information for multiple batteries In-Reply-To: <87ehbjoftf.fsf@tamas.ihs.ac.at> (Tamas Papp's message of "Sun, 30 Jun 2013 16:06:51 +0200") References: <8738s2vd4b.fsf@tamas.ihs.ac.at> <87vc4ygy9r.fsf@gnu.org> <87ehbjoftf.fsf@tamas.ihs.ac.at> Message-ID: <874ncfr7ly.fsf@gnu.org> On Sun, Jun 30 2013, Tamas Papp wrote: [...] > I have a couple of (somewhat unrelated) questions: > > 1. How can I restart xmobar, eg with a signal? Currently I use > > $ killall xmobar; ~/.cabal/bin/xmobar That's the best way i know :) > 2. Can I start xmobar from xmonad? Using suggestions on the web, my > xmonad.hs now looks like this: > > --8<---------------cut here---------------start------------->8--- > import XMonad > import XMonad.Hooks.ManageDocks > import XMonad.Config.Desktop > import XMonad > import XMonad.Hooks.DynamicLog (xmobar) > > main = xmonad =<< xmobar desktopConfig > { modMask = mod4Mask > , terminal = "xfce4-terminal -e screen" > } > --8<---------------cut here---------------end--------------->8--- > > but when xmonad is restarted (Mod4-Q) xmobar is not started, I still > have to start it manually. I am using the latest xmonad, xmonad-contrib > and xmobar from cabal. I don't know of any way. Personally, i use XMonadProp instead of StdinReader, and have a script that (re)starts two xmobar instances; so, in my case, starting/stopping xmobar is totally decoupled from the window manager (which i'm afraid it's the exact opposite of what you want, sorry). > 3. I cannot install xmobar with all extensions, because I am missing > alsa-core: > > --8<---------------cut here---------------start------------->8--- > ~/src/xmobar$ cabal install -fall_extensions > Resolving dependencies... > Configuring alsa-core-0.5.0.1... > cabal: The pkg-config package alsa version >=1.0.14 is required but it could > not be found. > Failed to install alsa-core-0.5.0.1 > cabal: Error: some packages failed to install: > alsa-core-0.5.0.1 failed during the configure step. The exception was: > ExitFailure 1 > alsa-mixer-0.1.2 depends on alsa-core-0.5.0.1 which failed to install. > xmobar-0.18 depends on alsa-core-0.5.0.1 which failed to install. > --8<---------------cut here---------------end--------------->8--- > > What can I do to remedy this (I am on Debian, could not figure out which > package to install). In Debian, libasound2-dev is the one that alsa needs. I'll add a note to xmobar's documentation, since alsa-core doesn't seem to mention it. HTH, jao