Giter Club home page Giter Club logo

Comments (7)

kb100 avatar kb100 commented on June 2, 2024

Theoretically yes, but someone would have to write that code and we are busy people :(. If you want to write it yourself and submit a PR, make sure to read #132 first and comply with the new setup. Sorry for all the confusion, we are trying to migrate to a new system so this branch of the repo is frozen for now.

from i3blocks-contrib.

thyeun avatar thyeun commented on June 2, 2024

@kb100 yes, i'm wrote one for the packer but somehow i'm still stuck on the right click mouse to bring up the urxvt terminal and exec packer -Syu

need some help on this, below is the code

#used for displaying count/status in the i3blocks
output()
{
    package_list=$(packer --quickcheck)
    package_count=$(packer --quickcheck | wc -l)
    if [ $package_count -eq 0 ]; then
        echo "Up To Date"
    else
        echo "upgrades: $package_count"
    fi
}
#used for notify-send messaging when clicking i3blocks entry
notify_output()
{
    if [ $package_list -eq ""]; then
        $(notify-send -t 2000 "Upgrades:" "No Upgrades Found!")
    else
        $(notify-send "Upgrades:" "$package_list")
    fi
}

#defines i3blocks mouse click events
case $BLOCK_BUTTON in
    # left click to update & list packages
    1) output && notify_output ;;
    #right click: run upgrade then refresh i3blocks
    2) urxvt -e 'packer -Syu' && output ;;
esac

from i3blocks-contrib.

thyeun avatar thyeun commented on June 2, 2024

@kb100 make it work, but not using urxvt terminal , i change it to xfce4-terminal, have to figure out how to use urxvt.

#!/bin/bash

#used for displaying count/status in the i3blocks
output()
{
    package_list=$(packer --quickcheck)
    package_count=$(packer --quickcheck | wc -l)
    if [ $package_count -eq 0 ]; then
        echo "Up To Date"
    else
        echo "upgrades: $package_count"
    fi
}

#used for notify-send messaging when clicking i3blocks entry
notify_output()
{
    if [ $package_list -eq ""]; then
        $(notify-send -t 2000 "Upgrades:" "No Upgrades Found!")
    else
        $(notify-send "Upgrades:" "$package_list")
    fi
}

#defines i3blocks mouse click events
case $BLOCK_BUTTON in
    # left click to update & list packages
    1) output && notify_output ;;
    # right click: run upgrade then refresh i3blocks
    3) exec xfce4-terminal -e 'packer -Syu' && output ;;
esac

from i3blocks-contrib.

thyeun avatar thyeun commented on June 2, 2024

@kb100, make it work now, so how to submit as new alternative 'arch-update"?

from i3blocks-contrib.

CNG avatar CNG commented on June 2, 2024

My quick hack: I am using aurman and edited L.65 to be:

output = check_output(['aurman', '-Qu']).decode('utf-8')

from i3blocks-contrib.

kb100 avatar kb100 commented on June 2, 2024

If you are having trouble launching a program like urxvt from within a blocklet, the recommended way to do it is using i3-msg -q exec your_command

from i3blocks-contrib.

thyeun avatar thyeun commented on June 2, 2024

@kb100 my bad, i should close this instead of still let it open, really sorry

from i3blocks-contrib.

Related Issues (20)

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.