Created
February 28, 2017 01:26
-
-
Save frostidaho/88778b1926dc44f14c309a01cb849777 to your computer and use it in GitHub Desktop.
qtile svg test bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from libqtile import bar | |
from libqtile import images | |
from libqtile import widget | |
BORDER_WIDTH = 4 | |
BAR_SIZE = 32 | |
colors = { | |
'bg': '#542437', | |
'bg_fg': '#aa929b', | |
'bright_accent': '#c02942', | |
'bright_accent_bg': '#8a273d', | |
'bright_accent_fg': '#e094a0', | |
'dark_accent': '#53777a', | |
'dark_accent_bg': '#544e58', | |
'dark_accent_fg': '#a9bbbc', | |
'fg': '#ffffff', | |
'fg_bg': '#aa929b', | |
'highlight': '#d95b43', | |
'highlight_bg': '#96403d', | |
'highlight_fg': '#ecada1', | |
'light_accent': '#ecd078', | |
'light_accent_bg': '#a07a58', | |
'light_accent_fg': '#f6e8bc', | |
} | |
numix = images.Loader( | |
[ | |
'/usr/share/icons/Numix/48', | |
'/usr/share/icons/Numix', | |
], | |
width=48, | |
height=48, | |
) | |
hicolor_small = images.Loader( | |
[ | |
'/usr/share/icons/hicolor/16x16', | |
'/usr/share/icons/hicolor', | |
], | |
width=16, | |
height=16, | |
) | |
hicolor_big = images.Loader( | |
[ | |
'/usr/share/icons/hicolor/48x48', | |
'/usr/share/icons/hicolor', | |
], | |
width=48, | |
height=48, | |
) | |
# /usr/share/icons/hicolor/48x48/apps/im-jabber.png | |
def sep(): | |
return widget.Sep( | |
foreground=colors['highlight'], | |
linewidth=3, | |
padding=3, | |
size_percent=30, | |
background=colors['bg'], | |
) | |
sizes = [ | |
(None, None), | |
(None, 24), | |
(24, None), | |
(48, 48), | |
(100, 100), | |
] | |
def get_widgets(): | |
for w,h in sizes: | |
yield widget.TextBox(text='{}, {}'.format(w,h)) | |
yield widget.Image2(loaded_image=numix.icons(['jabber'], w, h)[0]) | |
yield sep() | |
yield widget.Image2(loaded_image=hicolor_small.icons(['im-jabber'], w, h)[0]) | |
yield sep() | |
yield widget.Image2(loaded_image=hicolor_big.icons(['im-jabber'], w, h)[0]) | |
yield sep() | |
bar_widgets = list(get_widgets()) | |
test_bar = bar.Bar( | |
bar_widgets, | |
size=100, | |
background=colors['bg'], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment