diff --git a/bumblebee-status b/bumblebee-status index 6b5c78e..2616094 100755 --- a/bumblebee-status +++ b/bumblebee-status @@ -34,7 +34,7 @@ def main(): filename=config.logfile() ) - theme = bumblebee.theme.Theme(config.theme()) + theme = bumblebee.theme.Theme(config.theme(), config.iconset()) output = bumblebee.output.I3BarOutput(theme=theme) inp = bumblebee.input.I3BarInput() engine = None diff --git a/bumblebee/config.py b/bumblebee/config.py index 9207c77..a70fe6b 100644 --- a/bumblebee/config.py +++ b/bumblebee/config.py @@ -59,6 +59,8 @@ def create_parser(): help=DEBUG_HELP) parser.add_argument("-f", "--logfile", default="~/bumblebee-status-debug.log", help="Location of the debug log file") + parser.add_argument("-i", "--iconset", default="auto", + help="Specify the name of an iconset to use (overrides theme default)") return parser @@ -91,6 +93,10 @@ class Config(bumblebee.store.Store): """Return the name of the selected theme""" return self._args.theme + def iconset(self): + """Return the name of a user-specified icon-set""" + return self._args.iconset + def debug(self): return self._args.debug diff --git a/bumblebee/theme.py b/bumblebee/theme.py index 2d632c4..a9c5e3b 100644 --- a/bumblebee/theme.py +++ b/bumblebee/theme.py @@ -38,12 +38,13 @@ def themes(): class Theme(object): """Represents a collection of icons and colors""" - def __init__(self, name): + def __init__(self, name, iconset): self._widget = None self._cycle_idx = 0 self._cycle = {} self._prevbg = None self._colorset = {} + self._iconset = iconset self.load_symbols() @@ -77,8 +78,11 @@ class Theme(object): def _init(self, data): """Initialize theme from data structure""" self._theme = data - for iconset in data.get("icons", []): - self._merge(data, self._load_icons(iconset)) + if self._iconset != "auto": + self._merge(data, self._load_icons(self._iconset)) + else: + for iconset in data.get("icons", []): + self._merge(data, self._load_icons(iconset)) for colorset in data.get("colors", []): self._merge(self._colorset, self._load_colors(colorset)) self._defaults = data.get("defaults", {}) diff --git a/themes/icons/ionicons.json b/themes/icons/ionicons.json new file mode 100644 index 0000000..8c550d9 --- /dev/null +++ b/themes/icons/ionicons.json @@ -0,0 +1,139 @@ +{ + "defaults": { + "separator": "\ue0b2", "padding": "\u3000", + "unknown": { "prefix": "\uf100" } + }, + "date": { "prefix": "\uf2d1" }, + "time": { "prefix": "\uf3b3" }, + "datetime": { "prefix": "\uf3b3" }, + "memory": { "prefix": "\uf389" }, + "cpu": { "prefix": "\uf4b0" }, + "disk": { "prefix": "\u26c1" }, + "dnf": { "prefix": "\uf2be" }, + "pacman": { "prefix": "\uf2be" }, + "brightness": { "prefix": "\u263c" }, + "load": { "prefix": "\uf13d" }, + "layout": { "prefix": "\uf38c" }, + "layout-xkb": { "prefix": "\uf38c" }, + "todo": { "empty": {"prefix": "\uf453" }, + "items": {"prefix": "\uf454" }, + "uptime": {"prefix": "\uf4c1" } + }, + "zpool": { + "poolread": {"prefix": "\u26c1\uf3d6"}, + "poolwrite": {"prefix": "\u26c1\uf3d5"}, + "ONLINE": {"prefix": "\u26c1"}, + "FAULTED": {"prefix": "\u26c1\uf3bc"}, + "DEGRADED": {"prefix": "\u26c1\uf3bc"} + }, + "cmus": { + "playing": { "prefix": "\uf488" }, + "paused": { "prefix": "\uf210" }, + "stopped": { "prefix": "\uf24f" }, + "prev": { "prefix": "\uf4ab" }, + "next": { "prefix": "\uf4ad" }, + "shuffle-on": { "prefix": "\uf4a8" }, + "shuffle-off": { "prefix": "\uf453" }, + "repeat-on": { "prefix": "\uf459" }, + "repeat-off": { "prefix": "\uf30f" } + }, + "gpmdp": { + "playing": { "prefix": "\uf488" }, + "paused": { "prefix": "\uf210" }, + "stopped": { "prefix": "\uf24f" }, + "prev": { "prefix": "\uf4ab" }, + "next": { "prefix": "\uf4ad" } + }, + "pasink": { + "muted": { "prefix": "\uf3b9" }, + "unmuted": { "prefix": "\uf3ba" } + }, + "amixer": { + "muted": { "prefix": "\uf3b9" }, + "unmuted": { "prefix": "\uf3ba" } + }, + "pasource": { + "muted": { "prefix": "\uf3b9" }, + "unmuted": { "prefix": "\uf3ba" } + }, + "kernel": { + "prefix": "\uf17c" + }, + "nic": { + "wireless-up": { "prefix": "\uf25c" }, + "wireless-down": { "prefix": "\uf3d0" }, + "wired-up": { "prefix": "\u26fc" }, + "wired-down": { "prefix": "\uf270" }, + "tunnel-up": { "prefix": "\uf133" }, + "tunnel-down": { "prefix": "\uf306" } + }, + "bluetooth": { + "ON": { "prefix": "\uf116" }, + "OFF": { "prefix": "\uf116" }, + "?": { "prefix": "\uf116" } + }, + "battery": { + "charged": { "prefix": "\uf113", "suffix": "\u26b1" }, + "AC": { "suffix": "\u26b1" }, + "charging": { + "prefix": [ "\uf112", "\uf115", "\uf114", "", "\uf113" ], + "suffix": "\u26b1" + }, + "discharging-10": { "prefix": "\uf112", "suffix": "\uf3bc" }, + "discharging-25": { "prefix": "\uf115", "suffix": "\uf3e6" }, + "discharging-50": { "prefix": "\uf115", "suffix": "\uf3e6" }, + "discharging-80": { "prefix": "\uf114", "suffix": "\uf3e6" }, + "discharging-100": { "prefix": "\uf113", "suffix": "\uf3e6" }, + "unlimited": { "prefix": "\uf402", "suffix": "\u26b1" }, + "estimate": { "prefix": "\uf402" } + }, + "caffeine": { + "activated": {"prefix": "\uf272\uf354" }, "deactivated": { "prefix": "\uf272\uf355" } + }, + "xrandr": { + "on": { "prefix": "\uf465\uf354"}, "off": { "prefix": "\uf465\uf355" } + }, + "redshift": { + "day": { "prefix": "\uf4b6" }, "night": { "prefix": "\uf467" }, "transition": { "prefix": "\uf475" } + }, + "sensors": { + "prefix": "\uf3b6" + }, + "traffic":{ + "rx": { "prefix": "\uf365" }, + "tx": { "prefix": "\uf35f" } + }, + "mpd": { + "playing": { "prefix": "\uf488" }, + "paused": { "prefix": "\uf210" }, + "stopped": { "prefix": "\uf24f" }, + "prev": { "prefix": "\uf4ab" }, + "next": { "prefix": "\uf4ad" }, + "shuffle-on": { "prefix": "\uf4a8" }, + "shuffle-off": { "prefix": "\uf453" }, + "repeat-on": { "prefix": "\uf459" }, + "repeat-off": { "prefix": "\uf30f" } + }, + "github": { + "prefix": "\uf233" + }, + "hipchat": { + "prefix": "\uf11c" + }, + "spotify": { + "prefix": "\uf305" + }, + "publicip": { + "prefix": "\uf268" + }, + "weather": { + "clouds": { "prefix": "\uf12b" }, + "rain": { "prefix": "\uf495" }, + "snow": { "prefix": "\uf4ae" }, + "clear": { "prefix": "\uf3b0" }, + "thunder": { "prefix": "\uf4bd" } + }, + "taskwarrior": { + "prefix": "\uf454" + } +}