xmobar 0.47.2 → 0.47.3
raw patch · 8 files changed
+87/−53 lines, 8 filesdep ~base
Dependency ranges changed: base
Files
- changelog.md +6/−0
- doc/plugins.org +15/−6
- doc/quick-start.org +8/−8
- doc/using-haskell.org +13/−5
- readme.org +30/−29
- src/Xmobar/App/Compile.hs +3/−0
- src/Xmobar/Run/Actions.hs +3/−3
- xmobar.cabal +9/−2
changelog.md view
@@ -1,3 +1,9 @@+## Version 0.47.3 (February, 2024)++- New flag `with_shared` to use xmobar with dynamic linking (see PR #690)+- Fix for actions invoked from recompiled xmobar instances (issue #688)+- Maximum base version bumped to 4.20+ ## Version 0.47.2 (November, 2023) - Compatibility with GHC 9.6
doc/plugins.org view
@@ -16,11 +16,11 @@ to a certain monitor. All Monitors accept a common set of arguments, described below in- [[Default Monitor Arguments]]. Some monitors also accept additional+ [[#default-arguments][Default Monitor Arguments]]. Some monitors also accept additional options that are specific to them. When specifying the list of arguments in your configuration, the common options come first, followed by =--=, followed by any monitor-specific options. For- example, the following [[=Battery Args RefreshRate=][Battery]] configuration first sets the global+ example, the following [[#batteryp-dirs-args-refreshrate][Battery]] configuration first sets the global =template= and =Low= arguments and then specifies the battery-specific =off= option. @@ -60,6 +60,9 @@ brightness value. ** Default monitor arguments+ :PROPERTIES:+ :CUSTOM_ID: default-arguments+ :END: These are the options available for all monitors: @@ -814,6 +817,9 @@ ** Volume monitors *** =Volume Mixer Element Args RefreshRate=+ :PROPERTIES:+ :CUSTOM_ID: volume+ :END: - Aliases to the mixer name and element name separated by a colon. Thus, =Volume "default" "Master" [] 10= can be used as@@ -889,7 +895,7 @@ *** =Alsa Mixer Element Args= - Like [[=Volume Mixer Element Args RefreshRate=][Volume]] but with the following differences:+ Like [[#volume][Volume]] but with the following differences: - Uses event-based refreshing via =alsactl monitor= instead of polling, so it will refresh instantly when there's a volume change, and won't@@ -1355,6 +1361,9 @@ (re)start xmobar outside xmonad. *** =UnsafeXMonadLog=+ :PROPERTIES:+ :CUSTOM_ID: UnsafeXMonadLog+ :END: - Aliases to UnsafeXMonadLog - Displays any text received by xmobar on the =_XMONAD_LOG= atom.@@ -1385,7 +1394,7 @@ - Aliases to =PropName= - Reads the X property named by =PropName= (a string) and displays its- value. The [[../etc/xmonadpropwrite.hs][etc/xmonadpropwrite.hs script]] in xmobar's distribution can be+ value. The [[https://codeberg.org/xmobar/xmobar/src/branch/master/etc/xmonadpropwrite.hs][etc/xmonadpropwrite.hs script]] in xmobar's distribution can be used to set the given property from the output of any other program or script. @@ -1421,7 +1430,7 @@ - Aliases to UnsafeStdinReader - Displays any text received by xmobar on its standard input.- - Similar to [[=UnsafeXMonadLog=][UnsafeXMonadLog]], in the sense that it does not strip any+ - Similar to [[#UnsafeXMonadLog][UnsafeXMonadLog]], in the sense that it does not strip any actions from the received text, only using =stdin= and not a property atom of the root window. Please be equally carefully when using this as when using =UnsafeXMonadLog=!@@ -1480,7 +1489,7 @@ =/tmp/xmobar_status= will reveal xmonad for 1.5 seconds and temporarily overwrite the window titles. - - Take a look at [[../etc/status.sh][etc/status.sh]]+ - Take a look at [[https://codeberg.org/xmobar/xmobar/src/branch/master/etc/status.sh][etc/status.sh]] - Expands environment variables for the pipe path
doc/quick-start.org view
@@ -1,10 +1,10 @@ #+title: Quick start: using xmobar -Xmobar can either be configured using the configuration language, or [[file:using-haskell.org][used as a+Xmobar can either be configured using the configuration language, or [[https://codeberg.org/xmobar/xmobar/src/branch/master/doc/using-haskell.org][used as a Haskell library]] (similar to xmonad) and compiled with your specific configuration. For an example of a configuration file using the plain-configuration language, see [[../etc/xmobar.config][etc/xmobar.config]], and you can have a look at-[[../etc/xmobar.hs][etc/xmobar.hs]] for an example of how to write your own xmobar using Haskell.+configuration language, see [[https://codeberg.org/xmobar/xmobar/src/branch/master/etc/xmobar.config][etc/xmobar.config]], and you can have a look at+[[https://codeberg.org/xmobar/xmobar/src/branch/master/etc/xmobar.hs][etc/xmobar.hs]] for an example of how to write your own xmobar using Haskell. * Command line options @@ -314,7 +314,7 @@ *** Commands and monitors - =commands= The list of monitors and plugins to run, together with their- individual configurations. The [[./plugins.org][plugin documentation]] details all the+ individual configurations. The [[https://codeberg.org/xmobar/xmobar/src/branch/master/doc/plugins.org][plugin documentation]] details all the available monitors, and you can also create new ones using Haskell. See the [[#commands-list][commands list section]] below for more. @@ -381,7 +381,7 @@ will parse the template and search for the command to be executed in the =commands= configuration option. First an =alias= will be searched (some plugins, such as =Weather= or =Network=, have default- aliases, see the [[./plugins.org][plugin documentation]]). After that, the command+ aliases, see the [[https://codeberg.org/xmobar/xmobar/src/branch/master/doc/plugins.org][plugin documentation]]). After that, the command name will be tried. If a command is found, the arguments specified in the =commands= list will be used. @@ -585,7 +585,7 @@ Other options are ~Ansi~, ~Pango~, and ~Swaybar~. ** Showing xmobar output in Emacs tab or mode line Using xmobar's ANSI color text ouput, one can plug it inside Emacs, and- display your monitors in the mode line or the tab bar. The [[../etc/xmobar.el][xmobar.el+ display your monitors in the mode line or the tab bar. The [[https://codeberg.org/xmobar/xmobar/src/branch/master/etc/xmobar.el][xmobar.el package]] provides a simple way of doing it. ** Using xmobar in wayland with swaybar or waybar :PROPERTIES:@@ -629,7 +629,7 @@ dynamically xmobar's size and run it alongside a system tray widget such as trayer or stalonetray (although the idea is not limited to trays, really). For your convenience, there is a version of Jonas' script in- [[../etc/padding-icon.sh][etc/padding-icon.sh]].+ [[https://codeberg.org/xmobar/xmobar/src/branch/master/etc/padding-icon.sh][etc/padding-icon.sh]]. ** Signal handling @@ -642,7 +642,7 @@ * The DBus interface When compiled with the optional =with_dbus= flag, xmobar can be controlled- over dbus. All signals defined in [[../src/Xmobar/System/Signal.hs][src/Signal.hs]] as =data SignalType= can now+ over dbus. All signals defined in [[https://codeberg.org/xmobar/xmobar/src/branch/master/src/Xmobar/System/Signal.hs][src/Signal.hs]] as =data SignalType= can now be sent over dbus to xmobar. Due to current limitations of the implementation only one process of xmobar
doc/using-haskell.org view
@@ -49,6 +49,14 @@ system-wide xmobar, it will notice that you have your own implementation and (re)compile and run it as needed. +* Using dynamic linking++ Setting the =with_shared= flag, which is off by default, enables (re)building+ of xmobar with shared libraries. By default, =xmobar= rebuilds itself with+ static linking, as is the common practice with Haskell programs, but some+ distributions use dynamic linking in their packages, or you might also be so+ inclined. If so, this is your flag.+ * Writing a plugin :PROPERTIES: :CUSTOM_ID: writing-a-plugin@@ -75,8 +83,8 @@ =run= can be used for simpler plugins. If you define only =run= the plugin will be run every second. To overwrite this default you just need to implement =rate=, which must return the number of tenth of seconds between- every successive runs. See [[../etc/xmobar.hs][etc/xmobar.hs]] for an example of a plugin- that runs just once, and [[../src/Xmobar/Plugins/Date.hs][src/Xmobar/Plugins/Date.hs]] for one that+ every successive runs. See [[https://codeberg.org/xmobar/xmobar/src/branch/master/etc/xmobar.hs][etc/xmobar.hs]] for an example of a plugin+ that runs just once, and [[https://codeberg.org/xmobar/xmobar/src/branch/master/src/Xmobar/Plugins/Date.hs][src/Xmobar/Plugins/Date.hs]] for one that implements =rate=. Notice that Date could be implemented as:@@ -107,14 +115,14 @@ If your plugin only implements =alias= and =start=, then it is advisable to put it into the =Xmobar/Plugins/Monitors= directory and use one of the many- =run*= functions in [[../src/Xmobar/Plugins/Monitors/Common/Run.hs][Xmobar.Plugins.Monitors.Run]] in order to define- =start=. The =Exec= instance should then live in [[../src/Xmobar/Plugins/Monitors.hs][Xmobar.Plugins.Monitors]].+ =run*= functions in [[https://codeberg.org/xmobar/xmobar/src/branch/master/src/Xmobar/Plugins/Monitors/Common/Run.hs][Xmobar.Plugins.Monitors.Run]] in order to define+ =start=. The =Exec= instance should then live in [[https://codeberg.org/xmobar/xmobar/src/branch/master/src/Xmobar/Plugins/Monitors.hs][Xmobar.Plugins.Monitors]]. * Using a plugin To use your new plugin, you just need to use a pure Haskell configuration for xmobar (as explained [[#xmobar-in-haskell][above]]) and load your definitions in your =xmobar.hs=- file. You can see an example in [[../etc/xmobar.hs][etc/xmobar.hs]] showing you how to write+ file. You can see an example in [[https://codeberg.org/xmobar/xmobar/src/branch/master/etc/xmobar.hs][etc/xmobar.hs]] showing you how to write a Haskell configuration that uses a new plugin, all in one file. When xmobar runs with the full path to that Haskell file as its argument
readme.org view
@@ -26,7 +26,7 @@ [[file:doc/screenshots/xmobar-exwm.png]] -Check [[./changelog.md][the change log]] for our release history. We also have an IRC+Check [[src/branch/master/changelog.md][the change log]] for our release history. We also have an IRC channel, ~#xmobar~, at [[ircs://irc.libera.chat][Libera]]. * Breaking news@@ -43,9 +43,9 @@ should be mostly transparent, except for the facts that it's allowed fixing quite a few bugs and that your /font names/ in your configuration, if you used ~xft~ ones, might need to be adapted to Pango's syntax: please see- [[./doc/quick-start.org#fonts][this section of the documentation]] for all the details. If you're+ [[src/branch/master/doc/quick-start.org#fonts][this section of the documentation]] for all the details. If you're compiling your own xmobar, there's a new dependency on libpango (see- [[./doc/compiling.org#c-libraries][C library dependencies]]).+ [[src/branch/master/doc/compiling.org#c-libraries][C library dependencies]]). * Installation :PROPERTIES:@@ -90,7 +90,7 @@ ** Using cabal or stack Xmobar is available from [[http://hackage.haskell.org/package/xmobar/][Hackage]], and you can compile and install it using- =cabal-install=, making sure the [[doc/compiling.org#c-libraries][required C libraries]] are in place. For a+ =cabal-install=, making sure the [[src/branch/master/doc/compiling.org#c-libraries][required C libraries]] are in place. For a full build with all available extensions: #+begin_src shell@@ -105,10 +105,10 @@ Starting with version 0.35.1, xmobar requires at least GHC version 8.4.x. to build. See [[https://codeberg.org/xmobar/xmobar/issues/461][this issue]] for more information. - See [[file:doc/compiling.org#optional-features][here]] for a list of optional compilation flags that will enable some+ See [[src/branch/master/doc/compiling.org#optional-features][here]] for a list of optional compilation flags that will enable some optional plugins. - See [[file:doc/compiling.org][compiling]] for full compilation instructions starting from source.+ See [[src/branch/master/doc/compiling.org][compiling]] for full compilation instructions starting from source. * Running xmobar ** Running xmobar with a configuration file@@ -129,7 +129,7 @@ or =~/.xmobarrc=. All the available command line switches and configuration parameters are- described in [[file:doc/quick-start.org][the quick start guide]] and [[file:doc/plugins.org][the plugins index]].+ described in [[src/branch/master/doc/quick-start.org][the quick start guide]] and [[src/branch/master/doc/plugins.org][the plugins index]]. ** Writing your own xmobar in Haskell @@ -139,7 +139,7 @@ Haskell instead of using a configuration file. (This is very similar to how [[http://xmonad.org][xmonad]] works.) That gives you the ability of using Haskell and its libraries to extend xmobar to your heart's content. If you are a- programmer, take a look [[file:doc/using-haskell.org][here]] to learn more.+ programmer, take a look [[src/branch/master/doc/using-haskell.org][here]] to learn more. ** Running xmobar in text mode @@ -147,24 +147,24 @@ it is possible to redirect xmobar's output to the standard output, optionally with color escape sequences. In this mode, xmobar can be run inside a terminal o console, or its output piped to other applications, and- there is no need for an X11 display. See [[./doc/quick-start.org#text-mode][Running xmobar in text mode]] for- details. Using this mode, you could [[file:doc/quick-start.org#wayland][pipe xmobar's output to, say, swaybar]],- and use it in wayland, or, with the [[./etc/xmobar.el][xmobar.el]] package, show it in Emacs's+ there is no need for an X11 display. See [[src/branch/master/doc/quick-start.org#text-mode][Running xmobar in text mode]] for+ details. Using this mode, you could [[src/branch/master/doc/quick-start.org#wayland][pipe xmobar's output to, say, swaybar]],+ and use it in wayland, or, with the [[src/branch/master/etc/xmobar.el][xmobar.el]] package, show it in Emacs's tab bar. * Configuration and further documentation - If you want to jump straight into running xmobar, head over to the- [[./doc/quick-start.org][quick start guide]].+ [[src/branch/master/doc/quick-start.org][quick start guide]]. - If you want to get a detailed overview of all available plugins and- monitors, visit the [[./doc/plugins.org][plugins index]].+ monitors, visit the [[src/branch/master/doc/plugins.org][plugins index]]. - For more information on how to use xmobar as a Haskell library see the- [[file:doc/using-haskell.org][using Haskell guide]].+ [[src/branch/master/doc/using-haskell.org][using Haskell guide]]. - If you want to know how to contribute to the xmobar project, check out- [[contributing.org][contributing]].+ [[src/branch/master/contributing.org][contributing]]. * Authors and credits @@ -176,20 +176,21 @@ Alshiekh, Alex Ameen, Axel Angel, Dhananjay Balan, Claudio Bley, Dragos Boca, Ben Boeckel, Ivan Brennan, Duncan Burke, Roman Cheplyaka, Patrick Chilton, Antoine Eiche, Nathaniel Wesley Filardo, Guy Gastineau, John- Goerzen, Jonathan Grochowski, Patrick Günther, Reto Hablützel, Juraj Hercek,- Tomáš Janoušek, Ada Joule, Spencer Janssen, Roman Joost, Pavel Kalugin,- Jochen Keil, Sam Kirby, Lennart Kolmodin, Krzysztof Kosciuszkiewicz, Dmitry- Kurochkin, Todd Lunter, Vanessa McHale, Robert J. Macomber, Dmitry Malikov,- David McLean, Joan Milev, Marcin Mikołajczyk, Dino Morelli, Tony Morris,- Eric Mrak, Thiago Negri, Edward O'Callaghan, Svein Ove, Martin Perner, Jens- Petersen, Alexander Polakov, Sibi Prabakaran, Pavan Rikhi, Petr Rockai,- Andrew Emmanuel Rosa, Sackville-West, Amir Saeid, Markus Scherer, Daniel- Schüssler, Olivier Schneider, Alexander Shabalin, Valentin Shirokov, Peter- Simons, Alexander Solovyov, Will Song, John Soo, John Soros, Felix Springer,- Travis Staton, Artem Tarasov, Samuli Thomasson, Edward Tjörnhammar, Sergei- Trofimovich, Thomas Tuegel, John Tyree, Jan Vornberger, Anton Vorontsov,- Daniel Wagner, Zev Weiss, Phil Xiaojun Hu, Nikolay Yakimov, Edward Z. Yang,- Leo Zhang, Norbert Zeh, and Michał Zielonka.+ Goerzen, Jonathan Grochowski, Patrick Günther, Reto Hablützel, Corey Halpin,+ Juraj Hercek, Jaroslaw Jantura, Tomáš Janoušek, Ada Joule, Spencer Janssen,+ Roman Joost, Pavel Kalugin, Jochen Keil, Sam Kirby, Lennart Kolmodin,+ Krzysztof Kosciuszkiewicz, Dmitry Kurochkin, Todd Lunter, Vanessa McHale,+ Robert J. Macomber, Dmitry Malikov, David McLean, Joan Milev, Marcin+ Mikołajczyk, Dino Morelli, Tony Morris, Eric Mrak, Thiago Negri, Edward+ O'Callaghan, Svein Ove, Martin Perner, Jens Petersen, Alexander Polakov,+ Sibi Prabakaran, Pavan Rikhi, Petr Rockai, Andrew Emmanuel Rosa,+ Sackville-West, Amir Saeid, Markus Scherer, Daniel Schüssler, Olivier+ Schneider, Alexander Shabalin, Valentin Shirokov, Peter Simons, Alexander+ Solovyov, Will Song, John Soo, John Soros, Felix Springer, Travis Staton,+ Artem Tarasov, Samuli Thomasson, Edward Tjörnhammar, Sergei Trofimovich,+ Thomas Tuegel, John Tyree, Jan Vornberger, Anton Vorontsov, Daniel Wagner,+ Zev Weiss, Phil Xiaojun Hu, Nikolay Yakimov, Edward Z. Yang, Leo Zhang,+ Norbert Zeh, and Michał Zielonka. Andrea wants to thank Robert Manea and Spencer Janssen for their help in understanding how X works. They gave him suggestions on how to solve many
src/Xmobar/App/Compile.hs view
@@ -168,6 +168,9 @@ #ifdef RTSOPTS ++ ["-rtsopts", "-with-rtsopts", "-V0"] #endif+#ifdef SHARED_LIBRARIES+ ++ ["-dynamic"]+#endif ++ ["-o", bin] runGHC bin = runProc "ghc" (opts bin) runScript script bin = runProc script [bin]
src/Xmobar/Run/Actions.hs view
@@ -16,7 +16,7 @@ , runAction' , stripActions) where -import System.Process (system)+import System.Process (spawnCommand) import Control.Monad (void) import Text.Regex (Regex, subRegex, mkRegex, matchRegex) import Data.Word (Word32)@@ -26,11 +26,11 @@ data Action = Spawn [Button] String deriving (Eq, Read, Show) runAction :: Action -> IO ()-runAction (Spawn _ s) = void $ system (s ++ "&")+runAction (Spawn _ s) = void $ spawnCommand s -- | Run action with stdout redirected to stderr runAction' :: Action -> IO ()-runAction' (Spawn _ s) = void $ system (s ++ " 1>&2 &")+runAction' (Spawn _ s) = void $ spawnCommand (s ++ " 1>&2") stripActions :: String -> String stripActions s = case matchRegex actionRegex s of
xmobar.cabal view
@@ -1,5 +1,5 @@ name: xmobar-version: 0.47.2+version: 0.47.3 homepage: https://codeberg.org/xmobar/xmobar synopsis: A Minimalistic Text Based Status Bar description: Xmobar is a minimalistic text based status bar.@@ -84,6 +84,10 @@ description: Use -with-rtsopts=-V0 to reduce wakeups. default: True +flag with_shared+ description: Use shared libraries. Required when dependencies are built as shared libraries.+ default: False+ flag with_weather description: Enable weather plugin. default: True@@ -194,7 +198,7 @@ build-depends: aeson >= 1.4.7.1, async,- base >= 4.11.0 && < 4.19,+ base >= 4.11.0 && < 4.20, bytestring >= 0.10.8.2, cairo >= 0.13, colour >= 2.3.6,@@ -231,6 +235,9 @@ if flag(with_rtsopts) cpp-options: -DRTSOPTS++ if flag(with_shared)+ cpp-options: -DSHARED_LIBRARIES if flag(with_xrender) build-depends: X11-xft >= 0.2