Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Conflicts:
readme.md
|
|
Mainly code from my config which does the following:
When I press my modifier key (which is xK_Alt_L) then xmobar appears.
When I keep the key pressed for longer than 400ms (which is often the
when tabbing through windows, changing workspaces, etc), then upon
release xmobar will be hidden immediately. If I press xK_Alt_L for less
than 400ms (very briefly), then xmobar pops up, and will automatically
disappear after 2 seconds.
|
|
Previously Hide, Reveal and Toggle were immediate actions. This is the
same behaviour as if called now with 0 as parameter.
If the parameter is a positive non zero value it is taken as a delay for
the requested action.
After the delay (implemented using threadDelay) a new signal is sent
with zero with no timeout being effective immediately. This is necessary
to evaluate the persistency flag after the delay because it might have
changed in the meantime.
Effectively this means that it is possible to cancel the delayed
operation by calling TogglePersistent.
|
|
Replace MVar with TMVar from the STM package. This is common for ghc
now. Since STM is used everywhere else in the src it also adds no
additional dependencies.
The main reason for this switch is, that readMVar, swapMVar, etc. are
only atomically if there is no other producer for this MVar i.e.
putMVar. For example readMVar is a combination of putMVar and takeMVar.
Due to scheduling and readMVar's non-atomicity it is possible that
values written to the MVar appear in the wrong order.
Using TMVar fixes this problem, since it allows really atomical
read/swap operations.
|
|
It's easy to implement, since arguments to dbus method calls are handed
over as list anyway. It also removes the need for safeHead.
Bottom line: extra functionality without extra cost.
|
|
|
|
Following the discussion of pull request #59 in github.
|
|
Following the discussion of pull request #59 in github.
|
|
Fix build failure: safeHead is needed even when dbus isn't.
|
|
Conflicts:
readme.md
|
|
|
|
When set to True the window is initially not mapped, i.e. hidden. It
then can be toggled manually (for example using the dbus interface) or
automatically (by a plugin) to make it reappear (unhide/reveal).
|
|
The problem was a race condition which occured when running multiple
threads with a small timeout value. Then the TMVar could be left empty.
(e.g. hitting a key which causes an operation to write to the pipe very fast)
This meant that tryTakeTMVar would return Nothing which would cause all
subsequent reset threads to not call cb and keep a stale string on
display.
By using a Maybe String wrapped in a TVar there is always a valid value
available which can be used to restore the display (or not if it's
Nothing, but that's desired then and not because another thread was
scheduled earlier).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is a bash script, so for correctness is needs to be /bin/bash
|
|
Only one process can export the dbus interface at a time.
|
|
I misunderstood the intention of lowerOnStart and changed the
implementation to what I thought it would have to do. This was wrong
indeed, so back to original behaviour.
|
|
This sample script uses colors and unicode signs for drawing a status
bar for e.g. volume. The unicode character can be simply changed to an
ascii one in case of problems.
|
|
The startCommand function is called for every configured plugin. This
results in multiple calls to runIPC. This it not necessary however.
startLoop is a much more appropriate place, since the other signal
handler (checker and eventer) are run here to.
|
|
connectSession throws a ClientError Exception when
DBUS_SESSION_BUS_ADDRESS is unset. Without exception handler this will
result in program termination.
Since the DBus handler merely sends a signal to the event loop it does
no harm when it won't run. Normal operation will continue just if
compiled without dbus support.
|
|
Not everybody has/wants the DBus library so this can be chosen at
compile time.
|
|
|
|
This commit updates the mpris plugin to use the DBus 0.10 interface.
DBus-Core does no longer exist and is deprecated.
DBus 0.10 does not use proxies anymore.
The dependency on Data.Text also disappeared.
Since I do not have/use mpris I cannot test if this works. It should
however, since the functionality was just transformed to use the new
interface.
|
|
|
|
The sample script is quite generic. It works for demo purposes and can
be used as a template for users to write their own scripts.
|
|
|
|
Description for lowerOnStart was missing.
|
|
This commit updates the mpris plugin to use the DBus 0.10 interface.
DBus-Core does no longer exist and is deprecated.
DBus 0.10 does not use proxies anymore.
The dependency on Data.Text also disappeared.
Since I do not have/use mpris I cannot test if this works. It should
however, since the functionality was just transformed to use the new
interface.
|
|
Actually run this stuff
|
|
This belongs here, otherwise ghc will complain about orphaned instances
|
|
safeHead is a very general utility function with suits better into a
common Util module.
|
|
|
|
Not everybody has/wants the DBus library so this can be chosen at
compile time.
|
|
By sending a TogglePersistent signal the configuration option
"persistent" can be changed. Thus it is possible to hide or show xmobar
constantly.
|
|
When persistent is set to True then xmobar will always be mapped
(revealed) and never be hidden.
The flag is checked in eventLoop and operation to map/unmap windows is
not carried out if persistence is desired.
|
|
The window became hidden although the toggling behaviour was set to
False for a particular pipe. This fixes this behaviour and hides the
window only if the configuration option is set to True.
|
|
This solves a problem when there is only one pipe in place. With a
default value of "" and only one pipe with a timeout the value is
overwritten with "" after the timeout. To prevent this from happening a
TMVar is used which will never be filled if there is only one pipe.
|
|
Using the trigger method activity on a pipe can now cause the window to
appear (reveal) and disappear again after a given timeout. The timeout
for hiding the window is the same as for restoring the pipes content.
The timeout value is given in tenth of seconds.
|
|
Realign methods, remove unnecessary imports and remove clutter
|