├── debian ├── compat ├── source │ └── format ├── watch ├── changelog ├── rules ├── control └── copyright ├── target └── .gitignore ├── .gitignore ├── patches ├── enable.sh ├── 0001-Show-full-contents-when-an-unmatched-character-is-fo.patch └── 0002-Set-precision-for-network-speedrate-to-1.patch ├── README.md └── .github └── workflows └── build-debs.yml /debian/compat: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /target/.gitignore: -------------------------------------------------------------------------------- 1 | *.deb 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /debian/patches 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | https://github.com/polybar/polybar/releases/ (?:.*/)?-([0-9.]+)\.tar 3 | -------------------------------------------------------------------------------- /patches/enable.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd "$(dirname $0)" 4 | 5 | set -xe 6 | 7 | TARGET=../debian/patches 8 | 9 | mkdir -p "$TARGET" 10 | ls *.patch > "$TARGET/series" 11 | ln *.patch "$TARGET" 12 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | polybar (3.4.2-1) unstable; urgency=medium 2 | 3 | * Version 3.4.2 4 | 5 | -- Ayose Thu, 27 Dec 2019 00:00:00 +0000 6 | 7 | polybar (3.4.1-1) unstable; urgency=medium 8 | 9 | * Version 3.4.1 10 | 11 | -- Ayose Thu, 19 Dec 2019 00:00:00 +0000 12 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | include /usr/share/dpkg/buildflags.mk 4 | include /usr/share/dpkg/architecture.mk 5 | 6 | %: 7 | dh $@ --buildsystem=cmake --builddirectory=build 8 | make -C build test 9 | 10 | override_dh_auto_configure: 11 | dh_auto_configure -- \ 12 | -DBUILD_DOC:BOOL="ON" \ 13 | -DBUILD_TESTS:BOOL="ON" \ 14 | -DCMAKE_INSTALL_PREFIX:PATH=/usr \ 15 | -DCMAKE_CXX_COMPILER=g++ \ 16 | -DENABLE_ALSA:BOOL="ON" \ 17 | -DENABLE_PULSEAUDIO:BOOL="ON" \ 18 | -DENABLE_I3:BOOL="ON" \ 19 | -DENABLE_MPD:BOOL="ON" \ 20 | -DENABLE_NETWORK:BOOL="ON" \ 21 | -DENABLE_CURL:BOOL="ON" \ 22 | -DBUILD_IPC_MSG:BOOL="ON" 23 | -------------------------------------------------------------------------------- /patches/0001-Show-full-contents-when-an-unmatched-character-is-fo.patch: -------------------------------------------------------------------------------- 1 | From f83e6626e9abb8c9e23cca881af85b288db6e45d Mon Sep 17 00:00:00 2001 2 | From: Ayose 3 | Date: Thu, 19 Dec 2019 15:52:09 +0000 4 | Subject: [PATCH] Show full contents when an unmatched character is found 5 | 6 | --- 7 | include/cairo/context.hpp | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/include/cairo/context.hpp b/include/cairo/context.hpp 11 | index 8ed4f50..29e89a7 100644 12 | --- a/include/cairo/context.hpp 13 | +++ b/include/cairo/context.hpp 14 | @@ -218,7 +218,7 @@ namespace cairo { 15 | 16 | char unicode[6]{'\0'}; 17 | utils::ucs4_to_utf8(unicode, chars.begin()->codepoint); 18 | - m_log.warn("Dropping unmatched character %s (U+%04x)", unicode, chars.begin()->codepoint); 19 | + m_log.warn("Dropping unmatched character %s (U+%04x) in '%s'", unicode, chars.begin()->codepoint, string(t.contents)); 20 | utf8.erase(chars.begin()->offset, chars.begin()->length); 21 | for (auto&& c : chars) { 22 | c.offset -= chars.begin()->length; 23 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: polybar 2 | Section: x11 3 | Priority: optional 4 | Maintainer: Ayose 5 | Build-Depends: 6 | debhelper (>= 11), 7 | cmake, 8 | g++, 9 | git, 10 | i3-wm, 11 | libasound2-dev, 12 | libcairo2-dev, 13 | libcurl4-openssl-dev, 14 | libiw-dev, 15 | libmpdclient-dev, 16 | libpulse-dev, 17 | libxcb-composite0-dev, 18 | libxcb-cursor-dev, 19 | libxcb-ewmh-dev, 20 | libxcb-icccm4-dev, 21 | libxcb-image0-dev, 22 | libxcb-randr0-dev, 23 | libxcb-util0-dev, 24 | libxcb-xkb-dev, 25 | libxcb-xrm-dev, 26 | python-sphinx, 27 | python-xcbgen, 28 | xcb-proto 29 | Standards-Version: 4.3.0 30 | Homepage: https://polybar.github.io/ 31 | Rules-Requires-Root: no 32 | Vcs-Git: https://github.com/ayosec/polybar-debian.git 33 | Vcs-Browser: https://github.com/ayosec/polybar-debian 34 | 35 | Package: polybar 36 | Architecture: any 37 | Depends: 38 | ${misc:Depends}, 39 | ${shlibs:Depends} 40 | Description: A fast and easy-to-use tool for creating status bars 41 | Polybar aims to help users build beautiful and highly customizable status bars 42 | for their desktop environment, without the need of having a black belt in 43 | shell scripting. 44 | -------------------------------------------------------------------------------- /patches/0002-Set-precision-for-network-speedrate-to-1.patch: -------------------------------------------------------------------------------- 1 | From b0f9774b953a3507699ed7deca7e19334c4a9e5c Mon Sep 17 00:00:00 2001 2 | From: Ayose 3 | Date: Mon, 23 Dec 2019 15:16:51 +0000 4 | Subject: [PATCH] Set precision for network speedrate to 1 5 | 6 | --- 7 | src/adapters/net.cpp | 4 +++- 8 | 1 file changed, 3 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/src/adapters/net.cpp b/src/adapters/net.cpp 11 | index 0b79e12..78a4c25 100644 12 | --- a/src/adapters/net.cpp 13 | +++ b/src/adapters/net.cpp 14 | @@ -229,15 +229,17 @@ namespace net { 15 | float time_diff = std::chrono::duration_cast(duration).count(); 16 | float speedrate = bytes_diff / (time_diff ? time_diff : 1); 17 | 18 | + int precision = 0; 19 | vector suffixes{"GB", "MB"}; 20 | string suffix{"KB"}; 21 | 22 | while ((speedrate /= 1000) > 999) { 23 | suffix = suffixes.back(); 24 | suffixes.pop_back(); 25 | + precision = 1; 26 | } 27 | 28 | - return sstream() << std::setw(minwidth) << std::setfill(' ') << std::setprecision(0) << std::fixed << speedrate 29 | + return sstream() << std::setw(minwidth) << std::setfill(' ') << std::setprecision(precision) << std::fixed << speedrate 30 | << " " << suffix << "/s"; 31 | } 32 | 33 | -- 34 | 2.20.1 35 | 36 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: polybar 3 | Source: https://github.com/polybar/polybar 4 | 5 | Files: * 6 | Copyright: 2016 Michael Carlberg 7 | License: MIT 8 | 9 | Files: debian/* 10 | Copyright: 2019 Ayose 11 | License: MIT 12 | 13 | License: MIT 14 | Permission is hereby granted, free of charge, to any person obtaining a copy of 15 | this software and associated documentation files (the "Software"), to deal in 16 | the Software without restriction, including without limitation the rights to 17 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 18 | the Software, and to permit persons to whom the Software is furnished to do so, 19 | subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in all 22 | copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 26 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 27 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 28 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **UPDATE** Since 2020-04-13, Polybar is [available in Debian Unstable](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856179#106). 2 | 3 | --- 4 | 5 | # Debian Package for Polybar 6 | 7 | This repository contains the source to build a Debian package for [Polybar](https://polybar.github.io/). 8 | 9 | ## Usage 10 | 11 | If you have Docker, the easiest way to build the package is using the `build-in-container.sh` script: 12 | 13 | ```bash 14 | $ ./build-in-container.sh 15 | ``` 16 | 17 | By default, it builds a package for Polybar 3.4.1 in Debian Buster. 18 | 19 | You can change the Docker image with `-i`, and the version with `-v`. For example, to build the current `master` in Ubuntu 19.04, use the following command: 20 | 21 | ```bash 22 | $ ./build-in-container.sh -i ubuntu:19.04 -v master 23 | ``` 24 | 25 | If you change the version, you should update the `debian/changelog` file, so the package is generated with the correct version. 26 | 27 | After some minutes, the directory `target` contains the `.deb` files that you can install: 28 | 29 | ```bash 30 | $ sudo dpkg -i target/polybar_3.4.1-1_amd64.deb 31 | 32 | $ sudo apt-get -f install # Only is any package is missing 33 | ``` 34 | ## New release 35 | 36 | To publish a new release: 37 | 38 | * Change the default value for `VERSION` in `build.sh` and `build-in-container.sh`. 39 | * Add a new entry in `debian/changelog`. 40 | * Create a new tag with the version for the Debian package. 41 | 42 | When the tag is uploaded, the packages are built and uploaded to a new release in the GitHub repository. 43 | -------------------------------------------------------------------------------- /.github/workflows/build-debs.yml: -------------------------------------------------------------------------------- 1 | name: Build Debian packages 2 | 3 | on: 4 | push: 5 | tags: [ "*" ] 6 | 7 | jobs: 8 | build: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v1 14 | 15 | - name: Build packages 16 | run: | 17 | set -xe 18 | 19 | mkdir -p assets 20 | 21 | ./build-in-container.sh -i debian:buster 22 | rename.ul .deb _debian.buster.deb target/polybar_*.deb 23 | mv -n target/polybar_*.deb assets/ 24 | 25 | ./build-in-container.sh -i ubuntu:18.04 26 | rename.ul .deb _ubuntu.18.04.deb target/polybar_*.deb 27 | mv -n target/polybar_*.deb assets/ 28 | 29 | ./build-in-container.sh -i ubuntu:19.10 30 | rename.ul .deb _ubuntu.19.10.deb target/polybar_*.deb 31 | mv -n target/polybar_*.deb assets/ 32 | 33 | - name: Create release 34 | id: create_release 35 | uses: actions/create-release@v1 36 | env: 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 38 | with: 39 | tag_name: ${{ github.ref }} 40 | release_name: ${{ github.ref }} 41 | draft: false 42 | prerelease: false 43 | 44 | - name: Upload packages 45 | env: 46 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 47 | ID: ${{ steps.create_release.outputs.id }} 48 | run: | 49 | set -xe 50 | for asset in assets/* 51 | do 52 | UPLOAD_URL="https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$ID/assets" 53 | curl \ 54 | -X POST \ 55 | -H "Authorization: token $GITHUB_TOKEN" \ 56 | -H "Content-Type: application/octet-stream" \ 57 | --data-binary @"$asset" \ 58 | "${UPLOAD_URL}?name=$(basename $asset)" 59 | done 60 | --------------------------------------------------------------------------------