diff --git a/README.md b/README.md index 1997f35..d039179 100644 --- a/README.md +++ b/README.md @@ -63,20 +63,20 @@ Here are some screenshots for all themes that currently exist: Gruvbox Powerline (`-t gruvbox-powerline`) (contributed by [@paxy97](https://github.com/paxy97)): -![Gruvbox Powerline](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/powerline-gruvbox.png) +![Gruvbox Powerline](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/themes/powerline-gruvbox.png) Solarized Powerline (`-t solarized-powerline`): -![Solarized Powerline](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/powerline-solarized.png) +![Solarized Powerline](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/themes/powerline-solarized.png) Solarized (`-t solarized`): -![Solarized](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/solarized.png) +![Solarized](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/themes/solarized.png) Powerline (`-t powerline`): -![Powerline](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/powerline.png) +![Powerline](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/themes/powerline.png) Default (nothing or `-t default`): -![Default](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/default.png) +![Default](https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/screenshots/themes/default.png) diff --git a/bumblebee/modules/xrandr.py b/bumblebee/modules/xrandr.py new file mode 100644 index 0000000..d5e438b --- /dev/null +++ b/bumblebee/modules/xrandr.py @@ -0,0 +1,54 @@ +import bumblebee.module +import re +import sys +import subprocess + +def description(): + return "Shows all connected screens" + +def parameters(): + return [ + ] + +class Module(bumblebee.module.Module): + def __init__(self, output, config, alias): + super(Module, self).__init__(output, config, alias) + self._state = "off" + + def widgets(self): + process = subprocess.Popen([ "xrandr", "-q" ], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + output, error = process.communicate() + + widgets = [] + + # TODO: sort by position + for line in output.split("\n"): + if not " connected" in line: + continue + screen = line.split(" ", 2)[0] + m = re.search(r'\d+x\d+\+(\d+)\+\d+', line) + + widget = bumblebee.output.Widget(self, screen) + if m: + self._state = "on" + widget.set("pos", int(m.group(1))) + else: + self._state = "off" + widget.set("pos", sys.maxint()); + + widgets.append(widget) + + widgets.sort(key=lambda widget : widget.get("pos")) + + return widgets + + def state(self, widget): + return self._state + + def warning(self, widget): + return False + + def critical(self, widget): + return False + +# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 diff --git a/bumblebee/outputs/i3.py b/bumblebee/outputs/i3.py index ac72855..3a80659 100644 --- a/bumblebee/outputs/i3.py +++ b/bumblebee/outputs/i3.py @@ -51,6 +51,10 @@ class Output(bumblebee.output.Output): "separator_block_width": 0, }) + sep = theme.default_separators(widget) + sep = sep if sep else False + width = theme.separator_block_width(widget) + width = width if width else 0 self._data.append({ u"full_text": "{}{}{}".format( theme.prefix(widget), @@ -61,8 +65,8 @@ class Output(bumblebee.output.Output): "background": theme.background(widget), "name": widget.module(), "instance": widget.instance(), - "separator": theme.default_separators(widget), - "separator_block_width": theme.separator_block_width(widget), + "separator": sep, + "separator_block_width": width, }) theme.next_widget() diff --git a/screenshots/battery.png b/screenshots/battery.png index cead423..bdbafee 100644 Binary files a/screenshots/battery.png and b/screenshots/battery.png differ diff --git a/screenshots/brightness.png b/screenshots/brightness.png index 15edc2d..298abf3 100644 Binary files a/screenshots/brightness.png and b/screenshots/brightness.png differ diff --git a/screenshots/caffeine.png b/screenshots/caffeine.png index d2e4111..5444777 100644 Binary files a/screenshots/caffeine.png and b/screenshots/caffeine.png differ diff --git a/screenshots/cmus.png b/screenshots/cmus.png index 18a3cf3..52c0b51 100644 Binary files a/screenshots/cmus.png and b/screenshots/cmus.png differ diff --git a/screenshots/cpu.png b/screenshots/cpu.png index 9173845..f160ba2 100644 Binary files a/screenshots/cpu.png and b/screenshots/cpu.png differ diff --git a/screenshots/date.png b/screenshots/date.png new file mode 100644 index 0000000..36621e7 Binary files /dev/null and b/screenshots/date.png differ diff --git a/screenshots/datetime.png b/screenshots/datetime.png index df33bd8..0c15843 100644 Binary files a/screenshots/datetime.png and b/screenshots/datetime.png differ diff --git a/screenshots/default.png b/screenshots/default.png deleted file mode 100644 index 5531717..0000000 Binary files a/screenshots/default.png and /dev/null differ diff --git a/screenshots/disk.png b/screenshots/disk.png index 08841a0..7a659b8 100644 Binary files a/screenshots/disk.png and b/screenshots/disk.png differ diff --git a/screenshots/dnf.png b/screenshots/dnf.png index b55d061..4992416 100644 Binary files a/screenshots/dnf.png and b/screenshots/dnf.png differ diff --git a/screenshots/load.png b/screenshots/load.png index 8ed7bd6..e136e7e 100644 Binary files a/screenshots/load.png and b/screenshots/load.png differ diff --git a/screenshots/memory.png b/screenshots/memory.png index 5498871..db0c59b 100644 Binary files a/screenshots/memory.png and b/screenshots/memory.png differ diff --git a/screenshots/nic.png b/screenshots/nic.png index 4e09c60..d1512c0 100644 Binary files a/screenshots/nic.png and b/screenshots/nic.png differ diff --git a/screenshots/pacman.png b/screenshots/pacman.png index d4af1b5..8f4169e 100644 Binary files a/screenshots/pacman.png and b/screenshots/pacman.png differ diff --git a/screenshots/pasink.png b/screenshots/pasink.png new file mode 100644 index 0000000..2fd6359 Binary files /dev/null and b/screenshots/pasink.png differ diff --git a/screenshots/pasource.png b/screenshots/pasource.png new file mode 100644 index 0000000..ae2ee77 Binary files /dev/null and b/screenshots/pasource.png differ diff --git a/screenshots/ping.png b/screenshots/ping.png index da897c3..1c8bf2b 100644 Binary files a/screenshots/ping.png and b/screenshots/ping.png differ diff --git a/screenshots/powerline-gruvbox.png b/screenshots/powerline-gruvbox.png deleted file mode 100644 index 77df3fe..0000000 Binary files a/screenshots/powerline-gruvbox.png and /dev/null differ diff --git a/screenshots/powerline-solarized.png b/screenshots/powerline-solarized.png deleted file mode 100644 index abf8f75..0000000 Binary files a/screenshots/powerline-solarized.png and /dev/null differ diff --git a/screenshots/powerline.png b/screenshots/powerline.png deleted file mode 100644 index df21bbd..0000000 Binary files a/screenshots/powerline.png and /dev/null differ diff --git a/screenshots/pulseaudio.png b/screenshots/pulseaudio.png index 2197d62..b38a4aa 100644 Binary files a/screenshots/pulseaudio.png and b/screenshots/pulseaudio.png differ diff --git a/screenshots/solarized.png b/screenshots/solarized.png deleted file mode 100644 index afbbbe1..0000000 Binary files a/screenshots/solarized.png and /dev/null differ diff --git a/screenshots/spacer.png b/screenshots/spacer.png index ed8d2c6..5200d0f 100644 Binary files a/screenshots/spacer.png and b/screenshots/spacer.png differ diff --git a/screenshots/themes/default.png b/screenshots/themes/default.png new file mode 100644 index 0000000..c2680bd Binary files /dev/null and b/screenshots/themes/default.png differ diff --git a/screenshots/themes/powerline-gruvbox.png b/screenshots/themes/powerline-gruvbox.png new file mode 100644 index 0000000..5b80ff3 Binary files /dev/null and b/screenshots/themes/powerline-gruvbox.png differ diff --git a/screenshots/themes/powerline-solarized.png b/screenshots/themes/powerline-solarized.png new file mode 100644 index 0000000..5be0b16 Binary files /dev/null and b/screenshots/themes/powerline-solarized.png differ diff --git a/screenshots/themes/powerline.png b/screenshots/themes/powerline.png new file mode 100644 index 0000000..1bd551a Binary files /dev/null and b/screenshots/themes/powerline.png differ diff --git a/screenshots/themes/solarized.png b/screenshots/themes/solarized.png new file mode 100644 index 0000000..a15d08c Binary files /dev/null and b/screenshots/themes/solarized.png differ diff --git a/screenshots/time.png b/screenshots/time.png new file mode 100644 index 0000000..39d5210 Binary files /dev/null and b/screenshots/time.png differ diff --git a/screenshots/xrandr.png b/screenshots/xrandr.png new file mode 100644 index 0000000..ec1c6de Binary files /dev/null and b/screenshots/xrandr.png differ diff --git a/themes/default.json b/themes/default.json index 5c9498a..76d3b1f 100644 --- a/themes/default.json +++ b/themes/default.json @@ -126,6 +126,9 @@ } }, "caffeine": { - "states": { "activated": {"prefix": "   " }, "deactivated": { "prefix": "   " } } + "states": { "activated": {"prefix": " caf on " }, "deactivated": { "prefix": " caf off " } } + }, + "xrandr": { + "states": { "on": { "prefix": " off "}, "off": { "prefix": " on "} } } } diff --git a/themes/gruvbox-powerline.json b/themes/gruvbox-powerline.json index ba155e0..0d9f63c 100644 --- a/themes/gruvbox-powerline.json +++ b/themes/gruvbox-powerline.json @@ -159,5 +159,8 @@ }, "caffeine": { "states": { "activated": {"prefix": "   " }, "deactivated": { "prefix": "   " } } + }, + "xrandr": { + "states": { "on": { "prefix": "   "}, "off": { "prefix": "   "} } } } diff --git a/themes/powerline.json b/themes/powerline.json index d74c461..7846814 100644 --- a/themes/powerline.json +++ b/themes/powerline.json @@ -158,5 +158,8 @@ }, "caffeine": { "states": { "activated": {"prefix": "   " }, "deactivated": { "prefix": "   " } } + }, + "xrandr": { + "states": { "on": { "prefix": "   "}, "off": { "prefix": "   "} } } } diff --git a/themes/solarized-powerline.json b/themes/solarized-powerline.json index 206e030..4a72def 100644 --- a/themes/solarized-powerline.json +++ b/themes/solarized-powerline.json @@ -159,5 +159,8 @@ }, "caffeine": { "states": { "activated": {"prefix": "   " }, "deactivated": { "prefix": "   " } } + }, + "xrandr": { + "states": { "on": { "prefix": "   "}, "off": { "prefix": "   "} } } } diff --git a/themes/solarized.json b/themes/solarized.json index 8a3fc8f..6c509b4 100644 --- a/themes/solarized.json +++ b/themes/solarized.json @@ -18,7 +18,7 @@ "bg-warning": "#b58900", "default_separators": false, - "separator": "|" + "separator": "" }, "date": { "prefix": " " @@ -152,5 +152,8 @@ }, "caffeine": { "states": { "activated": {"prefix": " caf on " }, "deactivated": { "prefix": " caf off " } } + }, + "xrandr": { + "states": { "on": { "prefix": " off "}, "off": { "prefix": " on "} } } }