1
0
dotfiles/new/i3/i3-togglebar.py
Tom Crossley FEARNLEY 256a1e22f3 new
2020-03-20 01:42:31 +00:00

23 lines
403 B
Python
Executable File

#!/usr/bin/env python3
import i3
import sys
def strToBool(arg):
return arg.lower() in ["true", "1", "show"]
if sys.argv[0] != sys.argv[-1]:
mode = strToBool(sys.argv[1])
else:
mode = None
def toggleBar(mode=None):
if mode is None:
i3.bar('mode', 'toggle')
elif mode:
i3.bar('mode', 'dock')
elif not mode:
i3.bar('mode', 'invisible')
toggleBar(mode)