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
2a2cd827
Commit
2a2cd827
authored
5 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Move blocks that require external scripts from default- to legacy config
parent
0ae35d02
No related branches found
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
+9
-2
9 additions, 2 deletions
src/QBar/Cli.hs
src/QBar/DefaultConfig.hs
+19
-3
19 additions, 3 deletions
src/QBar/DefaultConfig.hs
with
28 additions
and
5 deletions
src/QBar/Cli.hs
+
9
−
2
View file @
2a2cd827
...
...
@@ -67,7 +67,14 @@ barConfigurationParser = do
l
->
sequence_
l
blockParser
::
Parser
(
BarIO
()
)
blockParser
=
h
subparser
(
command
"default"
(
info
(
pure
defaultBarConfig
)
(
progDesc
"Load default set of
blocks
."
))
<>
blockParser
=
subparser
(
command
Group
"Available
blocks
:"
<>
command
"date"
(
info
(
pure
$
addBlock
dateBlock
)
(
progDesc
"Load the date and time block."
))
)
<|>
subparser
(
hidden
<>
commandGroup
"Available presets:"
<>
command
"default"
(
info
(
pure
defaultBarConfig
)
(
progDesc
"Load default set of blocks."
))
<>
command
"legacy"
(
info
(
pure
legacyBarConfig
)
(
progDesc
"Load the legacy configuration. Requires some custom block scripts."
))
)
This diff is collapsed.
Click to expand it.
src/QBar/DefaultConfig.hs
+
19
−
3
View file @
2a2cd827
...
...
@@ -8,13 +8,26 @@ import Pipes
import
Control.Lens
blockLocation
::
String
->
FilePath
blockLocation
name
=
"~/.config/qbar/blocks/"
<>
name
defaultBarConfig
::
BarIO
()
defaultBarConfig
=
do
systemInfoInterval
<-
sharedInterval
10
let
battery
=
systemInfoInterval
$
batteryBlock
>->
modify
(
blockName
?~
"battery"
)
let
cpuUsage
=
systemInfoInterval
$
cpuUsageBlock
1
>->
modify
((
blockName
?~
"cpuUsage"
)
.
addIcon
"💻
\xFE0E
"
)
-- TODO: commented-out blocks should be added as soon as they are implemented in qbar
addBlock
dateBlock
addBlock
battery
--addBlock volumeBlock
addBlock
cpuUsage
--addBlock ramUsageBlock
--addBlock cpuTemperatureBlock
--addBlock networkBlock
legacyBarConfig
::
BarIO
()
legacyBarConfig
=
do
systemInfoInterval
<-
sharedInterval
10
let
todo
=
systemInfoInterval
(
blockScript
$
blockLocation
"todo"
)
let
wifi
=
systemInfoInterval
$
(
blockScript
$
blockLocation
"wifi2"
)
>->
modify
(
addIcon
"📡
\xFE0E
"
)
let
networkEnvironment
=
systemInfoInterval
(
blockScript
$
blockLocation
"network-environment"
)
...
...
@@ -33,3 +46,6 @@ defaultBarConfig = do
addBlock
networkEnvironment
addBlock
wifi
addBlock
todo
where
blockLocation
::
String
->
FilePath
blockLocation
name
=
"~/.config/qbar/blocks/"
<>
name
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