YAD - Tips

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
stemsee

#361 Post by stemsee »

Maybe you need to use --select-action or add a button that fires the select event. What sort of process to due to the item?

sel () {
echo select event - $1
}

yad \
--list \
--listen \
--dclick-action 'bash -c "dbl %s"' \
--select-action 'bash -c "sel %s"' \
--column 'A' 1 2 3 4 5 < $fifo
fromhttps://groups.google.com/forum/#!topic ... FYTLhtccd4

stemsee

#362 Post by stemsee »

Maybe you need to use --select-action

Code: Select all

#!/bin/bash -a

mkfifo ${fifo=$(mktemp -u)}
exec {fd}<>${fifo}

sel () {
echo select event - $1
}

yad \
--list \
--listen \
--select-action 'bash -c "sel %s"' \
--column 'A' 1 2 3 4 5 < $fifo
fromhttps://groups.google.com/forum/#!topic ... FYTLhtccd4

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#363 Post by fredx181 »

Hi Stemsee, your empty posts may be caused by an url link containing a space (or other reason I don't know of)

stemsee

#364 Post by stemsee »

How annoying, to have lost such a good post!

short version is, will --select-action suit your purpose, 'bash -c 'some_function "%s"'
https://groups.google.com/forum/#!topic ... FYTLhtccd4

stemsee

#365 Post by stemsee »

short version is, will --select-action suit your purpose, 'bash -c "some_function %s"'
https://groups.google.com/forum/#!topic ... FYTLhtccd4

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#366 Post by MochiMoppel »

stemsee wrote:How annoying, to have lost such a good post!

short version is, will --select-action suit your purpose, 'bash -c 'some_function "%s"'
https://groups.google.com/forum/#topic/ ... FYTLhtccd4
All your posts are still there. I had to remove the exclamation mark (before "topic") from your URL, You may want to replace it by its HTML entity:
https://groups.google.com/forum/#&excl; ... FYTLhtccd4

And please use the Preview button before you post :wink:

EDIT: Removed letter v from URL. HTML entity doesn't seem to work. Google insists on the problematic exclamation mark in #!topic

.
Last edited by MochiMoppel on Wed 21 Feb 2018, 06:21, edited 1 time in total.

stemsee

#367 Post by stemsee »

Thanks mochimoppel

I did nothing different at all than ever before! And the url changed adding a v

should be
https://groups.google.com/forum/#!topic ... FYTLhtccd4

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#368 Post by MochiMoppel »

stemsee wrote:Thanks mochimoppel

I did nothing different at all than ever before! And the url changed adding a v

should be
https://groups.google.com/forum/#!topic ... FYTLhtccd4
You're welcome. The "v" must have been my fault and I edited my post, but the real problem is the exclamation mark.
I removed surrounding [url] tags from the URL in above quote to make this post visible.

stemsee

#369 Post by stemsee »

Is it the url tags then?

yes it is!

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#370 Post by step »

Stemsee's posts starting with http://www.murga-linux.com/puppy/viewto ... 553#983553 look empty to me. I use a Chromium-based browser.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

stemsee

#371 Post by stemsee »

I am on chrome. The first posts were from a windows pc, the subsequent blank posts were on linux ... I did nothing unusual or different. Something with chrome and url tag markup is being parsed by chrome code, i guess.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#372 Post by fredx181 »

Hi Stemsee, you're not a man of many words nowadays :D
The PM you sent me was also empty.
I'm on Firefox, but I think it doesn't matter, it's because of the exclamation mark in the url.
From Mochi's comments and what I tested, all you have to do is remove the url tags from the google link (so it appears as not clickable, as below) and your posts will reappear.

https://groups.google.com/forum/#!topic ... FYTLhtccd4

Fred

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#373 Post by MochiMoppel »

fredx181 wrote:From Mochi's comments and what I tested, all you have to do is remove the url tags from the google link (so it appears as not clickable, as below) and your posts will reappear.

https://groups.google.com/forum/#!topic ... FYTLhtccd4
The forum software allows url tags when you replace the exclamation mark by its hex representation (%21):
https://groups.google.com/forum/#%21top ... FYTLhtccd4

stemsee

#374 Post by stemsee »

Now I understand 'which' exclamation mark you are talking about ... I couldn't see one in my browser address bar lol!

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#375 Post by fredx181 »

Hi misko_2083 (or anyone can test below ?),

Question about your Poor man's radio, shared here:
http://murga-linux.com/puppy/viewtopic. ... 382#963382

I'm interested because of the "refresh list" option.
The problem I experienced is very high CPU usage (100%) for the yad proccess after changing category. (see screenshot below from top output)
Switching from default "181.FM" to "Blues" and click "Load Stations" is when it occurs for me, going back to "181.FM" the CPU usage drops back to normal.
Can you reproduce this ? And if you can, any solution ?

EDIT: Got it fixed now by adding Urban to "stations" list:

Code: Select all

## Urban
.....
.....
EDIT2: Attached "stations" with added 'Urban' (not all play, btw), remove fake .gz
Can't explain why, but runs OK now, normal CPU usage.
Thanks for your nice radioplayer concept, now I need to understand how it works, with the pipes etc... :roll:

Fred
Attachments
stations.gz
stations list with added category 'Urban', remove fake .gz
(11.36 KiB) Downloaded 125 times
top_showing_yad_ high-cpu.png
Yad extreme high CPU
(48.71 KiB) Downloaded 375 times

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#376 Post by fredx181 »

Hi All,
Here's my take on a radio player using yad with the "--paned" option providing a list with radio stations (by clicking 'Load' button).
Much inspired by PMRP from misko_2083, see:
http://murga-linux.com/puppy/viewtopic. ... 382#963382
However wasn't able to understand how exactly it works, so took as a base concept for it from: Victor Ananjevsky's (yad author) "find frontend" example from here:
https://sourceforge.net/p/yad-dialog/wi ... /?limit=50
Thanks also to Stemsee for suggestions about yad "--list --listen" (refresh list) options !

Would love to have the "Now Playing" info as part of the main GUI, but couldn't figure out how, any suggestions are welcome !
Workaround is a "Now Playing" button which activates a small window at right-bottom of screen displaying the title.
Search option has access to large database from "RadioSure" (commercial M$ app) converted to use with this app.
(need to click 'Update Index' first)
Choice for lots of category lists (included in 'playlist' folder), e.g. Rock, Jazz, Country, R&B ...etc...
Possible TODO'S:
- Option to remove from Favorites list (only add is possible now)
- Ability to add custom URL (http://...) to Favorites.

Depends on yad and mplayer installed.
(not sure from which yad version on it supports --paned option, I use v 0.38 )

Extract attached yradio.tar.gz to somewhere.
Run from inside yradio folder: "yradio" script (just click on it).

EDIT: Sorry, found a bad bug: Several stations not playing because of incorrect use of the quotes for option --dclick-action" (and --select-action), fixed now, attached new version.
btw, also removed "mktemp" command from script (previously used for creating variable for named pipes, now done differently) , since it may not be portable between systems.

Fred
Attachments
yradio.tar.gz
v0.0.2, bug fixed for double-click action
Extract to somewhere and run 'yradio' from inside directory
(251.02 KiB) Downloaded 290 times
yradio.jpg
Yradio GUI
(66.15 KiB) Downloaded 1401 times
Last edited by fredx181 on Tue 13 Mar 2018, 20:28, edited 1 time in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#377 Post by fredx181 »

Bug fixed for yradio, see EDIT and new attachment above.

Fred

stemsee

#378 Post by stemsee »

Hi Fred

I was testing your yradio. When selecting say BBC from the dropdown box and then load ... how does the selected item (BBC) get read?

stemsee

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#379 Post by fredx181 »

Hi Stemsee,
By --select-action='bash -c "sel_file %s"' sending it to a file ("sel-file" in "tmp" folder)
See function sel_file
It's only for adding to Favorites (function "add_fav")

Fred

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#380 Post by musher0 »

Euh... Fredx?

You do with your time what you will of course. If your radio app above is practice
for becoming an even greater yad virtuoso than you are already, that's fine.

Otherwise, why go through the trouble? There already exist a host of good radio
players on Linux: aqualung, deadbeef, mplayer,mpv, etc.

Just a thought.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply