You are not logged in.

#1 2017-08-22 20:32:12

Choven
Member
Registered: 2015-10-20
Posts: 18

[SOLVED] Adding makemkv to openbox menu

Greetings, I'm having some trouble figuring out how to add certain items to the openbox menu.  If there's a .deb that I install via apt-get, then adding the command to the pipemenus.rc file works as expected.  But for programs not available in the repositories, it doesn't seem to work.  For example, I compiled makemkv from source their website and now want to add makemkv to the Multimedia menu under utilities.  If I edit this line in the pipemenus.rc file:

MM_UTILS=('makemkv')

Then 'Install Makemkv' appears in the install portion of the menu instead of 'Makemkv' appearing under the utilities section of the menu.  It appears like the bl-multimedia-pipemenu is not detecting that makemkv is installed.  Is there a way to correct this problem and get the entry added while preserving the multimedia pipemenu?  In a related question, I have two other programs that are not available in the repos.  I can use their .deb or create my own from source files (I've never done this but I'll try).  If I install using the .deb, then would adding the menu items be as easy as editing the pipemenus.rc file like I tried for makemkv?

Thanks...

[EDIT]
I think I solved this one.  bl-multimedia-pipemenu checks in two places to determine if package is installed.  One place is in /var/lib/dpkg/info.  I created a file like this:

sudo nano /var/lib/dpkg/info/makemkv.list

You have to write something in the file to make it work.  I typed in:

# This file is needed to add makemkv to the openbox menu

Save file and it now appears as long as 'makemkv' is listed in the pipemenus.rc file.  If anyone has a better way to make this work then I'm open to suggestions.

Last edited by Choven (2017-08-23 04:19:56)

Offline

#2 2017-08-22 20:58:06

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

Re: [SOLVED] Adding makemkv to openbox menu

^ Clever solution

I just usually manually add a "menuItem" to the bl-*-pipemenu, or add an entry in menu.xml if I don't mind it appearing as a separate item. 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

#3 2017-08-23 02:51:19

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,560
Website

Re: [SOLVED] Adding makemkv to openbox menu

Choven wrote:

In a related question, I have two other programs that are not available in the repos.  I can use their .deb or create my own from source files (I've never done this but I'll try).  If I install using the .deb, then would adding the menu items be as easy as editing the pipemenus.rc file like I tried for makemkv?

It should work, because if you install from a .deb file then dpkg should create the /var/lib/dpkg/info/packagename.list file.

But thanks for raising this, because it has prompted me to think of a better way of detecting whether a package is installed or not: look for its command in $PATH. This is what the pipemenus used to do in fact, but was changed to try to cover cases where the command was different from the package name. Now we have the user-editable array user_package_commands in pipemenus.rc, those cases can be covered, so with luck a future version of the pipemenu will allow everything to be done from pipemenus.rc, even for user-compiled programs.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#4 2017-08-23 03:53:26

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,057

Re: [SOLVED] Adding makemkv to openbox menu

I ran into this as well and can confirm it, although I was not ever able to get a fix for this. I installed makemkv from source, so the multimedia pipe menu is definitely not picking up on packages installed outside of dpkg. I ended up creating a menu entry for programs I have created from source, so I can add them. Glad to see that there is a workaround though.

Offline

#5 2017-08-23 04:19:31

Choven
Member
Registered: 2015-10-20
Posts: 18

Re: [SOLVED] Adding makemkv to openbox menu

I spent most of the afternoon trying to figure out why the names in pipemenus.rc kept going to the Install menu instead of appearing normally.  I have a few programs to add to my menu, and so far, it has worked.  I also added a menu entry for mlbviewer, which is a python script for watching mlb.tv.  After creating the mlbviewer.list file, my custom command in pipemenus.rc work as expected:

user_package_commands=([mlbviewer]='terminator -x python2 {path_to_mlbviewer}/mlbviewer.py')

I include this info for others who might have custom programs or scripts that they want to add to a menu item that's controlled by a pipemenu. 

johnraff wrote:

But thanks for raising this, because it has prompted me to think of a better way of detecting whether a package is installed or not: look for its command in $PATH. This is what the pipemenus used to do in fact, but was changed to try to cover cases where the command was different from the package name. Now we have the user-editable array user_package_commands in pipemenus.rc, those cases can be covered, so with luck a future version of the pipemenu will allow everything to be done from pipemenus.rc, even for user-compiled programs.

This didn't work for Scangearmp (used for my Canon multifunction printer) when I installed it on a laptop.  The install.sh script installed scangearmp-common and scangearmp-mx920series from .deb files.  Both sccangearmp-common.list and scangearmp-mx920series.list appear in /var/lib/dpkg/info; scangearmp.list does not appear despite the fact that the program is run using /usr/bin/scangearmp.  Once I added scangearmp.list to the /var/lib/dpkg/info folder, my scangearmp entry appears. 

My install of rstudio from a .deb file did work when adding rstudio to the pipemenus.rc file.  I actually have an entry under the Office section for rstudio, but I can make it appear in Multimedia, Graphics, and Browsers if I want.  Thus, dpkg -i on .deb files probably adds the necessarily .list file, but there could be exceptions (like scangearmp).

I'll mark this as solved.

Offline

#6 2017-08-23 04:24:52

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: [SOLVED] Adding makemkv to openbox menu

^ erm, sorry, is this something endemic to the debian menu?
the process seems overly complicated; for any (!) xdg type menu it should be enough to create a .desktop file for the app in question, usually in ~/.local/share/applications.

Offline

#7 2017-08-23 04:44:45

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

Re: [SOLVED] Adding makemkv to openbox menu

^ It is referring to the BL pipemenus Install options, using pipemenus.rc. This was envisaged as a way of offering app recommendations, without including them in the iso, not as a generic method of installing and adding entries to the main menu.

The OP is making things unecessarily complicated IMO, but has highlighted an issue which we can improve on.


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

#8 2017-08-23 06:21:44

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,560
Website

Re: [SOLVED] Adding makemkv to openbox menu

johnraff wrote:

...cases where the command was different from the package name...

Choven wrote:

The install.sh script installed scangearmp-common and scangearmp-mx920series from .deb files.  Both sccangearmp-common.list and scangearmp-mx920series.list appear in /var/lib/dpkg/info; scangearmp.list does not appear despite the fact that the program is run using /usr/bin/scangearmp.

That's exactly what I was talking about. The command is scangearmp but the package name is different.

A new pipemenu (in a little while) might make it possible to deal with these cases just using pipemenus.rc. As damo says, something we hope to improve on a bit, although pipemenus.rc was not originally envisaged as a substitute for obmenu, or just editing menu.xml directly.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#9 2017-08-23 13:52:47

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,057

Re: [SOLVED] Adding makemkv to openbox menu

Makemkv is not in the repositories for Stretch. This is where I ran into the issue as it is kind of a must-have for me to archive my blu-ray dvd's. The install pipe-menu item  is obviously broken since it is not in the debian repositories.
The output of apt-cache policy shows this:

tknomanzr@wtfbox:~$ apt-cache policy makemkv
N: Unable to locate package makemkv
tknomanzr@wtfbox:~$ 

I suppose I need to learn how to package these things into a proper .deb so dpkg is aware of them.

Offline

#10 2017-08-23 14:11:28

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,560
Website

Re: [SOLVED] Adding makemkv to openbox menu

tknomanzr wrote:

The install pipe-menu item  is obviously broken since it is not in the debian repositories.

Makemkv is not in the default pipemenu. This is about adding a custom entry for a locally-compiled program.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#11 2017-08-23 14:16:50

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,057

Re: [SOLVED] Adding makemkv to openbox menu

Ok, so adding it into pipemenus.rc created an install section for it? And yes, I did end up building it from source, which dpkg obviously knows nothing about. I was just curious that if I built it into a .deb and installed it, would that then allow your multimedia-pipemenu system to see it properly.

Offline

#12 2017-08-23 18:27:37

Choven
Member
Registered: 2015-10-20
Posts: 18

Re: [SOLVED] Adding makemkv to openbox menu

tknomanzr wrote:

I was just curious that if I built it into a .deb and installed it, would that then allow your multimedia-pipemenu system to see it properly.

Yes, it should work at this point.  From my very limited/beginner knowledge of scripting, bl-multimedia-pipemenu seems to run two checks to determine if a program is install.  The first place is to look for a /var/lib/dpkg/info/{package}.list file.  I think the second check is to look for the the same file in /etc (clarification on the grep -Evq line would be appreciated).  If either condition is satisfied, then the script "thinks" the package is installed.  If not, then the script adds an "Install {package}" option to the install menu.  For the case of scangearmp, the .deb packages were correctly installed but the executable has a different name than the .deb packages.  Thus, the pipemenu script didn't think scangearmp was installed.

Could the fix be as easy as adding one more line in the bl-multimedia-pipemenu script in allInstalled() to check /usr/bin for the program?  So, the script checks for {package}.list, then in /etc, and finally /usr/bin/{package}?  Are all 3 checks needed?  I don't know how to write this statement in scripting language, but I'm willing to add try it if someone can write the if statement.

Offline

#13 2017-08-23 18:46:41

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

Re: [SOLVED] Adding makemkv to openbox menu

^ There is still the problem of an executable having a different name (and there are lots of them 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

#14 2017-08-23 21:19:35

Choven
Member
Registered: 2015-10-20
Posts: 18

Re: [SOLVED] Adding makemkv to openbox menu

damo wrote:

^ There is still the problem of an executable having a different name (and there are lots of them sad )

I don't use many programs that are installed from source or that are not in the repositories, so I can't really say how many are out there.  However, in the pre-pipemenu version (I started with #! then moved to BL), I typically named my entry item using the executable.  I am trying to do the same in the current version of BL.  Since the executable is usually found in /usr/bin, an if statement that checks for that file in /usr/bin should be enough to make the pipemenu recognize that the program is installed and thus add the correct menu item. 

This wouldn't address changing the name that you want to appear in the menu.  So if I wanted scangearmp to appear as "Scanner", then checking /usr/bin still wouldn't work.  I guess making a separate menu folder the old way would then be the way to do it.

Offline

#15 2017-08-23 22:05:53

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

Re: [SOLVED] Adding makemkv to openbox menu

Choven wrote:
damo wrote:

^ There is still the problem of an executable having a different name (and there are lots of them sad )

....  Since the executable is usually found in /usr/bin, an if statement that checks for that file in /usr/bin should be enough to make the pipemenu recognize that the program is installed and thus add the correct menu item. 
....

But you still need to know the name of the executable. Off the top of my head, "redshift" needs "redshift-gtk" for the gui, for instance.


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

#16 2017-08-23 22:20:03

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,057

Re: [SOLVED] Adding makemkv to openbox menu

Figuring out the name of installed executables is always fun. I would definitely love to have some sort of feedback by apt-get on installed binaries or executable when I install a package. I remember finding out that there is actually a binary that validates gtk apps and never knew it was installed until one day when I was digging deep.

Offline

#17 2017-08-24 00:35:20

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,560
Website

Re: [SOLVED] Adding makemkv to openbox menu

johnraff wrote:

Now we have the user-editable array user_package_commands in pipemenus.rc, those cases can be covered

That array is so you can deal with cases where the command is different from the package name. It's in pipemenus.rc, commented out. Just set something there. It can also be used if you're using a wrapper script for a program, eg for firefox I've got:

user_package_commands=([firefox-esr]='/home/john/bin/firefox')

...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#18 2017-08-24 00:54:01

Choven
Member
Registered: 2015-10-20
Posts: 18

Re: [SOLVED] Adding makemkv to openbox menu

^^ I thought this would work for me when I initially tried to make an mlbviewer entry.  I just thought my addition failed to show in the menu because I didn't have the correct command line.  It wasn't until I tried adding makemkv when I noticed an "Install Mlbviewer" option appear along with the "Install makemkv" option.  Your addition works because you are trying to add 'firefox-esr" to the menu and firefox-esr.list exists.  If you try to place "firefox" in the menus and modify your line:

user_package_commands=([firefox]='/home/john/bin/firefox')

Then you'll get the "Install Firefox" option because firefox.list does not exist.  You can try to add firefox to the graphics or multimedia menu items to confirm the behavior of the pipemenu.

Maybe another option is to have the pipemenu script examine the user_package_commands array.  If the item that you are trying to add to the menu exists within the array, then mark the program as "installed".  If it's not in the array, then let the allInstalled() function in the pipemenu proceed as written and check for {package}.list.

Offline

#19 2017-08-24 06:15:21

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,068
Website

Re: [SOLVED] Adding makemkv to openbox menu

tknomanzr wrote:

I would definitely love to have some sort of feedback by apt-get on installed binaries or executable when I install a package.

https://wiki.debian.org/WhereIsIt#A.22I … e_me.3F.22

EDIT: I tend to use the Debian packages page to show the contents:

https://www.debian.org/distrib/packages#search_packages

In the results, click on the "list of files" link at the bottom-right  wink

Last edited by Head_on_a_Stick (2017-08-24 06:20:44)

Offline

#20 2017-08-27 06:35:28

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,560
Website

Re: [SOLVED] Adding makemkv to openbox menu

Head_on_a_Stick wrote:

I tend to use the Debian packages page to show the contents:
https://www.debian.org/distrib/packages#search_packages

This.
I have a 'pkg' alias in Firefox so I can (and do, every day) type 'pkg packagename' to go straight to the results page.
Just right-click on the search box and "Add a keyword for this search".

But:

tknomanzr wrote:

I would definitely love to have some sort of feedback by apt-get on installed binaries or executable when I install a package.

Once the package is installed of course 'dpkg -L packagename', or, since most executables are in a bin/ directory, perhaps

dpkg -L $package | grep -E '/s?bin/'

That would leave out some things in /lib of course...

Last edited by johnraff (2017-08-27 06:39:45)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

Board footer

Powered by FluxBB