You are not logged in.

#41 2017-08-05 10:49:36

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: The great yad hacking thread

martix wrote:
misko_2083 wrote:

Currently trying to make a UI for PMRP - Poor Man's Radio Player

I just gave it a try and it's way too cool!  cool    ...

Absolutely! Trying it out now wink


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#42 2017-08-05 15:14:45

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: The great yad hacking thread

@misko_2083  Do you have maybe an idea why I can start pmrp via terminal and load the stations but: Putting pmrp in ~/bin makes it available via gmrun (by running "pmrp") but I cannot load the stations that way?

I also made a pmrp.desktop file in /usr/share/applications with

[Desktop Entry]
Name=Poor Man's Radio Player
Exec=pmrp
Terminal=false
Type=Application
Icon=radio
Categories=Player;Audio;AudioVideo;

EDIT: ...and it does show up now in the (dynamic) menu structure.

Last edited by martix (2017-08-05 15:47:19)

Offline

#43 2017-08-05 15:42:40

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: The great yad hacking thread

martix wrote:

@misko_2083  Do you have maybe an idea why I can start pmrp via terminal and load the stations but: Putting pmrp in ~/bin makes it available via gmrun (by running "pmrp") but I cannot load the stations that way?

I also made a pmrp.desktop file in /usr/share/applications with

[Desktop Entry]
Encoding=UTF-8
Name=Poor Man's Radio Player
Exec=pmrp
Terminal=false
Type=Application
Icon=radio
Categories=Player;Audio

but it does not show up in the menu structure.

If you are using BL and the Openbox menu then it won't - it is a static menu. Desktop files will only work for dynamic menus.

To add it to the menu you need a command to open the executable in a terminal, or use a wrapper script (which will also appear in dmenu, and run with gmenu)

wrapper script: ~/bin/radio

#!/bin/bash
#
# radio - wrapper for pmrp radio-player

x-terminal-emulator -x pmrp
exit

Menu item for menu.xml:

<item label="pmrp">
	<action name="Execute">
		<execute>
			x-terminal-emulator -x pmrp
		</execute>
	</action>
</item>
man mpg123

or

mpg123 --longhelp

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#44 2017-08-05 16:03:12

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: The great yad hacking thread

^Thank you @damo. Actually it's been cross-posting - that issue with the menu entry is fixed now. Mostly I'm using dynamic menus (like in this case). It did work with jgmenu before and now it also works with the menu by bl-obmenu-generator. As the posts (and Edit) show I had to add one more keyword to "Categories" that was recognized by bl-obmenu-generator.

Starting pmrp via menu entry (or via gmrun) works fine (as pmrp is in ~/bin), however in these cases the "load stations" feature does not work (although "stations" is also in ~/bin). I tried to start it via "x-terminal-emulator -x pmrp" and it does start, but "load stations" still does not work.

Edit: Or to describe it an other way: When I start pmrp from terminal simply via pmrp being in ~/bin -> everything is fine, "load stations" works. If I'm in a different directory, e.g. in ~, it does start, but does not find "stations" ->

environment: line 3: stations: No such file or directory

Last edited by martix (2017-08-05 16:08:54)

Offline

#45 2017-08-05 16:08:18

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: The great yad hacking thread

I just copied the pmrp file contents from https://github.com/hakerdefo/pmrp/blob/master/pmrp

The stations are included in the script.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#46 2017-08-05 16:17:28

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: The great yad hacking thread

@damo Thank you. It turns out in the end that starting pmrp by putting it in ~/bin and using the "pmrp" command requires "stations" being in the user's home folder, i.e. in ~ (instead of ~/bin).

Now it's truly brilliant: I have a nice menu entry, nice icon and I can even load the stations now!  cool

It's sooo cool, I think it'd even deserve it's own thread in Tips&Tricks as it's a bit hidden here.

Offline

#47 2017-08-05 16:44:19

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: The great yad hacking thread

martix wrote:

...
It's sooo cool, I think it'd even deserve it's own thread in Tips&Tricks as it's a bit hidden here.

Go right ahead wink


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#48 2017-08-05 16:46:34

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,945

Re: The great yad hacking thread

Hmmmmm I have it in ~/bin
start like this:

terminator --geometry=500x400+90+90 -b -x pmrp

And it works fine.
2017-08-05_134449_Scrot11.th.jpg


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster

Online

#49 2017-08-05 17:25:14

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: The great yad hacking thread

@S11 There is also a GUI version with a separate "stations" file. If someone uses it via executable in ~/bin (e.g. via gmrun or menu entry), the "stations" file should be in the home folder (or via terminal in the folder where it is started from).

damo wrote:
martix wrote:

...
It's sooo cool, I think it'd even deserve it's own thread in Tips&Tricks as it's a bit hidden here.

Go right ahead wink

Oh, I'm not sure whether maybe Misko_2083 is intending to make a thread like that?

Meanwhile I found here an other brilliant tool: damo's youtube-dl. Really great, will test it now.    cool

Offline

#50 2017-08-05 19:57:59

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,945

Re: The great yad hacking thread

@ martix

OH, OK, I missed that part.  smile  But the terminal part is good enough for me.  big_smile


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster

Online

#51 2017-08-06 07:29:30

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: The great yad hacking thread

martix wrote:

Meanwhile I found here an other brilliant tool: damo's youtube-dl. Really great, will test it now.    cool


Well, some feedback:
- Starting, closing, setting directory, etc. do work fine
- Downloading only audio works (creates an mpeg4-audio file)
- Downloading a video works as far as it creates an mpeg4-video file but there is no sound
- It creates a file named after the v= part of the url instead of the youtube-name of the video

Btw if I use the command line tool youtube-dl without any special settings, it works nicely and creates an .mkv file named after the youtube name of the video.

Offline

#52 2017-08-06 10:44:19

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: The great yad hacking thread

Looks like some glitches have developed, and there are gtk3 warnings (due to gvfs?). I'll have a look if I find the time sad


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#53 2017-08-23 15:41:45

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: The great yad hacking thread

@misko_2083 I tried to add a radio channel:

## Urban
Urban: "Techno" "Techno" "listen.hardradio.de/stream" 

but somehow this stream does not work on PMRP. Do you have maybe an idea why not?

Btw yt-get is brilliant! Very useful if there is an interesting video (or music) on yt... Oh, and one more thing regarding PMRP: Some kind of simple indicator if it is about to finish a connection to a channel might be a good feature. It takes sometimes several seconds and often I'm not sure if it just takes that long or I did not clicked the channel properly (or it's not available at all...).


Edit: Meanwhile I figured out: http://listen.hardradio.de/stream  works and it has to be with "http://" in the stations file.

Last edited by martix (2017-09-25 11:44:19)

Offline

#54 2017-12-28 00:07:14

yadbash
Member
From: Nevada, USA
Registered: 2017-12-27
Posts: 7
Website

Re: The great yad hacking thread

Is there a way to change background color of a yad dialog or make it transparent without changing global gtk window styles ?

I would like for just the button image to show and not the background behind it to create a 10 button horizontal panel and use it as a panel launcher.

If this is possible (change dialog background color or make transparent), I'll create a yad form entry program to set the button parameters. image or color, application to launch or website or place to open.

Offline

#55 2017-12-28 17:40:53

yadbash
Member
From: Nevada, USA
Registered: 2017-12-27
Posts: 7
Website

Re: The great yad hacking thread

Hi Misko, I have read your many posts in this thread and programs you developed with yad over the last year. Thank you for helping me. It gives me a starting point in the right direction. I'll post back after some testing using your suggestions. Thanks again & Happy New Year. Bobby

Offline

#56 2018-04-24 15:52:34

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 1,605

Re: The great yad hacking thread

misko_2083 wrote:

I never thought about about this until Stemsee asked this question.

How to save the screen position and dimensions when the yad dialog is moved and/or resized,  then closed so that it reopens in the same place and with the same dimensions?

Something missing with yad is an option to save the position and dialog dimensions when the dialog is closed.
This is one way to go around this. The script saves the position and width and height of a yad dialog and open it in the same position.

The other way to do this is to utilize the "--class" and "--name" options in your yad scripts and let the window manager's per app settings handle the placement.

In fluxbox I have this key binding:

OnToolbar Mouse2 :Exec yad --name=FluxCal --class=FluxCal --title=Calendar --calendar --text ""

in the apps file (fluxbox per app settings)

[app] (name=FluxCal) (class=FluxCal)
  [Dimensions]	{21% 43%}
  [Position]	(UPPERLEFT)	{74% 46%}
  [Shaded]	{no}
  [Deco]	{0x66f}
  [Sticky]	{no}
  [Minimized]	{no}
  [Maximized]	{no}
  [Fullscreen]	{no}
  [Layer]	{8}
  [Alpha]	{255}
[end]

so mouse buttin 2 on the toolbar always places the calendar in the same spot and same dimensions.

Can set that up in the openbox rc.xml file as well, or any window manager that uses the name and class for per app settings.


You must unlearn what you have learned.
    -- yoda

Offline

#57 2018-04-24 20:15:44

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 1,605

Re: The great yad hacking thread

^ That's exactly what fluxbox does. For that example the calendar opens in the same location with the same geometry.

Can Fluxbox save a window's position and size on exit?
And can a new window be in the the exact saved position with the same size, like when using the script above?

Fluxbox has a save on close option that can be set for per app settings. So if a user opens a window with pre-defined settings, then moves and resizes it, the new position and size will be saved to the per app settings in the ~/.fluxbox/apps file. New windows will open at the new position with the new geometry. I'm not sure if any other window manager has this feature natively..

Last edited by PackRat (2018-04-24 21:19:27)


You must unlearn what you have learned.
    -- yoda

Offline

#58 2018-05-16 23:40:07

yadbash
Member
From: Nevada, USA
Registered: 2017-12-27
Posts: 7
Website

Re: The great yad hacking thread

Hi Misko and others ! I'm going to spend the next 30 days working on Yad once again and have a button layout question.

Is there a way to have a Grid of Form Buttons that fills a whole yad window ? The whole screen size ?

I can do this with multiple yad windows and position them one below the other but, even when I set all yad windows to with "behind display properties", programs will get between the multiple windows.

This is what I am trying to accomplish using only One Yad Window:

https://www.youtube.com/watch?v=a-Iy7YeeW8A

Thanks for helping, Bobby

Offline

#59 2018-05-18 18:07:48

yadbash
Member
From: Nevada, USA
Registered: 2017-12-27
Posts: 7
Website

Re: The great yad hacking thread

Hi Misko, Thank you for your feedback and humor then that xcfe 46 panel link gave me a head ache. That is a lot of panels !!!

The example in my video is 100% bash & yad and it is usable on both Debian - Q4OS Linux and Bunsenlabs without any changes to the bash (yad) programming.

--------------------------------------

I would like to place 40 Yad Form Buttons in 1 Yad Window and have them wrap automatically to create multiple rows, top to bottom in a single Yad Window.

Is above possible ??
------------------------------
If above is not possilbe with auto wrap Not possible, I will create multiply panels.
Can I display these panels one at a time using Yad Icon using Yad Geometry ?

Thank You and very much appreciate your wit, humor and awesome help !!

Bobby

Offline

#60 2018-12-21 05:40:00

miyo
Member
Registered: 2018-12-21
Posts: 12

Re: The great yad hacking thread

Hi guys. Thank you so much for all of your tutorials here. smile

Before going any further, I feel it's only appropriate that I let you know that...I'm the (cough...cough) "developer" of MiyoLinux. You may (or may not) be familiar with it (?). LOL! big_smile tongue

I use yad for some of the "Accessories" that I include in Miyo. However, to be honest, I'm no code expert. I usually just scratch, claw, and hack until I get things working. tongue

I'm wondering if anyone here would be willing to help me with something that I would like to accomplish? I have searched and searched but have come up empty.

I'm not here to advertise MiyoLinux; I'm genuinely here to ask for help. So, before I actually go any further...and out of respect for bl and all that you do, I will wait to make sure that my request is okay. If a moderator feels this is inappropriate and wants to remove this post, I understand and thank you anyway. smile

Respectfully,
miyo

Offline

Board footer

Powered by FluxBB