You are not logged in.

#26 2020-11-23 09:35:17

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,152
Website

Re: Can you help me make a pipemenu to add to menu?

What exactly is a data needed for single connection? An example?

Offline

#27 2020-11-23 15:04:00

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 325
Website

Re: Can you help me make a pipemenu to add to menu?

brontosaurusrex wrote:

What exactly is a data needed for single connection? An example?

So far as I can tell, these are the only variables that I need to use.

host: schwim.net
user: schwim
local dir: /home/schwim/schwim.net
remote dir: /var/www/client1

Last edited by schwim (2020-11-23 15:08:31)


Schw.im! A social site with an identity crisis.

Offline

#28 2020-11-23 16:55:29

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,152
Website

Re: Can you help me make a pipemenu to add to menu?

I'd probably try with an associative array, where key would be your label (server1) and value would be the entire command needed (sshfs + all the data needed) - unlike variables one should be able to expand an array value directly (without any evals).

In this direction

#!/bin/bash

# an array here
declare -A exe
exe=(
["serverOne"]="echo woot" 
["job"]="sleep 3" 
["myserv"]="neofetch" 
)

# this is the exe
${exe[serverOne]} 
${exe[job]} 
${exe[myserv]} 

p.s. Arrays in bash are a world of pain (only my experience), so be prepared to suffer.

Last edited by brontosaurusrex (2020-11-23 17:54:42)

Offline

#29 2020-11-24 01:17:05

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,414
Website

Re: Can you help me make a pipemenu to add to menu?

damo wrote:

"menuItem" is a variable used by BL and sourced from /usr/lib/bunsen/common/bl-includes.

You should have seen this in the existing BL pipemenus.

There are also some functions for jgmenu in the same file:
jgmenuItem
jgmenuSeparator
jgmenuSubmenu
jgmenuEnd

If you're creating a jgmenu pipe menu from scratch they can save you some work (but you seem to be there already).
You can see some examples of usage in /usr/bin/bl-scrot-pipemenu


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#30 2020-11-24 01:32:00

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 325
Website

Re: Can you help me make a pipemenu to add to menu?

Would something like this make sense?

# an array here
declare -A loop
loop=(
    ["serverOne"][domain]="domain.com"
    ["serverOne"][user]="bobthebuilder"
    ["serverOne"]["local"]="/home/schwim/Remote/SSHFS/domain.com" 
    ["serverOne"]["remote"]="/var/www/client1" 

    ["serverTwo"][domain]="anotherdomain.com"
    ["serverTwo"][user]="dougthedestroyer"
    ["serverTwo"]["local"]="/home/schwim/Remote/SSHFS/anotherdomain.com" 
    ["serverTwo"]["remote"]="/home/doug/www" 
)

?  Does bash work this way?  If this is feasible, how might I go about looping through that array in the script to get to the important bits?


Schw.im! A social site with an identity crisis.

Offline

#31 2020-11-24 10:50:54

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,152
Website

Re: Can you help me make a pipemenu to add to menu?

^Not a valid bash array of any sort. https://www.shellcheck.net/
I'am out as well.

Last edited by brontosaurusrex (2020-11-24 10:52:09)

Offline

#32 2020-11-24 14:49:35

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 325
Website

Re: Can you help me make a pipemenu to add to menu?

Thanks guys, I'll continue my quest for help elsewhere.  Take care and thanks again!


Schw.im! A social site with an identity crisis.

Offline

Board footer

Powered by FluxBB