diff --git a/src/QBar/Cli.hs b/src/QBar/Cli.hs index 294dfe884d4707cb00b0902d1c17e37a4992304c..e4d522b70bc6b3d10ee47aad33cd35cf3f5bd329 100644 --- a/src/QBar/Cli.hs +++ b/src/QBar/Cli.hs @@ -16,6 +16,7 @@ barCommandParser = hsubparser data MainOptions = MainOptions { verbose :: Bool, + indicator :: Bool, socketLocation :: Maybe T.Text, barCommand :: BarCommand } @@ -23,9 +24,10 @@ data MainOptions = MainOptions { mainOptionsParser :: Parser MainOptions mainOptionsParser = do verbose <- switch $ long "verbose" <> short 'v' <> help "Print more diagnostic output to stderr (including a copy of every bar update)." + indicator <- switch $ long "indicator" <> short 'i' <> help "Show render indicator." socketLocation <- optional $ strOption $ long "socket" <> short 's' <> metavar "SOCKET" <> help "Control socket location. By default determined by WAYLAND_SOCKET location." barCommand <- barCommandParser - return MainOptions {verbose, socketLocation, barCommand} + return MainOptions {verbose, indicator, socketLocation, barCommand} parser :: ParserInfo MainOptions parser = info (mainOptionsParser <**> helper) diff --git a/src/QBar/Server.hs b/src/QBar/Server.hs index efc1ce6cce277a3bac1f7b613ecda9f578f53b5d..8828796291847ce4b82a041ba78c1d391413ee28 100644 --- a/src/QBar/Server.hs +++ b/src/QBar/Server.hs @@ -172,7 +172,7 @@ runBarConfiguration generateBarConfig options = do let initialBlocks = [date] -- Attach spinner indicator when verbose flag is set - let initialBlocks' = if verbose options then initialBlocks <> [createBlock "*"] else initialBlocks + let initialBlocks' = if indicator options then initialBlocks <> [createBlock "*"] else initialBlocks -- Render initial time block so the bar is not empty after startup initialOutput <- renderLine options handle initialBlockFilter initialBlocks' "" @@ -182,7 +182,7 @@ runBarConfiguration generateBarConfig options = do blockProducers <- generateBarConfig barUpdateChannel -- Attach spinner indicator when verbose flag is set - let blockProducers' = if verbose options then blockProducers <> [renderIndicator] else blockProducers + let blockProducers' = if indicator options then (renderIndicator:blockProducers) else blockProducers -- Create channel to send new block producers to render loop newBlockProducers <- newTChanIO