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
4000813b
Commit
4000813b
authored
5 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Use forever
parent
df583c4c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/Main.hs
+1
-1
1 addition, 1 deletion
app/Main.hs
src/QBar/Blocks/Battery.hs
+1
-2
1 addition, 2 deletions
src/QBar/Blocks/Battery.hs
src/QBar/Blocks/Date.hs
+2
-3
2 additions, 3 deletions
src/QBar/Blocks/Date.hs
with
4 additions
and
6 deletions
app/Main.hs
+
1
−
1
View file @
4000813b
...
@@ -3,4 +3,4 @@ module Main where
...
@@ -3,4 +3,4 @@ module Main where
import
QBar.Cli
import
QBar.Cli
main
::
IO
()
main
::
IO
()
main
=
runQBar
main
=
runQBar
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/QBar/Blocks/Battery.hs
+
1
−
2
View file @
4000813b
...
@@ -52,12 +52,11 @@ getBatteryState path = tryMaybe $ do
...
@@ -52,12 +52,11 @@ getBatteryState path = tryMaybe $ do
batteryBlock
::
PullBlock
batteryBlock
::
PullBlock
batteryBlock
=
do
batteryBlock
=
forever
$
do
batteryPaths
<-
liftIO
$
map
((
apiPath
<>
"/"
)
<>
)
.
filter
(
T
.
isPrefixOf
"BAT"
.
T
.
pack
)
<$>
getDirectoryContents
apiPath
batteryPaths
<-
liftIO
$
map
((
apiPath
<>
"/"
)
<>
)
.
filter
(
T
.
isPrefixOf
"BAT"
.
T
.
pack
)
<$>
getDirectoryContents
apiPath
batteryStates
<-
liftIO
$
mapM
getBatteryState
batteryPaths
batteryStates
<-
liftIO
$
mapM
getBatteryState
batteryPaths
isPlugged
<-
liftIO
getPluggedState
isPlugged
<-
liftIO
getPluggedState
updateBatteryBlock
isPlugged
$
catMaybes
batteryStates
updateBatteryBlock
isPlugged
$
catMaybes
batteryStates
batteryBlock
where
where
apiPath
::
FilePath
apiPath
::
FilePath
apiPath
=
"/sys/class/power_supply"
apiPath
=
"/sys/class/power_supply"
...
...
This diff is collapsed.
Click to expand it.
src/QBar/Blocks/Date.hs
+
2
−
3
View file @
4000813b
...
@@ -11,10 +11,9 @@ import Control.Lens
...
@@ -11,10 +11,9 @@ import Control.Lens
dateBlock
::
PushBlock
dateBlock
::
PushBlock
dateBlock
=
do
dateBlock
=
forever
$
do
updateBlock
=<<
liftIO
dateBlockOutput
updateBlock
=<<
liftIO
dateBlockOutput
liftIO
$
sleepUntil
=<<
nextMinute
sleepUntilInterval
everyMinute
dateBlock
dateBlockOutput
::
IO
BlockOutput
dateBlockOutput
::
IO
BlockOutput
...
...
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