Xmobar updates

A place to share tips, guides, application configurations and scripts about all elements of ArchLabs

Moderator: Founder

Xmobar updates

PostPosted by appath » Thu Jun 22, 2017 10:54 am

Xmobar = updates =
[Haron]

Image

I want to share:
Configuring the availability of updates
Let's start, perhaps checking for updates and actions if there are any.
[] We edit xinitrc we will add there

Code: Select all
Mkfifo / tmp / pipe &


Create scripts

Code: Select all
$ touch ~ / .local / bin / {XMUpdate, XMYaourt}


We open them

Code: Select all
~/.local/bin/XMUpdate
#!/bin/sh
UPD=`checkupdates | wc -l`
if [ $UPD -gt 0 ]; then echo '<fc=#cccccc>Update:</fc> <fc=#ff6500>'$UPD' pkg</fc>' > /tmp/pipe
else echo > /tmp/pipe
fi
exit 0


==========

Code: Select all
~/.local/bin/XMYaourt
#!/bin/sh
urxvtc -name update -e yaourt -Syua &&
while `pgrep yaourt >/dev/null`
do
    sleep 1
done
echo > /tmp/pipe
exit 0


* Instead of urxvt which is more convenient for you
Give them the rights

Code: Select all
$ chmod +x ~/.local/bin/{XMUpdate,XMYaourt}


Editing .xmobarrc
First we add scripts

Code: Select all
, Run Com        "XMUpdate" [] "" 36000
, Run PipeReader "/tmp/pipe" "Update"


* 36000 updates will be checked every hour
** updates are checked only in those repositories that are registered in pacman.conf

Then we enforce their execution in the string template

Code: Select all
<action=`XMYaourt` button=1>%Update%%XMUpdate%</action>


As a result, if there are updates, xmobar will display this inscription
In the absence of updates, nothing is output. This is the responsibility of the XMUpdate script

After the updates are installed, the terminal closes automatically
[] a.. https://wiki.archlinux.org/index.php/Xmobar
: : : : : : :: :: : : ::: : :: :: 112 :: : :
DeviantArt // GitHub ...
appath
 
Posts: 7
Joined: Thu Jun 22, 2017 10:16 am
Location: Current Residence: Russia [black hole]
Running Release: 4.0

Re: Xmobar updates

PostPosted by erikdubois » Thu Jun 22, 2017 4:42 pm

Can we add this to tint2?
Living to learn, learning to live.
Linux fits well in my life's motto.
More info on http://erikdubois.be
Archlabs support articles are on https://goo.gl/AaYI0b
Archlabs support youtube channel is on https://goo.gl/Lovquv
User avatar
erikdubois
Site Admin
Site Admin
 
Posts: 333
Joined: Sun Mar 05, 2017 5:42 am
Location: Belgium

Re: Xmobar updates

PostPosted by appath » Thu Jun 22, 2017 9:31 pm

erikdubois wrote:Can we add this to tint2?

I have not tried it yet with tint2 It must be reconsidered. Until for him did not.
But with xmobar yes, everything is working.
The script is very useful with an alert on the panel pop-up if there are updates.
: : : : : : :: :: : : ::: : :: :: 112 :: : :
DeviantArt // GitHub ...
appath
 
Posts: 7
Joined: Thu Jun 22, 2017 10:16 am
Location: Current Residence: Russia [black hole]
Running Release: 4.0


Return to Configs, Scripts, Tutorials and Tips

Who is online

Users browsing this forum: No registered users and 0 guests