wmtools/i3bar_volume_threads.nim

35 lines
675 B
Nim
Raw Normal View History

import i3bar_base
import i3bar_volume
import std/threadpool
import std/osproc
proc await_click_info() =
while true:
let input = parseInput()
case input.button:
of 4:
discard execCmd("pamixer -i 5")
get_volume(true)
clearInput(2)
of 5:
discard execCmd("pamixer -d 5")
get_volume(true)
clearInput(2)
of 1:
discard execCmd("pamixer -t")
get_volume(true)
of 3:
discard execCmd("alacritty -e ncpamixer")
get_volume(true)
else:
let no = false
proc main() =
spawn get_volume()
spawn await_click_info()
sync()
if isMainModule:
main()