Giter VIP home page Giter VIP logo

waybar-updates's Introduction

waybar-updates

ShellCheck

Tiny Waybar module to check Arch Linux updates from official repositories and AUR.

Features

  • Sends notifications about updates.
  • Supports GNU gettext localization (contribute new po-files!)
  • Checks updates from AUR using Aurweb RPC, so works independently.
  • Can check for development packages upstream changes (see -d options)
  • Shows updates in the tooltip.
  • Supports two states: pending-updates and updated to use different icons or hide module.
  • Uses infinite loop to supply Waybar JSON updates.
  • Configurable interval between checks.

Installation

  1. Using AUR package waybar-updates.
  2. Manually by using make && make install.

Dependencies

  • pacman-contrib
  • gettext
  • curl
  • jq
  • libnotify
  • git (if using --devel option)

Usage

~/.config/waybar/config:

"modules-left": [
  ...
  "custom/pacman",
  ...
],

...

"custom/pacman": {
  "format": "{icon}{}",
  "return-type": "json",
  "format-icons": {
    "pending-updates": "",
    "updated": ""
  },
  "exec-if": "which waybar-updates",
  "exec": "waybar-updates"
}

~/.config/waybar/style.css

@keyframes blink-update {
	to {
		background-color: dodgerblue;
	}
}

#custom-pacman {
	animation-timing-function: linear;
	animation-iteration-count: infinite;
	animation-direction: alternate;
}
#custom-pacman.pending-updates {
	animation-name: blink-update;
	animation-duration: 3s;
}

You can copy compiled mo-files and use TEXTDOMAINDIR="$HOME/.config/waybar/scripts" in case you want to use localization and don't want to store them in /usr/share/locale.

Command-line options

The following options are available:

  • -i, --interval: Interval between checks (default: 6 seconds)
  • -c, --cycles: Cycles between online checks (e.g. 6s * 600 cycles = 3600s = 1h between online checks) (default: 600 cycles)
  • -l, --packages-limit: Maximum number of packages to be shown in notifications and tooltip (default: 10)
  • -d, --devel: Also check for development packages upstream changes (default:disabled)

Localization

Supported languages:

  • English
  • Russian
  • French
  • Turkish
  1. Open po/waybar-updates.pot in poedit or any alternative.
  2. Generate po-file for your language.
  3. Translate!
  4. Submit po-file by opening Pull Request!

Inspired by waybar-module-pacman-updates.

waybar-updates's People

Contributors

julian-poidevin avatar ouzbirki avatar savely-krasovsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

waybar-updates's Issues

Shows the ignored packages

Waybar-updates worked perfectly until I added a package I wanted to ignore into /etc/pacman.conf.

IgnorePkg = my-pkg
NoUpgrade = my-pkg

It does skip it in pacman / yay but not in waybar-updates.

Missing newline before AUR updates start

The first AUR package starts on the same line as the last regular package.
See attached screenshot:
Screenshot demonstrating missing newline

obs-studio in this case is the first and only AUR package.

The configuration I use is the one provided in the readme.

Last pacman-contrib update preserve pacman colors

pacman-contrib has been updated to 1.10.2 changelog "Preserve pacman colors when printing the list of pending updates"

You have to add --nocolor to avoid this kind of notification

{"text":"1","alt":"pending-updates","tooltip":"\u001b[0;1mdiscover \u001b[1;32m5.27.10-1\u001b[0m -> \u001b[1;32m5.27.10-2\u001b[0m","class":"pending-updates"}
function check_pacman_updates() {
  if [ "$1" == "online" ]; then
    pacman_updates=$(checkupdates --nocolor)
  elif [ "$1" == "offline" ]; then
    pacman_updates=$(checkupdates --nosync --nocolor)
  fi

Local issue with join

As my locale is French (fr_FR.utf8) I had the following error:

join: input is not in sorted order

join: /proc/self/fd/11:74 : n'est pas trié : gtklock-git 2.1.0.r14.g6732a03-1
join: l'entrée n'est pas dans l'ordre trié

To avoid any locale-related issues, it is recommended to use the 'C' locale with join here

aur_updates=$(LC_ALL=C join <(echo "$old_aur_packages") <(echo "$new_aur_packages")

AUR updates don't show

No AUR package update appears, I wonder why, am I missing something, or AUR web API acting weird?

❯ pacman -Qi waybar-updates
Name            : waybar-updates
Version         : 0.2.6-1
Description     : Tiny Waybar module to check Arch Linux updates from official repositories and AUR
Architecture    : any
URL             : https://github.com/L11R/waybar-updates
Licenses        : MIT
Groups          : None
Provides        : waybar-updates
Depends On      : bash  coreutils  pacman-contrib  gettext  curl  jq  libnotify
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 7.68 KiB
Packager        : Unknown Packager
Build Date      : Fri 14 Jul 2023 03:41:03 AM +04
Install Date    : Fri 14 Jul 2023 03:41:20 AM +04
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : SHA-256 Sum

No such file or directory in log

Hello,

First, thanks for this great module !
When starting waybar from the command-line, I observe the following waybar-updates related messages.
Do you know what it could be ?

Thanks

cat: /tmp/tmp.wKVz1FYYgW-waybar-updates: No such file or directory
cat: /tmp/tmp.mNR8NsJxi4-waybar-updates: No such file or directory
cat: /tmp/tmp.wKVz1FYYgW-waybar-updates: No such file or directory
cat: /tmp/tmp.mNR8NsJxi4-waybar-updates: No such file or directory
cat: /tmp/tmp.wKVz1FYYgW-waybar-updates: No such file or directory
cat: /tmp/tmp.mNR8NsJxi4-waybar-updates: No such file or directory
cat: /tmp/tmp.wKVz1FYYgW-waybar-updates: No such file or directory
cat: /tmp/tmp.mNR8NsJxi4-waybar-updates: No such file or directory

Unicode issue

Recently extra Unicode characters get parsed from pacman updates, I mean \u001b and [ followed by numbers and letters

{"text":"11","alt":"pending-updates","tooltip":"\u001b[0;1mlibwireplumber \u001b[1;32m0.5.0-2.1\u001b[0m -> \u001b[1;32m0.5.1-1.1\u001b[0m\n\u001b[0;1mqt6-translations \u001b[1;32m6.6.2-1\u001b[0m -> \u001b[1;32m6.6.3-1\u001b[0m\n\u001b[0;1mqt6-webengine \u001b[1;32m6.6.2-1\u001b[0m -> \u001b[1;32m6.6.3-1\u001b[0m\n\u001b[0;1mtelegram-desktop \u001b[1;32m4.15.6-1\u001b[0m -> \u001b[1;32m4.15.6-2\u001b[0m\n\u001b[0;1mwireplumber \u001b[1;32m0.5.0-2.1\u001b[0m -> \u001b[1;32m0.5.1-1.1\u001b[0m

Which manifest as the image below.
240331_22h00m08s_screenshot

compared to updates from the AUR, which doesn't have the escape as described above, and looks like this not affected

\nprayer-times 0.2.0-1 -> 0.3.0-1\npython-spotdl 4.2.5-1 -> 4.2.5-2\nhyprshade-git 3.2.1.r94.g8110304-1\nlutris-git 0.5.16.r469.g42b74a51c-1\nryujinx-git r3265.c94a73ec60-1","class":"pending-updates"}

240331_22h07m22s_screenshot

This change appeared very recent, I wonder if this issue only on my side or is it general, and needs a solution.
Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.