Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qbar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jktr
qbar
Commits
70452c0f
Commit
70452c0f
authored
5 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Add update indicator option (--indicator|-i)
parent
31dad3e0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/QBar/Cli.hs
+3
-1
3 additions, 1 deletion
src/QBar/Cli.hs
src/QBar/Server.hs
+2
-2
2 additions, 2 deletions
src/QBar/Server.hs
with
5 additions
and
3 deletions
src/QBar/Cli.hs
+
3
−
1
View file @
70452c0f
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
src/QBar/Server.hs
+
2
−
2
View file @
70452c0f
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment