Discussion:
[xmonad] Termite does not work as scratchpad
e***@gmail.com
2017-10-08 14:01:57 UTC
Permalink
Hello,

I am interested in using the Termite terminal as my scratchpad
but it doesn't actually work as a scratchpad and I'm wondering why.

It seems unable to float. Gnome terminal has the same behavior for
me and apparently Termite uses the same foundation as Gnome terminal.

So I'm wondering if it is a short coming of the terminal or if there is
something I can do to make it work.

Has anyone got this working ?

Thanks,

Eric
Brandon Allbery
2017-10-08 19:41:38 UTC
Permalink
Can you show how you're configuring the scratchpad?

In general, terminals --- especially the VTE-based ones --- have extra
"gotchas" as described at
https://wiki.haskell.org/Xmonad/General_xmonad.hs_config_tips#Terminal_emulator_factories
. It takes some care to both get the scratchpad to behave *and* not have
every terminal be thought a scratchpad.
Post by e***@gmail.com
Hello,
I am interested in using the Termite terminal as my scratchpad
but it doesn't actually work as a scratchpad and I'm wondering why.
It seems unable to float. Gnome terminal has the same behavior for
me and apparently Termite uses the same foundation as Gnome terminal.
So I'm wondering if it is a short coming of the terminal or if there is
something I can do to make it work.
Has anyone got this working ?
Thanks,
Eric
_______________________________________________
xmonad mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
--
brandon s allbery kf8nh sine nomine associates
***@gmail.com ***@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
e***@gmail.com
2017-10-10 17:58:43 UTC
Permalink
That's interesting. I don't see a --disable-factory option for
termite. I don't have gnome terminal installed at the moment to see
what it's options are.


Sure. Here's what I have. I'm used both named scratchpad and
scratchpad. I set myTerminal to urxvt which works fine.
If I set it to Termite it acts very strangely.

urxvt is currently hard coded for the regular scratchpad but it acts the
same way if I change it to termite.



scratchpadSize = W.RationalRect (1/4) (1/4) (1/3) (3/7)
mySPFloat = customFloating scratchpadSize

-- with a flexible location.
flexScratchpadSize dx dy = W.RationalRect (dx) (dy) (1/3) (3/7)
flexFloatSP dx dy = customFloating (flexScratchpadSize dx dy)

scratchpads =
[ NS "term" (myTerminal ++ " -title term") (title =? "term") (flexFloatSP (1/10) (1/10))
, NS "term2" (myTerminal ++ " -title term2") (title =? "term2") (flexFloatSP (1/3) (1/10))
, NS "ghci" (myTerminal ++ " -e ghci") (title =? "ghci") (flexFloatSP (2/3) (1/10))
--, NS "sync" (myTerminal ++ " -e sy") (title =? "sy") (flexFloatSP (1/10) (2/3))
, NS "top" (myTerminal ++ " -e htop") (title =? "htop") (flexFloatSP (1/4) (1/4))
, NS "calc" (myTerminal ++ " -e bc") (title =? "bc") (flexFloatSP (1/4) (1/4))
]

scratchToggle a = namedScratchpadAction scratchpads a >> bringMouse

namedScratchpadsKeymap = -- Scratch Pads
[ ("o", scratchToggle "term") -- Term
, ("e", scratchToggle "term2") -- Term2
, ("g", scratchToggle "ghci") -- ghci
, ("c", scratchToggle "calc") -- calc
, ("t", scratchToggle "top") -- top
, ("k", scratchToggle "mkb") -- matchbox Keyboard
, ("n", scratchpadSpawnActionTerminal "urxvt -background rgba:0000/0000/0200/c800") -- scratchpad
]
Post by Brandon Allbery
Can you show how you're configuring the scratchpad?
In general, terminals --- especially the VTE-based ones --- have extra
"gotchas" as described at
https://wiki.haskell.org/Xmonad/General_xmonad.hs_config_tips#Terminal_emulator_factories
. It takes some care to both get the scratchpad to behave *and* not have
every terminal be thought a scratchpad.
Post by e***@gmail.com
Hello,
I am interested in using the Termite terminal as my scratchpad
but it doesn't actually work as a scratchpad and I'm wondering why.
It seems unable to float. Gnome terminal has the same behavior for
me and apparently Termite uses the same foundation as Gnome terminal.
So I'm wondering if it is a short coming of the terminal or if there is
something I can do to make it work.
Has anyone got this working ?
Thanks,
Eric
_______________________________________________
xmonad mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
Brandon Allbery
2017-10-10 23:50:45 UTC
Permalink
Post by e***@gmail.com
Sure. Here's what I have. I'm used both named scratchpad and
scratchpad. I set myTerminal to urxvt which works fine.
If I set it to Termite it acts very strangely.
xterm and urxvt have a -e option which takes a program to run.
termite / VTE-based terminals usually call this option -x, and -e means
something subtly different.
Post by e***@gmail.com
, ("n", scratchpadSpawnActionTerminal "urxvt -background
rgba:0000/0000/0200/c800") -- scratchpad
Uhhh... can we see namedScratchpadActionTerminal? Beuase if it's what I
think it is, it's your problem. You just wanted a normal scratchpad, or a
program running in a scratchpad terminal like the other ones you have
defined; but the definitions I've seen in the past for
namedScratchpadActionTerminal (generally taken from someone else's config;
it's not standard) will open a default terminal as the scatchpad, passing
to it with -e a command to run urxvt which will *not* be taken as a
scratchpad.
--
brandon s allbery kf8nh sine nomine associates
***@gmail.com ***@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
e***@gmail.com
2017-10-11 05:23:32 UTC
Permalink
It's part of XMonad.Util.Scratchpad

https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Util-Scratchpad.html

https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/src/XMonad-Util-Scratchpad.html

The named scratchpads don't work with termite either. A couple of them
are just terminals with a shell.

Termite uses -e for exec. So that's ok.

Eric
Post by Brandon Allbery
Post by e***@gmail.com
Sure. Here's what I have. I'm used both named scratchpad and
scratchpad. I set myTerminal to urxvt which works fine.
If I set it to Termite it acts very strangely.
xterm and urxvt have a -e option which takes a program to run.
termite / VTE-based terminals usually call this option -x, and -e means
something subtly different.
Post by e***@gmail.com
, ("n", scratchpadSpawnActionTerminal "urxvt -background
rgba:0000/0000/0200/c800") -- scratchpad
Uhhh... can we see namedScratchpadActionTerminal? Beuase if it's what I
think it is, it's your problem. You just wanted a normal scratchpad, or a
program running in a scratchpad terminal like the other ones you have
defined; but the definitions I've seen in the past for
namedScratchpadActionTerminal (generally taken from someone else's config;
it's not standard) will open a default terminal as the scatchpad, passing
to it with -e a command to run urxvt which will *not* be taken as a
scratchpad.
Brandon Allbery
2017-10-11 05:52:58 UTC
Permalink
Post by e***@gmail.com
It's part of XMonad.Util.Scratchpad
Now I have to wonder if my browser is broken; I even did a search on the
page to make sure....

In any case, the description confirms my suspicion: you do not want to use
that here. The purpose of that action is to allow you to more easily run as
a scratchpad something that requires a terminal --- not to use the terminal
itself as a scratchpad. Use the normal scratchpadSpawnAction for that. In
fact, you might want to use scratchpadSpawnActionTerminal for the other
actions instead of this one.
--
brandon s allbery kf8nh sine nomine associates
***@gmail.com ***@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
e***@gmail.com
2017-10-13 17:32:03 UTC
Permalink
It doesn't seem to make any difference which call I use. It doesn't work
either way. It works both ways with urxvt.

All the other calls are actually using named scratchpad, and those calls
are the same as all the examples I've been able to find.

Here's one example. https://pbrisbin.com/posts/scratchpad_everything/

Eric
Post by Brandon Allbery
Post by e***@gmail.com
It's part of XMonad.Util.Scratchpad
Now I have to wonder if my browser is broken; I even did a search on the
page to make sure....
In any case, the description confirms my suspicion: you do not want to use
that here. The purpose of that action is to allow you to more easily run as
a scratchpad something that requires a terminal --- not to use the terminal
itself as a scratchpad. Use the normal scratchpadSpawnAction for that. In
fact, you might want to use scratchpadSpawnActionTerminal for the other
actions instead of this one.
e***@gmail.com
2017-10-14 19:58:55 UTC
Permalink
I found the problem. It was actually really simple. urxvt takes a
-title argument. termite takes a --title argument.

My find function was (title =? "term"). That would fail so that the
window was not recognized as a scratchpad.

Adding the '-' and putting --title on the -e variants fixed all of my
named scratchpads.

Eric
Post by e***@gmail.com
It doesn't seem to make any difference which call I use. It doesn't work
either way. It works both ways with urxvt.
All the other calls are actually using named scratchpad, and those calls
are the same as all the examples I've been able to find.
Here's one example. https://pbrisbin.com/posts/scratchpad_everything/
Eric
Post by Brandon Allbery
Post by e***@gmail.com
It's part of XMonad.Util.Scratchpad
Now I have to wonder if my browser is broken; I even did a search on the
page to make sure....
In any case, the description confirms my suspicion: you do not want to use
that here. The purpose of that action is to allow you to more easily run as
a scratchpad something that requires a terminal --- not to use the terminal
itself as a scratchpad. Use the normal scratchpadSpawnAction for that. In
fact, you might want to use scratchpadSpawnActionTerminal for the other
actions instead of this one.
Loading...