default commands

Ricard Illa 2021-08-05 09:44:53 +02:00
parent b58336c621
commit 165195cd96
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
1 changed files with 4 additions and 1 deletions

View File

@ -9,15 +9,18 @@ import Monitors.Net (queryNet)
import Monitors.Volume (queryVolume)
usage :: IO String
usage = printf "%s bat | vol | net | date" <$> getProgName
usage = printf "%s bat (acpi_command) | vol (pamixer_command) | net (nmcli_command) | date" <$> getProgName
main :: IO ()
main = do
args <- getArgs
output <- case args of
[ "bat", cmd ] -> queryBattery cmd
[ "bat" ] -> queryBattery "acpi"
[ "vol", cmd ] -> queryVolume cmd
[ "vol" ] -> queryVolume "pamixer"
[ "net", cmd ] -> queryNet cmd
[ "net" ] -> queryNet "nmcli"
[ "date" ] -> queryDate True
[ "date-min" ] -> queryDate False
_ -> usage