From a346294f996117772cd59c0fe406675cb5b7ec85 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Thu, 2 Jan 2020 13:51:53 +0100 Subject: [PATCH] Revert "[build] Remove PKGBUILD" This reverts commit 25bed762fce9f65d28a9bd3b1eddd1e06b167bf8. --- PKGBUILD | 41 ++++++++++++++++++++++++++++++++++++++++ bumblebee/modules/mpd.py | 13 +++---------- 2 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 PKGBUILD diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..5978e4b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: Tobias Witek +# Contributor: Daniel M. Capella +# Contributor: spookykidmm + +pkgname=bumblebee-status +pkgver=1.8.0 +pkgrel=1 +pkgdesc='Modular, theme-able status line generator for the i3 window manager' +arch=('any') +url=https://github.com/tobi-wan-kenobi/bumblebee-status +license=('MIT') +depends=('python' 'python-netifaces' 'python-psutil' 'python-requests') +optdepends=('xorg-xbacklight: to display a displays brightness' + 'xorg-xset: enable/disable automatic screen locking' + 'libnotify: enable/disable automatic screen locking' + 'dnf: display DNF package update information' + 'xorg-setxkbmap: display/change the current keyboard layout' + 'redshift: display the redshifts current color' + 'pulseaudio: control pulseaudio sink/sources' + 'xorg-xrandr: enable/disable screen outputs' + 'pacman: display current status of pacman' + 'iputils: display a ping' + 'i3ipc-python: display titlebar' + 'fakeroot: dependency of the pacman module' + 'pytz: timezone conversion for datetimetz module' + 'tzlocal: retrieve system timezone for datetimetz module' +) +source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz") +sha512sums=('b985e6619856519a92bd1a9d2a762997e8920a0ef5007f20063fcb2f9afeb193de67e8b0737182576f79ee19b2dd3e6388bb9b987480b7bc19b537f64e9b5685') + +package() { + install -d "$pkgdir"/usr/bin \ + "$pkgdir"/usr/share/$pkgname/{bumblebee/modules,themes/icons} + ln -s /usr/share/$pkgname/$pkgname "$pkgdir"/usr/bin/$pkgname + + cd $pkgname-$pkgver + cp -a --parents $pkgname bumblebee/{,modules/}*.py themes/{,icons/}*.json $pkgdir/usr/share/$pkgname + cp -r bin $pkgdir/usr/share/$pkgname/ + + install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE +} diff --git a/bumblebee/modules/mpd.py b/bumblebee/modules/mpd.py index 01def8e..330ee9d 100644 --- a/bumblebee/modules/mpd.py +++ b/bumblebee/modules/mpd.py @@ -3,8 +3,6 @@ """Displays information about the current song in mpd. -If mpd is not running or mpc fails for some reason, it will show "n/a". - Requires the following executable: * mpc @@ -63,7 +61,6 @@ class Module(bumblebee.engine.Module): bumblebee.output.Widget(name="mpd.repeat"), ] super(Module, self).__init__(engine, config, widgets) - self._mpd_running = False if not self.parameter("host"): self._hostcmd = "" @@ -88,13 +85,10 @@ class Module(bumblebee.engine.Module): self._tags = defaultdict(lambda: '') def hidden(self): - if self._mpd_running == True and - return self._mpd_running is True and self._status is None + return self._status is None @scrollable def description(self, widget): - if not self._mpd_running: - return "n/a" return string.Formatter().vformat(self._fmt, (), self._tags) def update(self, widgets): @@ -113,7 +107,6 @@ class Module(bumblebee.engine.Module): def _load_song(self): info = "" - self._mpd_running = True try: tags = ['name', 'artist', @@ -136,8 +129,8 @@ class Module(bumblebee.engine.Module): 'mdate'] joinedtags = "\n".join(["tag {0} %{0}%".format(tag) for tag in tags]) info = bumblebee.util.execute('mpc -f ' + '"' + joinedtags + '"' + self._hostcmd) - except Exception: - self._mpd_running = False + except RuntimeError: + pass self._tags = defaultdict(lambda: '') self._status = None for line in info.split("\n"):