diff options
author | Enrico Maria De Angelis <enricomaria.dean6elis@gmail.com> | 2024-05-22 17:56:22 +0100 |
---|---|---|
committer | Enrico Maria De Angelis <enricomaria.dean6elis@gmail.com> | 2024-05-22 17:56:22 +0100 |
commit | 420b7b72deb279ae1d39833145c9a677bf92fe45 (patch) | |
tree | c961918be5eb20fa13f303c68fc850af65fb9b95 /src/Xmobar/Plugins | |
parent | 23b58ee76bd661e1c956625d4e5c3c3b916e767a (diff) | |
download | xmobar-420b7b72deb279ae1d39833145c9a677bf92fe45.tar.gz xmobar-420b7b72deb279ae1d39833145c9a677bf92fe45.tar.bz2 |
Remove 1-arg ctor for ArchUpdates
Diffstat (limited to 'src/Xmobar/Plugins')
-rw-r--r-- | src/Xmobar/Plugins/ArchUpdates.hs | 14 |
1 files changed, 4 insertions, 10 deletions
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 |