Merge branch 'master' of https://github.com/tobi-wan-kenobi/bumblebee-status
10
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)
|
||||
|
|
54
bumblebee/modules/xrandr.py
Normal file
|
@ -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
|
|
@ -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()
|
||||
|
||||
|
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 992 B After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 1.8 KiB |
BIN
screenshots/date.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 837 B After Width: | Height: | Size: 860 B |
BIN
screenshots/pasink.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
screenshots/pasource.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 592 B After Width: | Height: | Size: 521 B |
BIN
screenshots/themes/default.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
screenshots/themes/powerline-gruvbox.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
screenshots/themes/powerline-solarized.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
screenshots/themes/powerline.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
screenshots/themes/solarized.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
screenshots/time.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
screenshots/xrandr.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
|
@ -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 "} }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,5 +159,8 @@
|
|||
},
|
||||
"caffeine": {
|
||||
"states": { "activated": {"prefix": " " }, "deactivated": { "prefix": " " } }
|
||||
},
|
||||
"xrandr": {
|
||||
"states": { "on": { "prefix": " "}, "off": { "prefix": " "} }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,5 +158,8 @@
|
|||
},
|
||||
"caffeine": {
|
||||
"states": { "activated": {"prefix": " " }, "deactivated": { "prefix": " " } }
|
||||
},
|
||||
"xrandr": {
|
||||
"states": { "on": { "prefix": " "}, "off": { "prefix": " "} }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,5 +159,8 @@
|
|||
},
|
||||
"caffeine": {
|
||||
"states": { "activated": {"prefix": " " }, "deactivated": { "prefix": " " } }
|
||||
},
|
||||
"xrandr": {
|
||||
"states": { "on": { "prefix": " "}, "off": { "prefix": " "} }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 "} }
|
||||
}
|
||||
}
|
||||
|
|