Comments (21)
Hi can you please edit your message, so that your code is inside code markup? Have a look here if you don't know how to do it. Thanks
from i3blocks-contrib.
thanks :) I will have a look into it
from i3blocks-contrib.
if you change the python script in the yaourt -Qua line as follows:
output = check_output(['yaourt', '-Su', '--aur']).decode('utf-8')
do you get an update messge in your bar?
from i3blocks-contrib.
It wasn't really a problem with the script itself. The problem was that -Qua returned a non 0 status code. The python subprocess module interpretes that as an error and so the script was aborted. Normally yaourt -Qua should also exit with a 0 status code when it has no updates like -Su does. So there are two ways. To keep the -Su argument or catch the exception and check if the catched error is infact empty and go on, because it wasn't a real error
from i3blocks-contrib.
No you are right 😄 . But I'm still fiddling around, what will be the best solution to that problem. I will give you an update here, if the code is updated in the repository
from i3blocks-contrib.
problem will be fixed with #97
from i3blocks-contrib.
Yes I liked that solution more than the first one. Glad it's working now. Thanks for your help
from i3blocks-contrib.
I am sorry for the appearance of my message, I don't know why I can't just deactivate this "text formatting" bs :(
And I'd also like to apologize for any English mistakes I may have done, English is not my mothertongue. As you might see on my screenshot, I'm French.
Thanks in advance for any help you might give me! :)
from i3blocks-contrib.
Hi snowiow,
I'll get on that right now, thanks for answering :) 👍
EDIT : DONE. Thanks for your link!
from i3blocks-contrib.
Hey I've got some news :
When I take the -a out of the command in i3blocks.conf, everything works.
Odd thing is : yaourt in installed and running on my arch system. I often use it, I have aur packages... so WTH ?
from i3blocks-contrib.
Yes the problem is that yaourt exits with a non zero status when it has no updates. Python subprocess thinks there was an error during the execution und raises it
from i3blocks-contrib.
def get_aur_update_count():
output = ''
try:
output = check_output(['yaourt', '-Qua']).decode('utf-8')
except subprocess.CalledProcessError as e:
print("Ping stdout output:\n", e.output)
if not output:
return 0
aur_updates = [line
for line in output.split('\n')
if line.startswith('aur/')]
return len(aur_updates)
you can check yourself, if you update the method like this
from i3blocks-contrib.
I just tried "yaourt -Qua" and it seems to be working just find, no output at all because no update is available. This situation is expected in the py script :
if not output:
return 0
So I'm wondering : why is this not working?
EDIt : Just saw your post up this one, I'll try this out right now, thanks
from i3blocks-contrib.
Alright so I tried and edited my py script, added your modification, then restarted i3.
Nothing appears on top no more. I have one update available, so the script's sending back to me 1, but nothing on the bar. :(
This is just odd.
from i3blocks-contrib.
After a few tests, I can confirm that, at least, without the -a option, everything works just fine, so the issue is definitly about yaourt and AUR updates.
from i3blocks-contrib.
So this is how my codes look like right now :
def get_aur_update_count():
output = ''
try:
output = check_output(['yaourt', '-Su', '--aur']).decode('utf-8')
except subprocess.CalledProcessError as e:
print("Ping stdout output:\n", e.output)
if not output:
return 0
aur_updates = [line
for line in output.split('\n')
if line.startswith('aur/')]
return len(aur_updates)
[arch-update]
command=/usr/lib/i3blocks/arch-update.py -a -b "#FFFFFF" -u "#FF0000"
interval=600
markup=pango
And... it seems to work fine! I mean, I do not have any update available for now, but I do have the update status in my bar, right how and where it should be!
Thanks a lot for your help, man. May I ask, because I am no python expert, what was wrong with the script in the first place?
from i3blocks-contrib.
Well, sir, you obviously are much better in Python than I am. I'm still learning tho.
Thanks for the explanation, thanks for answering me, and resolving my issue.
I'm wondering... The modification you made... Shouldn't it be put in the default script, so that other users can benefit from it?
Sorry if I'm saying nonsense, I'm quite new to github too.
from i3blocks-contrib.
@snowiow Thanks for handling this one. If you think this may be a common issue, I would merge the fix for it, and @Pxmme if your issue is resolved please close the issue.
from i3blocks-contrib.
Hey, anyway, thanks again man. I really appreciate how quick you helped me.
I guess I have to put this issue in "resolved" mode now... Let's see how to do that. :)
from i3blocks-contrib.
Yay! Done, @kb100 👍
from i3blocks-contrib.
@snowiow I updated my arch-update.py with the #97 modifications you made, since they were a little bit different from the solution you offered me here 👍
Everything seems to work just fine!
Merci encore :)
from i3blocks-contrib.
Related Issues (20)
- volume-pipewire is not able to forward default sink when clicked on HOT 1
- confusing formatting in rofi-calendar
- bandwidth2: missing dependency
- temperature block shows wrong temperature
- The cpu_usage2 blocklet isn't working HOT 1
- The blocklet battery-poly isn't working HOT 2
- only appears the clock with date
- key_layout doesn't work because it doesn't output a \n at the end HOT 1
- Root Makefile errors
- Using Font Awesome 6 instead of Font Awesome 5 for dunst
- apt-upgrades
- Issue with Icons in volume-pipewire
- The memory2 block uses incorrect math to calculate ram usage HOT 1
- volume-pulseaudio higher than 100%
- calendar: calendar display at wrong position for different i3 bar position HOT 2
- [bandwidth] tailscale showing as "down"
- [volume_pulse] grep warning
- [mediaplayer] no output if metadata invalid
- [mediaplayer][rfc] make MPRIS a hard dependency?
- The module `cpu_usage2` doesn't compile with clang/llvm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i3blocks-contrib.