1 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
2 |
DENIED
|
moderate
|
App\Entity\Entry {#2458
+user: App\Entity\User {#265 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1725 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#1702 …}
+slug: "saving-and-restoring-arbitrary-sessions-including-terminal-and-GUI-impossible"
+title: "saving and restoring arbitrary sessions including terminal and GUI --- impossible?"
+url: null
+body: """
cross-posted from: [discuss.tchncs.de/post/9585677](https://discuss.tchncs.de/post/9585677)\n
\n
> My dream: I want a way to arbitrarily close and later open groups of applications including their states such as open files, window arrangement, scrollback, even undo histories etc. So working on a specific project I can close everything neatly and return to it later.\n
> \n
> In my research/experiments here is what I come up with, do you agree?:\n
> \n
> 1. in the terminal-only environment this would be tmux or another multiplexer\n
> 2. But when you start including GUI applications (which I must), then it is something else that doesn’t exactly exist\n
> 3. Applications store their current states in a variety of places and some of them don’t really *do* restoring in any way so it would be hard to force.\n
> 4. the best option for this is something like [xpra](https://github.com/Xpra-org/xpra/) where you can have multiple sessions. If you had a machine that stayed powered-on all the time it might be possible to create sessions, log in remotely and use them that way.\n
> 5. Using xpra or similar the sessions are never really actually closed. You would only close the connection from the local machine. If the machine faces a power off then too bad. As far as I can se there is basically no way to accomplish this goal where power-offs are accommodated.\n
> \n
> I have tried some remote-login options but they are too slow for normal use. I tend to have pretty low-end hardware running (because so far it works for most things) so maybe if I upgraded it would improve.\n
> \n
> 1. is it plausible?\n
> 2. how to estimate hardware/performance needs of host, client and LAN? anything else to consider?\n
> \n
> I typically use manjaro + XFCE but would be willing to try something different to accomplish the goal. I only want to do this locally on LAN not remotely.\n
> \n
> re XFCE session managerXFCE has session management but the majority of programs don’t totally work with. Like maybe the application will re-open when the session is restored but no files will be open even if they were when session was saved. Or distribution through workspaces, window size etc will not be restored.
"""
+type: "article"
+lang: "en"
+isOc: false
+hasEmbed: false
+commentCount: 6
+favouriteCount: 21
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1727246437 {#1707
date: 2024-09-25 08:40:37.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#2456 …}
+votes: Doctrine\ORM\PersistentCollection {#2411 …}
+reports: Doctrine\ORM\PersistentCollection {#2447 …}
+favourites: Doctrine\ORM\PersistentCollection {#2454 …}
+notifications: Doctrine\ORM\PersistentCollection {#2459 …}
+badges: Doctrine\ORM\PersistentCollection {#2470 …}
+children: []
-id: 32002
-titleTs: "'arbitrari':4 'gui':9 'imposs':10 'includ':6 'restor':3 'save':1 'session':5 'termin':7"
-bodyTs: "'/post/9585677](https://discuss.tchncs.de/post/9585677)':7 '/xpra-org/xpra/)':143 '1':66,273 '2':80,277 '3':101 '4':131 '5':178 'accommod':230 'accomplish':222,306 'actual':188 'agre':65 'anoth':78 'anyth':288 'applic':22,87,102,340 'arbitrarili':15 'arrang':31 'bad':209 'basic':218 'best':133 'client':285 'close':16,45,189,193 'come':60 'connect':195 'consid':291 'creat':168 'cross':2 'cross-post':1 'current':105 'differ':304 'discuss.tchncs.de':6 'discuss.tchncs.de/post/9585677](https://discuss.tchncs.de/post/9585677)':5 'distribut':365 'doesn':97 'dream':9 'els':95,289 'end':254 'environ':72 'estim':280 'etc':36,370 'even':33,356 'everyth':46 'exact':99 'exist':100 'face':203 'far':211,259 'file':29,352 'forc':130 'github.com':142 'github.com/xpra-org/xpra/)':141 'goal':224,308 'group':20 'gui':86 'hard':128 'hardwar':255 'hardware/performance':281 'histori':35 'host':284 'improv':272 'includ':23,85 'lan':287,317 'later':18,52 'like':139,337 'local':198,315 'log':170 'login':237 'low':253 'low-end':252 'machin':154,199,202 'major':329 'manag':326 'managerxfc':323 'manjaro':295 'mayb':266,338 'might':164 'multipl':148 'multiplex':79 'must':90 'neat':47 'need':282 'never':186 'normal':245 'off':228 'open':19,28,344,355 'option':134,238 'place':111 'plausibl':276 'possibl':166 'post':3 'power':158,205,227 'power-off':226 'powered-on':157 'pretti':251 'program':331 'project':42 're':320,343 're-open':342 'realli':118,187 'remot':172,236,319 'remote-login':235 'research/experiments':55 'restor':120,349,374 'return':49 'run':256 'save':363 'scrollback':32 'se':215 'session':149,169,184,322,325,347,361 'similar':182 'size':369 'slow':243 'someth':94,138,303 'specif':41 'start':84 'state':25,106 'stay':156 'store':103 'tend':248 'termin':70 'terminal-on':69 'thing':264 'time':162 'tmux':76 'total':334 'tri':233,302 'typic':293 'undo':34 'upgrad':269 'use':174,179,246,294 'varieti':109 'want':11,311 'way':13,123,177,220 'will':300 'window':30,368 'work':38,261,335 'workspac':367 'would':74,126,191,271,298 'xfce':296,321 'xpra':140,180"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1705869374
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/9588351"
+editedAt: null
+createdAt: DateTimeImmutable @1705785374 {#1739
date: 2024-01-20 22:16:14.0 +01:00
}
} |
|
Show voter details
|
3 |
DENIED
|
edit
|
App\Entity\Entry {#2458
+user: App\Entity\User {#265 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1725 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#1702 …}
+slug: "saving-and-restoring-arbitrary-sessions-including-terminal-and-GUI-impossible"
+title: "saving and restoring arbitrary sessions including terminal and GUI --- impossible?"
+url: null
+body: """
cross-posted from: [discuss.tchncs.de/post/9585677](https://discuss.tchncs.de/post/9585677)\n
\n
> My dream: I want a way to arbitrarily close and later open groups of applications including their states such as open files, window arrangement, scrollback, even undo histories etc. So working on a specific project I can close everything neatly and return to it later.\n
> \n
> In my research/experiments here is what I come up with, do you agree?:\n
> \n
> 1. in the terminal-only environment this would be tmux or another multiplexer\n
> 2. But when you start including GUI applications (which I must), then it is something else that doesn’t exactly exist\n
> 3. Applications store their current states in a variety of places and some of them don’t really *do* restoring in any way so it would be hard to force.\n
> 4. the best option for this is something like [xpra](https://github.com/Xpra-org/xpra/) where you can have multiple sessions. If you had a machine that stayed powered-on all the time it might be possible to create sessions, log in remotely and use them that way.\n
> 5. Using xpra or similar the sessions are never really actually closed. You would only close the connection from the local machine. If the machine faces a power off then too bad. As far as I can se there is basically no way to accomplish this goal where power-offs are accommodated.\n
> \n
> I have tried some remote-login options but they are too slow for normal use. I tend to have pretty low-end hardware running (because so far it works for most things) so maybe if I upgraded it would improve.\n
> \n
> 1. is it plausible?\n
> 2. how to estimate hardware/performance needs of host, client and LAN? anything else to consider?\n
> \n
> I typically use manjaro + XFCE but would be willing to try something different to accomplish the goal. I only want to do this locally on LAN not remotely.\n
> \n
> re XFCE session managerXFCE has session management but the majority of programs don’t totally work with. Like maybe the application will re-open when the session is restored but no files will be open even if they were when session was saved. Or distribution through workspaces, window size etc will not be restored.
"""
+type: "article"
+lang: "en"
+isOc: false
+hasEmbed: false
+commentCount: 6
+favouriteCount: 21
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1727246437 {#1707
date: 2024-09-25 08:40:37.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#2456 …}
+votes: Doctrine\ORM\PersistentCollection {#2411 …}
+reports: Doctrine\ORM\PersistentCollection {#2447 …}
+favourites: Doctrine\ORM\PersistentCollection {#2454 …}
+notifications: Doctrine\ORM\PersistentCollection {#2459 …}
+badges: Doctrine\ORM\PersistentCollection {#2470 …}
+children: []
-id: 32002
-titleTs: "'arbitrari':4 'gui':9 'imposs':10 'includ':6 'restor':3 'save':1 'session':5 'termin':7"
-bodyTs: "'/post/9585677](https://discuss.tchncs.de/post/9585677)':7 '/xpra-org/xpra/)':143 '1':66,273 '2':80,277 '3':101 '4':131 '5':178 'accommod':230 'accomplish':222,306 'actual':188 'agre':65 'anoth':78 'anyth':288 'applic':22,87,102,340 'arbitrarili':15 'arrang':31 'bad':209 'basic':218 'best':133 'client':285 'close':16,45,189,193 'come':60 'connect':195 'consid':291 'creat':168 'cross':2 'cross-post':1 'current':105 'differ':304 'discuss.tchncs.de':6 'discuss.tchncs.de/post/9585677](https://discuss.tchncs.de/post/9585677)':5 'distribut':365 'doesn':97 'dream':9 'els':95,289 'end':254 'environ':72 'estim':280 'etc':36,370 'even':33,356 'everyth':46 'exact':99 'exist':100 'face':203 'far':211,259 'file':29,352 'forc':130 'github.com':142 'github.com/xpra-org/xpra/)':141 'goal':224,308 'group':20 'gui':86 'hard':128 'hardwar':255 'hardware/performance':281 'histori':35 'host':284 'improv':272 'includ':23,85 'lan':287,317 'later':18,52 'like':139,337 'local':198,315 'log':170 'login':237 'low':253 'low-end':252 'machin':154,199,202 'major':329 'manag':326 'managerxfc':323 'manjaro':295 'mayb':266,338 'might':164 'multipl':148 'multiplex':79 'must':90 'neat':47 'need':282 'never':186 'normal':245 'off':228 'open':19,28,344,355 'option':134,238 'place':111 'plausibl':276 'possibl':166 'post':3 'power':158,205,227 'power-off':226 'powered-on':157 'pretti':251 'program':331 'project':42 're':320,343 're-open':342 'realli':118,187 'remot':172,236,319 'remote-login':235 'research/experiments':55 'restor':120,349,374 'return':49 'run':256 'save':363 'scrollback':32 'se':215 'session':149,169,184,322,325,347,361 'similar':182 'size':369 'slow':243 'someth':94,138,303 'specif':41 'start':84 'state':25,106 'stay':156 'store':103 'tend':248 'termin':70 'terminal-on':69 'thing':264 'time':162 'tmux':76 'total':334 'tri':233,302 'typic':293 'undo':34 'upgrad':269 'use':174,179,246,294 'varieti':109 'want':11,311 'way':13,123,177,220 'will':300 'window':30,368 'work':38,261,335 'workspac':367 'would':74,126,191,271,298 'xfce':296,321 'xpra':140,180"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1705869374
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/9588351"
+editedAt: null
+createdAt: DateTimeImmutable @1705785374 {#1739
date: 2024-01-20 22:16:14.0 +01:00
}
} |
|
Show voter details
|
4 |
DENIED
|
moderate
|
App\Entity\Entry {#2458
+user: App\Entity\User {#265 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1725 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#1702 …}
+slug: "saving-and-restoring-arbitrary-sessions-including-terminal-and-GUI-impossible"
+title: "saving and restoring arbitrary sessions including terminal and GUI --- impossible?"
+url: null
+body: """
cross-posted from: [discuss.tchncs.de/post/9585677](https://discuss.tchncs.de/post/9585677)\n
\n
> My dream: I want a way to arbitrarily close and later open groups of applications including their states such as open files, window arrangement, scrollback, even undo histories etc. So working on a specific project I can close everything neatly and return to it later.\n
> \n
> In my research/experiments here is what I come up with, do you agree?:\n
> \n
> 1. in the terminal-only environment this would be tmux or another multiplexer\n
> 2. But when you start including GUI applications (which I must), then it is something else that doesn’t exactly exist\n
> 3. Applications store their current states in a variety of places and some of them don’t really *do* restoring in any way so it would be hard to force.\n
> 4. the best option for this is something like [xpra](https://github.com/Xpra-org/xpra/) where you can have multiple sessions. If you had a machine that stayed powered-on all the time it might be possible to create sessions, log in remotely and use them that way.\n
> 5. Using xpra or similar the sessions are never really actually closed. You would only close the connection from the local machine. If the machine faces a power off then too bad. As far as I can se there is basically no way to accomplish this goal where power-offs are accommodated.\n
> \n
> I have tried some remote-login options but they are too slow for normal use. I tend to have pretty low-end hardware running (because so far it works for most things) so maybe if I upgraded it would improve.\n
> \n
> 1. is it plausible?\n
> 2. how to estimate hardware/performance needs of host, client and LAN? anything else to consider?\n
> \n
> I typically use manjaro + XFCE but would be willing to try something different to accomplish the goal. I only want to do this locally on LAN not remotely.\n
> \n
> re XFCE session managerXFCE has session management but the majority of programs don’t totally work with. Like maybe the application will re-open when the session is restored but no files will be open even if they were when session was saved. Or distribution through workspaces, window size etc will not be restored.
"""
+type: "article"
+lang: "en"
+isOc: false
+hasEmbed: false
+commentCount: 6
+favouriteCount: 21
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1727246437 {#1707
date: 2024-09-25 08:40:37.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#2456 …}
+votes: Doctrine\ORM\PersistentCollection {#2411 …}
+reports: Doctrine\ORM\PersistentCollection {#2447 …}
+favourites: Doctrine\ORM\PersistentCollection {#2454 …}
+notifications: Doctrine\ORM\PersistentCollection {#2459 …}
+badges: Doctrine\ORM\PersistentCollection {#2470 …}
+children: []
-id: 32002
-titleTs: "'arbitrari':4 'gui':9 'imposs':10 'includ':6 'restor':3 'save':1 'session':5 'termin':7"
-bodyTs: "'/post/9585677](https://discuss.tchncs.de/post/9585677)':7 '/xpra-org/xpra/)':143 '1':66,273 '2':80,277 '3':101 '4':131 '5':178 'accommod':230 'accomplish':222,306 'actual':188 'agre':65 'anoth':78 'anyth':288 'applic':22,87,102,340 'arbitrarili':15 'arrang':31 'bad':209 'basic':218 'best':133 'client':285 'close':16,45,189,193 'come':60 'connect':195 'consid':291 'creat':168 'cross':2 'cross-post':1 'current':105 'differ':304 'discuss.tchncs.de':6 'discuss.tchncs.de/post/9585677](https://discuss.tchncs.de/post/9585677)':5 'distribut':365 'doesn':97 'dream':9 'els':95,289 'end':254 'environ':72 'estim':280 'etc':36,370 'even':33,356 'everyth':46 'exact':99 'exist':100 'face':203 'far':211,259 'file':29,352 'forc':130 'github.com':142 'github.com/xpra-org/xpra/)':141 'goal':224,308 'group':20 'gui':86 'hard':128 'hardwar':255 'hardware/performance':281 'histori':35 'host':284 'improv':272 'includ':23,85 'lan':287,317 'later':18,52 'like':139,337 'local':198,315 'log':170 'login':237 'low':253 'low-end':252 'machin':154,199,202 'major':329 'manag':326 'managerxfc':323 'manjaro':295 'mayb':266,338 'might':164 'multipl':148 'multiplex':79 'must':90 'neat':47 'need':282 'never':186 'normal':245 'off':228 'open':19,28,344,355 'option':134,238 'place':111 'plausibl':276 'possibl':166 'post':3 'power':158,205,227 'power-off':226 'powered-on':157 'pretti':251 'program':331 'project':42 're':320,343 're-open':342 'realli':118,187 'remot':172,236,319 'remote-login':235 'research/experiments':55 'restor':120,349,374 'return':49 'run':256 'save':363 'scrollback':32 'se':215 'session':149,169,184,322,325,347,361 'similar':182 'size':369 'slow':243 'someth':94,138,303 'specif':41 'start':84 'state':25,106 'stay':156 'store':103 'tend':248 'termin':70 'terminal-on':69 'thing':264 'time':162 'tmux':76 'total':334 'tri':233,302 'typic':293 'undo':34 'upgrad':269 'use':174,179,246,294 'varieti':109 'want':11,311 'way':13,123,177,220 'will':300 'window':30,368 'work':38,261,335 'workspac':367 'would':74,126,191,271,298 'xfce':296,321 'xpra':140,180"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1705869374
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/9588351"
+editedAt: null
+createdAt: DateTimeImmutable @1705785374 {#1739
date: 2024-01-20 22:16:14.0 +01:00
}
} |
|
Show voter details
|
5 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
6 |
DENIED
|
moderate
|
App\Entity\Entry {#1551
+user: App\Entity\User {#265 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1725 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#1702 …}
+slug: "Use-YAD-Zenity-dialogues-to-populated-variables-in-a-bash-script"
+title: "Use YAD/Zenity dialogues to populated variables in a bash script?"
+url: null
+body: """
I am learning some bash scripting.\n
\n
I am interested to learn about getting input for my scripts via a GUI interface. It seems that `yad` (forked from `zenity`) is the most robust tool for this. (But if there is a better choice I would like to hear about it too.)\n
\n
Is it possible to obtain *2 or more* named variables using `yad`? *Not* just getting the values based on their positions (`$1`, `$2`, etc), with `awk`. See “What doesn’t work” spoiler for those.\n
\n
What doesn't workI find how to obtain *one* named variable, for [example](https://askubuntu.com/questions/489497/store-the-return-string-to-a-variable-from-zenity): `sh inputStr=$(zenity --entry --title=“My Title” --text=“My Text:”) `I also find solutions relying on opening single-variable dialogues sequentially but that’s a terrible interface. Everything else relies on chopping up the output with `awk` or based on the positions, `$1`, `$2`, `$3` etc. In [this script](https://askubuntu.com/a/1251429) `$jpgfile` is obtained: `sh jpgfile=$(echo $OUTPUT | awk ‘BEGIN {FS=“,” } { print $1 }’) `This seems unmanageable because adding a new field or failing to provide input for a field will both change the output order of every subsequent value. It’s way too fragile.\n
\n
For a simple example, I want to ask the user for a file name and some content. Creating the dialogue is like this:\n
\n
```\n
\n
<span style="color:#323232;">yad --title </span><span style="color:#183691;">"Create a file"</span><span style="color:#323232;"> --form --field</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">"File name"</span><span style="color:#323232;"> --field</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">"Content"\n
</span>\n
```\n
\n
If you fill both fields the output in the terminal is `file|this is some text|`. How do I get them into variables like `$filename` and `$filecontent`? So then I can finish the script like this:\n
\n
```\n
\n
<span style="color:#323232;">touch </span><span style="color:#183691;">"$</span><span style="color:#323232;">filename</span><span style="color:#183691;">"\n
</span><span style="color:#62a35c;">echo </span><span style="color:#183691;">"$</span><span style="color:#323232;">filecontent</span><span style="color:#183691;">" </span><span style="font-weight:bold;color:#a71d5d;">> </span><span style="color:#323232;">$filename\n
</span>\n
```\n
\n
Is this possible??? I do not find it anywhere. I looked though all kinds of websites like [YAD Guide](https://yad-guide.ingk.se/), [yad man page](https://www.mankier.com/1/yad), [smokey01](https://smokey01.com/yad/). Maybe I missed something. On [yaddemo](https://github.com/cjungmann/yaddemo/) I read about bash arrays and it seemed to come close but I couldn’t quite piece it together.
"""
+type: "article"
+lang: "en"
+isOc: false
+hasEmbed: false
+commentCount: 5
+favouriteCount: 9
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1729147158 {#1574
date: 2024-10-17 08:39:18.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1701 …}
+votes: Doctrine\ORM\PersistentCollection {#1687 …}
+reports: Doctrine\ORM\PersistentCollection {#1686 …}
+favourites: Doctrine\ORM\PersistentCollection {#1719 …}
+notifications: Doctrine\ORM\PersistentCollection {#1735 …}
+badges: Doctrine\ORM\PersistentCollection {#2463 …}
+children: []
-id: 33597
-titleTs: "'bash':9 'dialogu':3 'popul':5 'script':10 'use':1 'variabl':6 'yad/zenity':2"
-bodyTs: "'/),':293 '/1/yad),':299 '/a/1251429)':153 '/cjungmann/yaddemo/)':312 '/questions/489497/store-the-return-string-to-a-variable-from-zenity):':100 '/yad/).':303 '1':72,144,165 '2':56,73,145 '3':146 'ad':170 'also':112 'anywher':280 'array':317 'ask':204 'askubuntu.com':99,152 'askubuntu.com/a/1251429)':151 'askubuntu.com/questions/489497/store-the-return-string-to-a-variable-from-zenity):':98 'awk':76,138,161 'base':68,140 'bash':5,316 'begin':162 'better':41 'chang':184 'choic':42 'chop':133 'close':323 'come':322 'content':213,230 'couldn':326 'creat':214,222 'dialogu':121,216 'doesn':79,86 'echo':159,269 'els':130 'entri':104 'etc':74,147 'everi':189 'everyth':129 'exampl':97,200 'fail':175 'field':173,181,226,229,235 'file':209,224,227,242 'filecont':257,270 'filenam':255,268,271 'fill':233 'find':89,113,278 'finish':262 'fork':26 'form':225 'fragil':196 'fs':163 'get':13,65,250 'github.com':311 'github.com/cjungmann/yaddemo/)':310 'gui':20 'guid':290 'hear':47 'input':14,178 'inputstr':102 'interest':9 'interfac':21,128 'jpgfile':154,158 'kind':285 'learn':3,11 'like':45,218,254,265,288 'look':282 'man':295 'mayb':304 'miss':306 'name':59,94,210,228 'new':172 'obtain':55,92,156 'one':93 'open':117 'order':187 'output':136,160,186,237 'page':296 'piec':329 'posit':71,143 'possibl':53,274 'print':164 'provid':177 'quit':328 'read':314 'reli':115,131 'robust':32 'script':6,17,150,264 'see':77 'seem':23,167,320 'sequenti':122 'sh':101,157 'simpl':199 'singl':119 'single-vari':118 'smokey01':300 'smokey01.com':302 'smokey01.com/yad/).':301 'solut':114 'someth':307 'spoiler':82 'subsequ':190 'termin':240 'terribl':127 'text':108,110,246 'though':283 'titl':105,107,221 'togeth':331 'tool':33 'touch':267 'unmanag':168 'use':61 'user':206 'valu':67,191 'variabl':60,95,120,253 'via':18 'want':202 'way':194 'websit':287 'work':81 'worki':88 'would':44 'www.mankier.com':298 'www.mankier.com/1/yad),':297 'yad':25,62,220,289,294 'yad-guide.ingk.se':292 'yad-guide.ingk.se/),':291 'yaddemo':309 'zeniti':28,103"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1706482025
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/9987356"
+editedAt: DateTimeImmutable @1729128865 {#1409
date: 2024-10-17 03:34:25.0 +02:00
}
+createdAt: DateTimeImmutable @1706436525 {#1586
date: 2024-01-28 11:08:45.0 +01:00
}
} |
|
Show voter details
|
7 |
DENIED
|
edit
|
App\Entity\Entry {#1551
+user: App\Entity\User {#265 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1725 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#1702 …}
+slug: "Use-YAD-Zenity-dialogues-to-populated-variables-in-a-bash-script"
+title: "Use YAD/Zenity dialogues to populated variables in a bash script?"
+url: null
+body: """
I am learning some bash scripting.\n
\n
I am interested to learn about getting input for my scripts via a GUI interface. It seems that `yad` (forked from `zenity`) is the most robust tool for this. (But if there is a better choice I would like to hear about it too.)\n
\n
Is it possible to obtain *2 or more* named variables using `yad`? *Not* just getting the values based on their positions (`$1`, `$2`, etc), with `awk`. See “What doesn’t work” spoiler for those.\n
\n
What doesn't workI find how to obtain *one* named variable, for [example](https://askubuntu.com/questions/489497/store-the-return-string-to-a-variable-from-zenity): `sh inputStr=$(zenity --entry --title=“My Title” --text=“My Text:”) `I also find solutions relying on opening single-variable dialogues sequentially but that’s a terrible interface. Everything else relies on chopping up the output with `awk` or based on the positions, `$1`, `$2`, `$3` etc. In [this script](https://askubuntu.com/a/1251429) `$jpgfile` is obtained: `sh jpgfile=$(echo $OUTPUT | awk ‘BEGIN {FS=“,” } { print $1 }’) `This seems unmanageable because adding a new field or failing to provide input for a field will both change the output order of every subsequent value. It’s way too fragile.\n
\n
For a simple example, I want to ask the user for a file name and some content. Creating the dialogue is like this:\n
\n
```\n
\n
<span style="color:#323232;">yad --title </span><span style="color:#183691;">"Create a file"</span><span style="color:#323232;"> --form --field</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">"File name"</span><span style="color:#323232;"> --field</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">"Content"\n
</span>\n
```\n
\n
If you fill both fields the output in the terminal is `file|this is some text|`. How do I get them into variables like `$filename` and `$filecontent`? So then I can finish the script like this:\n
\n
```\n
\n
<span style="color:#323232;">touch </span><span style="color:#183691;">"$</span><span style="color:#323232;">filename</span><span style="color:#183691;">"\n
</span><span style="color:#62a35c;">echo </span><span style="color:#183691;">"$</span><span style="color:#323232;">filecontent</span><span style="color:#183691;">" </span><span style="font-weight:bold;color:#a71d5d;">> </span><span style="color:#323232;">$filename\n
</span>\n
```\n
\n
Is this possible??? I do not find it anywhere. I looked though all kinds of websites like [YAD Guide](https://yad-guide.ingk.se/), [yad man page](https://www.mankier.com/1/yad), [smokey01](https://smokey01.com/yad/). Maybe I missed something. On [yaddemo](https://github.com/cjungmann/yaddemo/) I read about bash arrays and it seemed to come close but I couldn’t quite piece it together.
"""
+type: "article"
+lang: "en"
+isOc: false
+hasEmbed: false
+commentCount: 5
+favouriteCount: 9
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1729147158 {#1574
date: 2024-10-17 08:39:18.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1701 …}
+votes: Doctrine\ORM\PersistentCollection {#1687 …}
+reports: Doctrine\ORM\PersistentCollection {#1686 …}
+favourites: Doctrine\ORM\PersistentCollection {#1719 …}
+notifications: Doctrine\ORM\PersistentCollection {#1735 …}
+badges: Doctrine\ORM\PersistentCollection {#2463 …}
+children: []
-id: 33597
-titleTs: "'bash':9 'dialogu':3 'popul':5 'script':10 'use':1 'variabl':6 'yad/zenity':2"
-bodyTs: "'/),':293 '/1/yad),':299 '/a/1251429)':153 '/cjungmann/yaddemo/)':312 '/questions/489497/store-the-return-string-to-a-variable-from-zenity):':100 '/yad/).':303 '1':72,144,165 '2':56,73,145 '3':146 'ad':170 'also':112 'anywher':280 'array':317 'ask':204 'askubuntu.com':99,152 'askubuntu.com/a/1251429)':151 'askubuntu.com/questions/489497/store-the-return-string-to-a-variable-from-zenity):':98 'awk':76,138,161 'base':68,140 'bash':5,316 'begin':162 'better':41 'chang':184 'choic':42 'chop':133 'close':323 'come':322 'content':213,230 'couldn':326 'creat':214,222 'dialogu':121,216 'doesn':79,86 'echo':159,269 'els':130 'entri':104 'etc':74,147 'everi':189 'everyth':129 'exampl':97,200 'fail':175 'field':173,181,226,229,235 'file':209,224,227,242 'filecont':257,270 'filenam':255,268,271 'fill':233 'find':89,113,278 'finish':262 'fork':26 'form':225 'fragil':196 'fs':163 'get':13,65,250 'github.com':311 'github.com/cjungmann/yaddemo/)':310 'gui':20 'guid':290 'hear':47 'input':14,178 'inputstr':102 'interest':9 'interfac':21,128 'jpgfile':154,158 'kind':285 'learn':3,11 'like':45,218,254,265,288 'look':282 'man':295 'mayb':304 'miss':306 'name':59,94,210,228 'new':172 'obtain':55,92,156 'one':93 'open':117 'order':187 'output':136,160,186,237 'page':296 'piec':329 'posit':71,143 'possibl':53,274 'print':164 'provid':177 'quit':328 'read':314 'reli':115,131 'robust':32 'script':6,17,150,264 'see':77 'seem':23,167,320 'sequenti':122 'sh':101,157 'simpl':199 'singl':119 'single-vari':118 'smokey01':300 'smokey01.com':302 'smokey01.com/yad/).':301 'solut':114 'someth':307 'spoiler':82 'subsequ':190 'termin':240 'terribl':127 'text':108,110,246 'though':283 'titl':105,107,221 'togeth':331 'tool':33 'touch':267 'unmanag':168 'use':61 'user':206 'valu':67,191 'variabl':60,95,120,253 'via':18 'want':202 'way':194 'websit':287 'work':81 'worki':88 'would':44 'www.mankier.com':298 'www.mankier.com/1/yad),':297 'yad':25,62,220,289,294 'yad-guide.ingk.se':292 'yad-guide.ingk.se/),':291 'yaddemo':309 'zeniti':28,103"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1706482025
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/9987356"
+editedAt: DateTimeImmutable @1729128865 {#1409
date: 2024-10-17 03:34:25.0 +02:00
}
+createdAt: DateTimeImmutable @1706436525 {#1586
date: 2024-01-28 11:08:45.0 +01:00
}
} |
|
Show voter details
|
8 |
DENIED
|
moderate
|
App\Entity\Entry {#1551
+user: App\Entity\User {#265 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1725 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#1702 …}
+slug: "Use-YAD-Zenity-dialogues-to-populated-variables-in-a-bash-script"
+title: "Use YAD/Zenity dialogues to populated variables in a bash script?"
+url: null
+body: """
I am learning some bash scripting.\n
\n
I am interested to learn about getting input for my scripts via a GUI interface. It seems that `yad` (forked from `zenity`) is the most robust tool for this. (But if there is a better choice I would like to hear about it too.)\n
\n
Is it possible to obtain *2 or more* named variables using `yad`? *Not* just getting the values based on their positions (`$1`, `$2`, etc), with `awk`. See “What doesn’t work” spoiler for those.\n
\n
What doesn't workI find how to obtain *one* named variable, for [example](https://askubuntu.com/questions/489497/store-the-return-string-to-a-variable-from-zenity): `sh inputStr=$(zenity --entry --title=“My Title” --text=“My Text:”) `I also find solutions relying on opening single-variable dialogues sequentially but that’s a terrible interface. Everything else relies on chopping up the output with `awk` or based on the positions, `$1`, `$2`, `$3` etc. In [this script](https://askubuntu.com/a/1251429) `$jpgfile` is obtained: `sh jpgfile=$(echo $OUTPUT | awk ‘BEGIN {FS=“,” } { print $1 }’) `This seems unmanageable because adding a new field or failing to provide input for a field will both change the output order of every subsequent value. It’s way too fragile.\n
\n
For a simple example, I want to ask the user for a file name and some content. Creating the dialogue is like this:\n
\n
```\n
\n
<span style="color:#323232;">yad --title </span><span style="color:#183691;">"Create a file"</span><span style="color:#323232;"> --form --field</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">"File name"</span><span style="color:#323232;"> --field</span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#183691;">"Content"\n
</span>\n
```\n
\n
If you fill both fields the output in the terminal is `file|this is some text|`. How do I get them into variables like `$filename` and `$filecontent`? So then I can finish the script like this:\n
\n
```\n
\n
<span style="color:#323232;">touch </span><span style="color:#183691;">"$</span><span style="color:#323232;">filename</span><span style="color:#183691;">"\n
</span><span style="color:#62a35c;">echo </span><span style="color:#183691;">"$</span><span style="color:#323232;">filecontent</span><span style="color:#183691;">" </span><span style="font-weight:bold;color:#a71d5d;">> </span><span style="color:#323232;">$filename\n
</span>\n
```\n
\n
Is this possible??? I do not find it anywhere. I looked though all kinds of websites like [YAD Guide](https://yad-guide.ingk.se/), [yad man page](https://www.mankier.com/1/yad), [smokey01](https://smokey01.com/yad/). Maybe I missed something. On [yaddemo](https://github.com/cjungmann/yaddemo/) I read about bash arrays and it seemed to come close but I couldn’t quite piece it together.
"""
+type: "article"
+lang: "en"
+isOc: false
+hasEmbed: false
+commentCount: 5
+favouriteCount: 9
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1729147158 {#1574
date: 2024-10-17 08:39:18.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1701 …}
+votes: Doctrine\ORM\PersistentCollection {#1687 …}
+reports: Doctrine\ORM\PersistentCollection {#1686 …}
+favourites: Doctrine\ORM\PersistentCollection {#1719 …}
+notifications: Doctrine\ORM\PersistentCollection {#1735 …}
+badges: Doctrine\ORM\PersistentCollection {#2463 …}
+children: []
-id: 33597
-titleTs: "'bash':9 'dialogu':3 'popul':5 'script':10 'use':1 'variabl':6 'yad/zenity':2"
-bodyTs: "'/),':293 '/1/yad),':299 '/a/1251429)':153 '/cjungmann/yaddemo/)':312 '/questions/489497/store-the-return-string-to-a-variable-from-zenity):':100 '/yad/).':303 '1':72,144,165 '2':56,73,145 '3':146 'ad':170 'also':112 'anywher':280 'array':317 'ask':204 'askubuntu.com':99,152 'askubuntu.com/a/1251429)':151 'askubuntu.com/questions/489497/store-the-return-string-to-a-variable-from-zenity):':98 'awk':76,138,161 'base':68,140 'bash':5,316 'begin':162 'better':41 'chang':184 'choic':42 'chop':133 'close':323 'come':322 'content':213,230 'couldn':326 'creat':214,222 'dialogu':121,216 'doesn':79,86 'echo':159,269 'els':130 'entri':104 'etc':74,147 'everi':189 'everyth':129 'exampl':97,200 'fail':175 'field':173,181,226,229,235 'file':209,224,227,242 'filecont':257,270 'filenam':255,268,271 'fill':233 'find':89,113,278 'finish':262 'fork':26 'form':225 'fragil':196 'fs':163 'get':13,65,250 'github.com':311 'github.com/cjungmann/yaddemo/)':310 'gui':20 'guid':290 'hear':47 'input':14,178 'inputstr':102 'interest':9 'interfac':21,128 'jpgfile':154,158 'kind':285 'learn':3,11 'like':45,218,254,265,288 'look':282 'man':295 'mayb':304 'miss':306 'name':59,94,210,228 'new':172 'obtain':55,92,156 'one':93 'open':117 'order':187 'output':136,160,186,237 'page':296 'piec':329 'posit':71,143 'possibl':53,274 'print':164 'provid':177 'quit':328 'read':314 'reli':115,131 'robust':32 'script':6,17,150,264 'see':77 'seem':23,167,320 'sequenti':122 'sh':101,157 'simpl':199 'singl':119 'single-vari':118 'smokey01':300 'smokey01.com':302 'smokey01.com/yad/).':301 'solut':114 'someth':307 'spoiler':82 'subsequ':190 'termin':240 'terribl':127 'text':108,110,246 'though':283 'titl':105,107,221 'togeth':331 'tool':33 'touch':267 'unmanag':168 'use':61 'user':206 'valu':67,191 'variabl':60,95,120,253 'via':18 'want':202 'way':194 'websit':287 'work':81 'worki':88 'would':44 'www.mankier.com':298 'www.mankier.com/1/yad),':297 'yad':25,62,220,289,294 'yad-guide.ingk.se':292 'yad-guide.ingk.se/),':291 'yaddemo':309 'zeniti':28,103"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1706482025
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/9987356"
+editedAt: DateTimeImmutable @1729128865 {#1409
date: 2024-10-17 03:34:25.0 +02:00
}
+createdAt: DateTimeImmutable @1706436525 {#1586
date: 2024-01-28 11:08:45.0 +01:00
}
} |
|
Show voter details
|