blob: ade70193246c3514a6812939db03154ad41f1e53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!@lua@/bin/lua
local lsdbus = require("lsdbus")
local music = dofile"@out@/lib/util/music.lua"
local brightness = dofile"@out@/lib/util/brightness.lua"
local volume = dofile"@out@/lib/util/volume.lua"
local b = lsdbus.open()
local s = lsdbus.open("system")
if arg[1] == "music" then
if arg[2] == "toggle" then
music.toggle_play(b)
elseif arg[2] == "next" then
music.next_song(b)
elseif arg[2] == "prev" then
music.prev_song(b)
end
elseif arg[1] == "brightness" then
if arg[2] == "up" then
brightness.brightness_up(s)
elseif arg[2] == "down" then
brightness.brightness_down(s)
else
error(("arg[2] '%s' incorrect format. Should be `up` or `down`"):format(tostring(arg[2])))
end
elseif arg[1] == "volume" then
if arg[2] == "up" then
volume.volume_up()
elseif arg[2] == "down" then
volume.volume_down()
else
error(("arg[2] '%s' incorrect format. Should be `up` or `down`"):format(tostring(arg[2])))
end
end
|