summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/plugins.org7
-rw-r--r--src/Xmobar/Plugins/ArchUpdates.hs14
2 files changed, 4 insertions, 17 deletions
diff --git a/doc/plugins.org b/doc/plugins.org
index a1567c3..e5bf42a 100644
--- a/doc/plugins.org
+++ b/doc/plugins.org
@@ -1369,13 +1369,6 @@
"<fc=red>? updates</fc>")
600
#+end_src
-*** =ArchUpdates Rate=
- Same as (see above for ~ArchUpdates'~):
- #+begin_src haskell
- ArchUpdates' ("up to date",
- "1 update available",
- "? updates available") Rate
- #+end_src
* Interfacing with window managers
:PROPERTIES:
:CUSTOM_ID: interfacing-with-window-managers
diff --git a/src/Xmobar/Plugins/ArchUpdates.hs b/src/Xmobar/Plugins/ArchUpdates.hs
index a8cf3a9..f803d0f 100644
--- a/src/Xmobar/Plugins/ArchUpdates.hs
+++ b/src/Xmobar/Plugins/ArchUpdates.hs
@@ -21,19 +21,13 @@ import System.Process (readProcessWithExitCode)
import Xmobar.Run.Exec
import Xmobar.Plugins.Command (Rate)
-data ArchUpdates = ArchUpdates Rate
- | ArchUpdates' (String, String, String) Rate
+data ArchUpdates = ArchUpdates (String, String, String) Rate
deriving (Read, Show)
instance Exec ArchUpdates where
- alias (ArchUpdates _) = "arch"
- alias (ArchUpdates' _ _) = "arch"
- rate (ArchUpdates r) = r
- rate (ArchUpdates' _ r) = r
- run (ArchUpdates r) = run (ArchUpdates' ("up to date",
- "1 update available",
- "? updates available") r)
- run (ArchUpdates' (z, o, m) _) = do
+ alias (ArchUpdates _ _) = "arch"
+ rate (ArchUpdates _ r) = r
+ run (ArchUpdates (z, o, m) _) = do
(exit, stdout, _) <- readProcessWithExitCode "checkupdates" [] ""
return $ case exit of
ExitFailure 2 -> z--ero updates