From fe0ef9cd334d0ad975ed304983597834c87bb43a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 24 Mar 2026 19:20:53 +0100 Subject: Fix dock-to-bottom and enable docking to the left or right MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- COPYING | 4 ++-- doc/man/xpybar.1 | 6 +++--- examples/compact | 2 +- examples/launchers | 2 +- examples/mixed | 2 +- examples/moderate | 2 +- examples/plugins/alsa | 2 +- examples/plugins/chase | 2 +- examples/plugins/clock | 2 +- examples/plugins/cpu | 2 +- examples/plugins/cpuinfo | 2 +- examples/plugins/cpuonline | 2 +- examples/plugins/dentrystate | 2 +- examples/plugins/df | 2 +- examples/plugins/discstats | 2 +- examples/plugins/files | 2 +- examples/plugins/image | 2 +- examples/plugins/inodestate | 2 +- examples/plugins/inotify | 2 +- examples/plugins/ipaddress | 2 +- examples/plugins/kmsg | 2 +- examples/plugins/leapsec | 2 +- examples/plugins/loadavg | 2 +- examples/plugins/locks | 2 +- examples/plugins/lunar | 2 +- examples/plugins/mem | 2 +- examples/plugins/moc | 2 +- examples/plugins/network | 2 +- examples/plugins/pacman | 2 +- examples/plugins/ping | 2 +- examples/plugins/random | 2 +- examples/plugins/ropty | 2 +- examples/plugins/snmp | 2 +- examples/plugins/snmp6 | 2 +- examples/plugins/softirqs | 2 +- examples/plugins/swaps | 2 +- examples/plugins/tzclock | 2 +- examples/plugins/uname | 2 +- examples/plugins/uptime | 2 +- examples/plugins/users | 2 +- examples/plugins/vmstat | 2 +- examples/plugins/xdisplay | 2 +- examples/plugins/xkb | 2 +- examples/test | 4 +++- examples/tricks/anytzclock | 2 +- examples/tricks/localutcclock | 2 +- examples/xmonad | 2 +- src/__main__.py | 47 ++++++++++++++++++++++++++++++++++--------- src/plugins/alsa.py | 2 +- src/plugins/application.py | 2 +- src/plugins/chase.py | 2 +- src/plugins/clock.py | 2 +- src/plugins/cpu.py | 2 +- src/plugins/cpuinfo.py | 2 +- src/plugins/cpuonline.py | 2 +- src/plugins/dentrystate.py | 2 +- src/plugins/df.py | 2 +- src/plugins/discstats.py | 2 +- src/plugins/files.py | 2 +- src/plugins/hdparm.py | 2 +- src/plugins/ii.py | 2 +- src/plugins/image.py | 2 +- src/plugins/inodestate.py | 2 +- src/plugins/inotify.py | 2 +- src/plugins/ipaddress.py | 2 +- src/plugins/kmsg.py | 2 +- src/plugins/leapsec.py | 2 +- src/plugins/lid.py | 2 +- src/plugins/linereader.py | 2 +- src/plugins/loadavg.py | 2 +- src/plugins/locks.py | 2 +- src/plugins/lunar.py | 2 +- src/plugins/mem.py | 2 +- src/plugins/menu.py | 2 +- src/plugins/moc.py | 2 +- src/plugins/network.py | 2 +- src/plugins/pacman.py | 2 +- src/plugins/ping.py | 2 +- src/plugins/powersupply.py | 2 +- src/plugins/random.py | 2 +- src/plugins/ropty.py | 2 +- src/plugins/snmp.py | 2 +- src/plugins/snmp6.py | 2 +- src/plugins/softirqs.py | 2 +- src/plugins/solar.py | 2 +- src/plugins/swaps.py | 2 +- src/plugins/tzclock.py | 2 +- src/plugins/uname.py | 2 +- src/plugins/uptime.py | 2 +- src/plugins/users.py | 2 +- src/plugins/vmstat.py | 2 +- src/plugins/weather.py | 2 +- src/plugins/xdisplay.py | 2 +- src/plugins/xkb.py | 2 +- src/restricted-hdparm.c | 2 +- src/util.py | 2 +- src/x.py | 46 ++++++++++++++++++++++++++++++++---------- 97 files changed, 173 insertions(+), 118 deletions(-) diff --git a/COPYING b/COPYING index 2d9fa40..d00c7e1 100644 --- a/COPYING +++ b/COPYING @@ -5,7 +5,7 @@ License version 3. xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2026 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ along with this program. If not, see . xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by diff --git a/doc/man/xpybar.1 b/doc/man/xpybar.1 index cfc539a..a55296b 100644 --- a/doc/man/xpybar.1 +++ b/doc/man/xpybar.1 @@ -73,7 +73,7 @@ Full documentation available locally via: info \(aq(xpybar)\(aq Principal author, Mattias Andrée. See the COPYING file for the full list of authors. .SH LICENSE -Copyright \(co 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée +Copyright \(co 2014, 2015, 2016, 2017, 2018, 2019, 2026 Mattias Andrée .br License GPLv3+: GNU GPL version 3 or later , and License AGPLv3+: GNU AGPL version 3 or later . @@ -82,5 +82,5 @@ This is free software: you are free to change and redistribute it. .br There is NO WARRANTY, to the extent permitted by law. .SH BUGS -Please report bugs to https://github.com/maandree/xpybar/issues or to -m@maandreese +Please report bugs to https://codeberg.org/maandree/xpybar/issues or to +m@maandree.se diff --git a/examples/compact b/examples/compact index e7edd36..04b7e02 100644 --- a/examples/compact +++ b/examples/compact @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/launchers b/examples/launchers index 37d5e32..5a87268 100644 --- a/examples/launchers +++ b/examples/launchers @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/mixed b/examples/mixed index d6a15e3..445661e 100644 --- a/examples/mixed +++ b/examples/mixed @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/moderate b/examples/moderate index dc39dcd..6c2721d 100644 --- a/examples/moderate +++ b/examples/moderate @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/alsa b/examples/plugins/alsa index 2218dee..9c279fa 100644 --- a/examples/plugins/alsa +++ b/examples/plugins/alsa @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/chase b/examples/plugins/chase index 1b99877..762dd3d 100644 --- a/examples/plugins/chase +++ b/examples/plugins/chase @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/clock b/examples/plugins/clock index a608cdd..c992966 100644 --- a/examples/plugins/clock +++ b/examples/plugins/clock @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/cpu b/examples/plugins/cpu index 3a8200e..6b4d1de 100644 --- a/examples/plugins/cpu +++ b/examples/plugins/cpu @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/cpuinfo b/examples/plugins/cpuinfo index 12311e8..037ddd4 100644 --- a/examples/plugins/cpuinfo +++ b/examples/plugins/cpuinfo @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/cpuonline b/examples/plugins/cpuonline index 472762e..2811ee8 100644 --- a/examples/plugins/cpuonline +++ b/examples/plugins/cpuonline @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/dentrystate b/examples/plugins/dentrystate index d346a7e..010da9e 100644 --- a/examples/plugins/dentrystate +++ b/examples/plugins/dentrystate @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/df b/examples/plugins/df index 6e50bed..1195ec3 100644 --- a/examples/plugins/df +++ b/examples/plugins/df @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/discstats b/examples/plugins/discstats index 6729009..fcb2f97 100644 --- a/examples/plugins/discstats +++ b/examples/plugins/discstats @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/files b/examples/plugins/files index 05abb35..63cfce9 100644 --- a/examples/plugins/files +++ b/examples/plugins/files @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/image b/examples/plugins/image index f110830..7622228 100644 --- a/examples/plugins/image +++ b/examples/plugins/image @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/inodestate b/examples/plugins/inodestate index 48f81d7..f9f6526 100644 --- a/examples/plugins/inodestate +++ b/examples/plugins/inodestate @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/inotify b/examples/plugins/inotify index 99500f9..a89cb3f 100644 --- a/examples/plugins/inotify +++ b/examples/plugins/inotify @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/ipaddress b/examples/plugins/ipaddress index 5451085..ee488eb 100644 --- a/examples/plugins/ipaddress +++ b/examples/plugins/ipaddress @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/kmsg b/examples/plugins/kmsg index 6868ea8..77172fc 100644 --- a/examples/plugins/kmsg +++ b/examples/plugins/kmsg @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/leapsec b/examples/plugins/leapsec index 84bb8a2..c052e26 100644 --- a/examples/plugins/leapsec +++ b/examples/plugins/leapsec @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/loadavg b/examples/plugins/loadavg index e032b43..ccb7f83 100644 --- a/examples/plugins/loadavg +++ b/examples/plugins/loadavg @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/locks b/examples/plugins/locks index 49b522f..8b59043 100644 --- a/examples/plugins/locks +++ b/examples/plugins/locks @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/lunar b/examples/plugins/lunar index 835a03f..daa24c8 100644 --- a/examples/plugins/lunar +++ b/examples/plugins/lunar @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/mem b/examples/plugins/mem index fcf619c..1568157 100644 --- a/examples/plugins/mem +++ b/examples/plugins/mem @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/moc b/examples/plugins/moc index b77ba4d..6360662 100644 --- a/examples/plugins/moc +++ b/examples/plugins/moc @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/network b/examples/plugins/network index 47462a8..e780389 100644 --- a/examples/plugins/network +++ b/examples/plugins/network @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/pacman b/examples/plugins/pacman index 50c3994..3819f56 100644 --- a/examples/plugins/pacman +++ b/examples/plugins/pacman @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/ping b/examples/plugins/ping index 96b4ee3..9403857 100644 --- a/examples/plugins/ping +++ b/examples/plugins/ping @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/random b/examples/plugins/random index 6b743ea..f009578 100644 --- a/examples/plugins/random +++ b/examples/plugins/random @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/ropty b/examples/plugins/ropty index 16ed3e3..71586f4 100644 --- a/examples/plugins/ropty +++ b/examples/plugins/ropty @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/snmp b/examples/plugins/snmp index 19b1a16..de3e4b3 100644 --- a/examples/plugins/snmp +++ b/examples/plugins/snmp @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/snmp6 b/examples/plugins/snmp6 index cfc5e52..11f1a5d 100644 --- a/examples/plugins/snmp6 +++ b/examples/plugins/snmp6 @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/softirqs b/examples/plugins/softirqs index 021a8df..432d928 100644 --- a/examples/plugins/softirqs +++ b/examples/plugins/softirqs @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/swaps b/examples/plugins/swaps index cf67bf2..d559ad6 100644 --- a/examples/plugins/swaps +++ b/examples/plugins/swaps @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/tzclock b/examples/plugins/tzclock index 15586b5..1eef79b 100644 --- a/examples/plugins/tzclock +++ b/examples/plugins/tzclock @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/uname b/examples/plugins/uname index 1575c06..58607ef 100644 --- a/examples/plugins/uname +++ b/examples/plugins/uname @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/uptime b/examples/plugins/uptime index 7f294dc..f128e23 100644 --- a/examples/plugins/uptime +++ b/examples/plugins/uptime @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/users b/examples/plugins/users index f1f7be0..5a823e6 100644 --- a/examples/plugins/users +++ b/examples/plugins/users @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/vmstat b/examples/plugins/vmstat index 10c95e3..ac6ddec 100644 --- a/examples/plugins/vmstat +++ b/examples/plugins/vmstat @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/xdisplay b/examples/plugins/xdisplay index dcf4dec..792a0e8 100644 --- a/examples/plugins/xdisplay +++ b/examples/plugins/xdisplay @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/plugins/xkb b/examples/plugins/xkb index bfced3e..8e69224 100644 --- a/examples/plugins/xkb +++ b/examples/plugins/xkb @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/test b/examples/test index 3e4d8b3..d89fe06 100644 --- a/examples/test +++ b/examples/test @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +20,8 @@ along with this program. If not, see . # A simple xpybar configuration example that tests a few features OUTPUT, HEIGHT, YPOS, TOP = 0, 24, 24, True +WIDTH, XPOS, LEFT, SIDEBAR = 0, 0, True, False +BACKGROUND, FOREGROUND = (32, 32, 32), (192, 192, 192) def redraw(): bar.clear() diff --git a/examples/tricks/anytzclock b/examples/tricks/anytzclock index 5bb631a..58ce49e 100644 --- a/examples/tricks/anytzclock +++ b/examples/tricks/anytzclock @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/tricks/localutcclock b/examples/tricks/localutcclock index 5f698a0..5e61bc8 100644 --- a/examples/tricks/localutcclock +++ b/examples/tricks/localutcclock @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/examples/xmonad b/examples/xmonad index 6efa5cf..fe6fb22 100644 --- a/examples/xmonad +++ b/examples/xmonad @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/__main__.py b/src/__main__.py index e3543c4..c2c8216 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 copyright = ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2026 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,10 +31,12 @@ PROGRAM_VERSION = '1.20' global OUTPUT, HEIGHT, YPOS, TOP, FONT, BACKGROUND, FOREGROUND +global WIDTH, XPOS, LEFT, SIDEBAR global display, outputs, redraw, Bar, start, stop global conf_opts, config_file, parser OUTPUT, HEIGHT, YPOS, TOP = 0, 12, 0, True +WIDTH, XPOS, LEFT, SIDEBAR = 0, 0, True, False FONT = '-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*' BACKGROUND, FOREGROUND = (0, 0, 0), (192, 192, 192) @@ -58,7 +60,7 @@ def start(): feel free to replace this completely ''' global bar - bar = Bar(OUTPUT, HEIGHT, YPOS, TOP, FONT, BACKGROUND, FOREGROUND) + bar = Bar(OUTPUT, HEIGHT, YPOS, TOP, FONT, BACKGROUND, FOREGROUND, WIDTH, XPOS, LEFT, SIDEBAR) bar.map() def stop(): @@ -90,9 +92,15 @@ class Bar: @variable width:int The output's pixel width @variable height:int The output's pixel height @variable left:int The output's left position + @variable top:int The output's top position @variable ypos:int The position of the panel in relation to either the top or bottom edge of the output + @variable xpos:int The position of the panel in relation to either the left or right edge of the output @variable panel_height:int The panel's height + @variable panel_width:int The panel's width @variable at_top:bool Whether the panel is to be docked to the top of the output, otherwise to the bottom + @variable at_left:bool Whether the panel is to be docked to the left edge of the output, otherwise to the right edge + @variable sidebar:bool If `True`, the bar will be docked to the left or right edge, + otherwise it will be docked to the top or the bottom edge @variable background The default background @variable foreground The default foreground @@ -104,22 +112,43 @@ class Bar: @variable cmap_cache Custom colour map cache ''' - def __init__(self, output, height, ypos, top, font, background, foreground): + def __init__(self, output, height, ypos, top, font, background, foreground, width = 0, xpos = 0, left = True, sidebar = False): ''' Constructor - @param output:int The index of the output within the screen as printed by xrandr, except primary is first - @param height:int The height of the panel - @param ypos:int The position of the panel in relation the either the top or bottom edge of the output - @param top:bool Whether the panel is to be docked to the top of the output, otherwise to the bottom + @param output:int The index of the output within the screen as printed by xrandr, + except primary is first + @param height:int The height of the panel, 0 to span the entire output if `sidebar`, + if negative, the absolute value is subtracted with the output's height + @param ypos:int The position of the panel in relation the either the top or bottom + edge of the output + @param top:bool Whether the panel is to be docked to the top of the output, + otherwise to the bottom @param font:str The default font @param background:(red:int, green:int, blue:int) The default background @param foreground:(red:int, green:int, blue:int) The default foreground + @param width:int The width of the panel, 0 to span the entire output unless `sidebar`, + if negative, the absolute value is subtracted with the output's width + @param xpos:int The position of the panel in relation the either the left or right + edge of the output + @param left:bool Whether the panel is to be docked to the left edge of the output, + otherwise to the right edge + @param sidebar:bool If `True`, the bar will be docked to the left or right edge, + otherwise it will be docked to the top or the bottom edge ''' ## Panel position - pos = outputs[output][:3] + [ypos, height, top] - self.width, self.height, self.left, self.ypos, self.panel_height, self.at_top = pos + self.width, self.height, self.left, self.top = outputs[output] + self.xpos, self.ypos, self.panel_width, self.panel_height = xpos, ypos, width, height + self.at_top, self.at_left, self.sidebar = top, left, sidebar + if sidebar: + if self.panel_height <= 0: + self.panel_height += self.height + else: + if self.panel_width <= 0: + self.panel_width += self.width ## Create window and create/fetch resources + pos = [self.width, self.height, self.left, self.ypos, self.panel_height, self.at_top] + pos += [self.top, self.xpos, self.panel_width, self.at_left, self.sidebar] self.window = create_panel(*pos) self.gc = self.window.create_gc() self.cmap = self.window.get_attributes().colormap diff --git a/src/plugins/alsa.py b/src/plugins/alsa.py index 456326f..a4e5b35 100644 --- a/src/plugins/alsa.py +++ b/src/plugins/alsa.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/application.py b/src/plugins/application.py index d7f0c88..188d5cb 100644 --- a/src/plugins/application.py +++ b/src/plugins/application.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/chase.py b/src/plugins/chase.py index 30a47ea..e8ee5dc 100644 --- a/src/plugins/chase.py +++ b/src/plugins/chase.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/clock.py b/src/plugins/clock.py index a3d7bf3..700db78 100644 --- a/src/plugins/clock.py +++ b/src/plugins/clock.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/cpu.py b/src/plugins/cpu.py index 21bc70b..4919856 100644 --- a/src/plugins/cpu.py +++ b/src/plugins/cpu.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/cpuinfo.py b/src/plugins/cpuinfo.py index 4422f6e..374044e 100644 --- a/src/plugins/cpuinfo.py +++ b/src/plugins/cpuinfo.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/cpuonline.py b/src/plugins/cpuonline.py index c358427..39d31e8 100644 --- a/src/plugins/cpuonline.py +++ b/src/plugins/cpuonline.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/dentrystate.py b/src/plugins/dentrystate.py index c433ff0..b91af5b 100644 --- a/src/plugins/dentrystate.py +++ b/src/plugins/dentrystate.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/df.py b/src/plugins/df.py index 1eb9b90..5d98a45 100644 --- a/src/plugins/df.py +++ b/src/plugins/df.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/discstats.py b/src/plugins/discstats.py index 765948a..91b5c38 100644 --- a/src/plugins/discstats.py +++ b/src/plugins/discstats.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/files.py b/src/plugins/files.py index 5cf4f33..706af33 100644 --- a/src/plugins/files.py +++ b/src/plugins/files.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/hdparm.py b/src/plugins/hdparm.py index 4a27410..9854494 100644 --- a/src/plugins/hdparm.py +++ b/src/plugins/hdparm.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/ii.py b/src/plugins/ii.py index c0866ae..f833a94 100644 --- a/src/plugins/ii.py +++ b/src/plugins/ii.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/image.py b/src/plugins/image.py index 4c019ac..94ddb5c 100644 --- a/src/plugins/image.py +++ b/src/plugins/image.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/inodestate.py b/src/plugins/inodestate.py index dde4f68..cd1ec68 100644 --- a/src/plugins/inodestate.py +++ b/src/plugins/inodestate.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/inotify.py b/src/plugins/inotify.py index 31ed1b9..644f13d 100644 --- a/src/plugins/inotify.py +++ b/src/plugins/inotify.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/ipaddress.py b/src/plugins/ipaddress.py index 8e0e857..bfa3772 100644 --- a/src/plugins/ipaddress.py +++ b/src/plugins/ipaddress.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/kmsg.py b/src/plugins/kmsg.py index 86c21ab..180a1e4 100644 --- a/src/plugins/kmsg.py +++ b/src/plugins/kmsg.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/leapsec.py b/src/plugins/leapsec.py index 3d8d95f..fef6b20 100644 --- a/src/plugins/leapsec.py +++ b/src/plugins/leapsec.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/lid.py b/src/plugins/lid.py index e31949b..e0fcebd 100644 --- a/src/plugins/lid.py +++ b/src/plugins/lid.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/linereader.py b/src/plugins/linereader.py index 3e2e7c9..29f49d4 100644 --- a/src/plugins/linereader.py +++ b/src/plugins/linereader.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/loadavg.py b/src/plugins/loadavg.py index 050a7b1..d54bb5b 100644 --- a/src/plugins/loadavg.py +++ b/src/plugins/loadavg.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/locks.py b/src/plugins/locks.py index 6bde5a6..509c73c 100644 --- a/src/plugins/locks.py +++ b/src/plugins/locks.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/lunar.py b/src/plugins/lunar.py index 2916638..a95f879 100644 --- a/src/plugins/lunar.py +++ b/src/plugins/lunar.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by diff --git a/src/plugins/mem.py b/src/plugins/mem.py index 93da047..fdcc0bc 100644 --- a/src/plugins/mem.py +++ b/src/plugins/mem.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/menu.py b/src/plugins/menu.py index 24fdace..e6b8bfd 100644 --- a/src/plugins/menu.py +++ b/src/plugins/menu.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/moc.py b/src/plugins/moc.py index f3187d3..4436a03 100644 --- a/src/plugins/moc.py +++ b/src/plugins/moc.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/network.py b/src/plugins/network.py index f3ee4c2..38f9ff2 100644 --- a/src/plugins/network.py +++ b/src/plugins/network.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/pacman.py b/src/plugins/pacman.py index 14be8f3..bb7d010 100644 --- a/src/plugins/pacman.py +++ b/src/plugins/pacman.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/ping.py b/src/plugins/ping.py index 89df298..9289fa2 100644 --- a/src/plugins/ping.py +++ b/src/plugins/ping.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/powersupply.py b/src/plugins/powersupply.py index d7fb8e3..afa1a5c 100644 --- a/src/plugins/powersupply.py +++ b/src/plugins/powersupply.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/random.py b/src/plugins/random.py index 95f0d1d..7d7fe93 100644 --- a/src/plugins/random.py +++ b/src/plugins/random.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/ropty.py b/src/plugins/ropty.py index 4c0d201..d7ad36e 100644 --- a/src/plugins/ropty.py +++ b/src/plugins/ropty.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/snmp.py b/src/plugins/snmp.py index cd937a4..e83d40b 100644 --- a/src/plugins/snmp.py +++ b/src/plugins/snmp.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/snmp6.py b/src/plugins/snmp6.py index 00bc395..71b436f 100644 --- a/src/plugins/snmp6.py +++ b/src/plugins/snmp6.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/softirqs.py b/src/plugins/softirqs.py index ba512fb..22e1cf0 100644 --- a/src/plugins/softirqs.py +++ b/src/plugins/softirqs.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/solar.py b/src/plugins/solar.py index e917270..3078435 100644 --- a/src/plugins/solar.py +++ b/src/plugins/solar.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/swaps.py b/src/plugins/swaps.py index 34ace18..61cd6fb 100644 --- a/src/plugins/swaps.py +++ b/src/plugins/swaps.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/tzclock.py b/src/plugins/tzclock.py index 8611de3..8ab4bad 100644 --- a/src/plugins/tzclock.py +++ b/src/plugins/tzclock.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/uname.py b/src/plugins/uname.py index 93d338b..88d90b7 100644 --- a/src/plugins/uname.py +++ b/src/plugins/uname.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/uptime.py b/src/plugins/uptime.py index 5af45b6..0e8f436 100644 --- a/src/plugins/uptime.py +++ b/src/plugins/uptime.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/users.py b/src/plugins/users.py index 33008ee..5c65b39 100644 --- a/src/plugins/users.py +++ b/src/plugins/users.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/vmstat.py b/src/plugins/vmstat.py index a5dd8ae..b146c55 100644 --- a/src/plugins/vmstat.py +++ b/src/plugins/vmstat.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/weather.py b/src/plugins/weather.py index b8a7432..067092b 100644 --- a/src/plugins/weather.py +++ b/src/plugins/weather.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/xdisplay.py b/src/plugins/xdisplay.py index 31fb191..1ea2e72 100644 --- a/src/plugins/xdisplay.py +++ b/src/plugins/xdisplay.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/plugins/xkb.py b/src/plugins/xkb.py index 40b74c6..c749910 100644 --- a/src/plugins/xkb.py +++ b/src/plugins/xkb.py @@ -1,7 +1,7 @@ # -*- python -*- ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/restricted-hdparm.c b/src/restricted-hdparm.c index ac2bbf2..f2181d0 100644 --- a/src/restricted-hdparm.c +++ b/src/restricted-hdparm.c @@ -1,6 +1,6 @@ /** * xpybar – xmobar replacement written in python - * Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) + * Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/util.py b/src/util.py index b9302eb..679c931 100644 --- a/src/util.py +++ b/src/util.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/x.py b/src/x.py index 4ea8b08..fdadc4b 100644 --- a/src/x.py +++ b/src/x.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 ''' xpybar – xmobar replacement written in python -Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mattias Andrée (m@maandreese) +Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2026 Mattias Andrée (m@maandree.se) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -126,7 +126,7 @@ def get_override_redirect(): return True -def create_panel(width, height, left, ypos, panel_height, at_top): +def create_panel(width, height, left, ypos, panel_height, at_top, top = 0, xpos = 0, panel_width = None, at_left = True, sidebar = False): ''' Create a docked panel, not mapped yet @@ -134,29 +134,53 @@ def create_panel(width, height, left, ypos, panel_height, at_top): @param height:int The height of the output @param left:int The left position of the output @param ypos:int The position of the panel in relation to either the top or bottom edge of the output - @param panel_height:int The height of the panel + @param panel_height:int? The height of the panel, `None` for `height` @param at_top:bool Whether the panel is to be docked to the top of the output, otherwise to the bottom + @param top:int The top position of the output + @param xpos:int The position of the panel in relation to either the left or right edge of the output + @param panel_width:int? The width of the panel, `None` for `width` + @param at_left:bool Whether the panel is to be docked to the left edge of the output, otherwise to the right edge + @param sidebar:bool If `True`, the panel will be docked to the left or right edge, + otherwise it will be docked to the top or the bottom edge @return The window ''' global display, screen - ypos = ypos if at_top else (height - ypos - panel_height) - window = screen.root.create_window(left, ypos, width, panel_height, 0, + + sw, sh = screen['width_in_pixels'], screen['height_in_pixels'] + + if sidebar: + if panel_height is None: + panel_height = height + else: + if panel_width is None: + panel_width = width + + w, h = panel_width, panel_height + y = top + (ypos if at_top else (height - ypos - h)) + x = left + (xpos if at_left else (width - xpos - w)) + window = screen.root.create_window(x, y, panel_width, panel_height, 0, Xlib.X.CopyFromParent, Xlib.X.InputOutput, Xlib.X.CopyFromParent, event_mask = get_event_mask(), colormap = Xlib.X.CopyFromParent, override_redirect = get_override_redirect()) - - top_ = lambda x, y, w, h : [0, 0, y + h, 0, 0, 0, 0, 0, x, x + w - 1, 0, 0] - bottom_ = lambda x, y, w, h : [0, 0, 0, y + h, 0, 0, 0, 0, 0, 0, x, x + w - 1] - + window.set_wm_name('xpybar') window.set_wm_icon_name('xpybar') window.set_wm_class('bar', 'xpybar') window.set_wm_client_machine(os.uname().nodename) - - position = (top_ if at_top else bottom_)(left, ypos, width, panel_height) + + if sidebar: + if at_left: + position = [x + w, 0, 0, 0, y, y + h - 1, 0, 0, 0, 0, 0, 0] + else: + position = [0, sw - x, 0, 0, 0, 0, y, y + h - 1, 0, 0, 0, 0] + else: + if at_top: + position = [0, 0, y + h, 0, 0, 0, 0, 0, x, x + w - 1, 0, 0] + else: + position = [0, 0, 0, sh - y, 0, 0, 0, 0, 0, 0, x, x + w - 1] _CARD = display.intern_atom("CARDINAL") _PSTRUT = display.intern_atom("_NET_WM_STRUT_PARTIAL") _STRUT = display.intern_atom("_NET_WM_STRUT") -- cgit v1.2.3-70-g09d2