Giter VIP home page Giter VIP logo

Comments (5)

capn-damo avatar capn-damo commented on June 26, 2024

Immediate fix is

loadTEditmenu(){
    menuSeparator 
    menuItem "Default tint2rc" "bl-text-editor $TINT2RC"
    if [ "$(pidof tint2)" ];then
        menuSubmenu "RunningTint2" "Running Tint2s"
        pgrep -a tint2 | while read pid cmd; do 
            if [[ ${cmd%% *} = tint2 ]]; then
                TINT2=$(echo $cmd | awk -F"/" '{print $(NF-1)"/"$NF}')
                TINT=$(echo $cmd | awk '{print $NF}')
                if [[ $TINT2 = "tint2/tint2" ]];then
                    TINT="$TINT2RC"
                    TINT2="Default tint2rc"
                fi
                menuItem "$TINT2" "bl-text-editor $TINT"
            fi
        done
        menuSubmenuEnd
    fi
}

A sessionfile only has the paths to the chosen tint2's, so a default tint2-sessionfile would just contain the line
/home/user/.config/tint2/tint2rc

from bunsen-pipemenus.

johnraff avatar johnraff commented on June 26, 2024

btw it's possible to get rid of the awk calls:
TINT=${cmd##* }
TINT2=${TINT#$HOME/.config/}
if [[ $TINT = tint2 ]]; then...

from bunsen-pipemenus.

capn-damo avatar capn-damo commented on June 26, 2024

btw it's possible to get rid of the awk calls:

...but I find it difficult getting my head around those bash substitutions!

from bunsen-pipemenus.

johnraff avatar johnraff commented on June 26, 2024

Much nicer looking though - and faster too, if that matters.
Easy enough once you get the hang of it:
http://wiki.bash-hackers.org/syntax/pe#substring_removal

from bunsen-pipemenus.

capn-damo avatar capn-damo commented on June 26, 2024

Edited bl-tint2-pipemenu and pushed changes.

from bunsen-pipemenus.

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.