You are not logged in.

#1 2011-12-11 13:51:16

greatant
Member
Registered: 2011-02-12
Posts: 28

fvwm pipemenus - udisks,netcfg,bluetooth,randr,mpd

I've been working on these fvwm pipemenus for ages. But I'm hitting the limits of my scripting knowledge and I'm not so sure how to finish some of the ideas off. I'm only new to linux and bash so there's plenty of mistakes and bad practices I'm sure. My fvwm syntax is probably imperfect too.

Maybe someone else can get some use out of these or contribute ideas.
https://github.com/greatant/fvwm-pipemenus

ZkXyj.png

fvwm-menu-udisks is a port of obdevicemenu, an openbox pipemenu by jnguyen. It mounts and unmounts your removable media. It's not up to date with his latest version quite yet, and the current version has a minor issue that I'm pretty sure is my mistake. (Requires obdevicemenu.conf in $HOME)

fvwm-menu-netcfg is a quick and easy way to connect and disconnect your netcfg profiles. It can also scan for wireless networks, ask for wireless password then create and connect an appropriate netcfg profile. The scanning and profile creating (fvwm-menu-netcfg-scan) is a port of an openbox menu, wifi-pipe from brisbin33. (Requires NOPASSWD sudoers entries for netcfg and fvwm-menu-netcfg-scan)

fvwm-menu-mpd is a frontend to MPD using MPC. It's fairly feature-rich, but is incomplete. The playlist isn't very functional, volume display doesn't work properly and the output selection, while functional, doesn't look pretty.

fvwm-menu-clipboard is a basic clipboard manager or viewer or something. Never used something like this myself, but always wanted one.
Requires clipbored-git.

fvwm-menu-bluetooth uses bluez-tools to control a bluetooth adapter and connections. Needs work.

fvwm-menu-randr is a really cool xrandr frontend. I'm struggling to finish it. I can't get the correct resolutions per monitor displayed, nor can I get the final position submenu to display the appropriate menu items.

fvwm-menu-virtualbox isn't really functional and is probably asking too much of a bash-driven pipemenu and is thus not pictured.

Usage:
Place scripts in $[fvwm_script] directory.
Place the following in your fvwm config file.

DestroyMenu FvwmMenuMPD
AddToMenu FvwmMenuMPD
+ DynamicPopupAction Piperead '$[fvwm_script]/fvwm-menu-mpd'

DestroyMenu FvwmMenuVBox
AddToMenu FvwmMenuVBox
+ DynamicPopupAction Piperead '$[fvwm_script]/fvwm-menu-virtualbox'

DestroyMenu FvwmMenuNetcfg
AddToMenu FvwmMenuNetcfg
+ DynamicPopupAction Piperead '$[fvwm_script]/fvwm-menu-netcfg'

DestroyMenu FvwmMenuNetcfgScan
AddToMenu FvwmMenuNetcfgScan
+ DynamicPopupAction Piperead 'sudo $[fvwm_script]/fvwm-menu-netcfg-scan wlan0'

DestroyMenu FvwmMenuBluetooth
AddToMenu FvwmMenuBluetooth
+ DynamicPopupAction Piperead '$[fvwm_script]/fvwm-menu-bluetooth'

DestroyMenu FvwmMenuRandR
AddToMenu FvwmMenuRandR
+ DynamicPopupAction Piperead '$[fvwm_script]/fvwm-menu-randr'

DestroyMenu FvwmMenuUdisks
AddToMenu FvwmMenuUdisks
+ DynamicPopupAction Piperead '$[fvwm_script]/fvwm-menu-udisks'

DestroyFunc FuncFvwmMenuUdisks
AddToFunc FuncFvwmMenuUdisks
+ I DestroyMenu recreate $0
+ I Piperead '$[fvwm_script]/fvwm-menu-udisks --mount-menu $0'

DestroyMenu FvwmMenuClip
AddToMenu FvwmMenuClip
+ DynamicPopupAction Piperead '$[fvwm_script]/fvwm-menu-clipboard 10'
My entries in sudoers for netcfg and fvwm-menu-netcfg-scan are as follows:
%users ALL=(ALL) NOPASSWD: /usr/bin/netcfg
%users ALL=(ALL) NOPASSWD: /home/username/.fvwm/scripts/fvwm-menu-netcfg-scan

Last edited by greatant (2011-12-11 13:57:20)

Offline

#2 2011-12-14 14:20:07

ThomasAdam
Member
From: Southampton, England
Registered: 2005-10-26
Posts: 149

Re: fvwm pipemenus - udisks,netcfg,bluetooth,randr,mpd

Looks OK, although you'd be much better off using FvwmPerl to do this all in.

-- Thomas Adam

Offline

#3 2011-12-14 14:27:22

ThomasAdam
Member
From: Southampton, England
Registered: 2005-10-26
Posts: 149

Re: fvwm pipemenus - udisks,netcfg,bluetooth,randr,mpd

greatant wrote:

fvwm-menu-clipboard is a basic clipboard manager or viewer or something. Never used something like this myself, but always wanted one.
Requires clipbored-git.

Or install parcellite.

greatant wrote:

fvwm-menu-randr is a really cool xrandr frontend. I'm struggling to finish it. I can't get the correct resolutions per monitor displayed, nor can I get the final position submenu to display the appropriate menu items.

Because you have to start FVWM once you've dicked with XRandR.

greatant wrote:
Usage:
Place scripts in $[fvwm_script] directory.

Gah, no.  Just use ~/.fvwm/ and then let PipeRead read it all in, since $. will default to ~/.fvwm.

-- Thomas Adam

Offline

#4 2011-12-15 12:56:05

greatant
Member
Registered: 2011-02-12
Posts: 28

Re: fvwm pipemenus - udisks,netcfg,bluetooth,randr,mpd

ThomasAdam wrote:

Because you have to start FVWM once you've dicked with XRandR.

Nah, I haven't even got to that problem yet. It's my convoluted scripting. Not sure how else to do it and can't make it work how I think it should.

ThomasAdam wrote:

Gah, no.  Just use ~/.fvwm/ and then let PipeRead read it all in, since $. will default to ~/.fvwm.

I'm interested in the reasoning for this. Surely not variable pollution? What's wrong with some file organisation? Especially a variable as common as fvwm_script.

Last edited by greatant (2011-12-15 13:01:14)

Offline

#5 2011-12-15 14:26:39

ThomasAdam
Member
From: Southampton, England
Registered: 2005-10-26
Posts: 149

Re: fvwm pipemenus - udisks,netcfg,bluetooth,randr,mpd

greatant wrote:

I'm interested in the reasoning for this. Surely not variable pollution?

No -- I did not say that, and this is not the reason you should infer either.

If you assume $. then you can simply bundle your scripts in some directory, such as "scripts/" and install under ~/.fvwm/ from the paths in the tarball.

greatant wrote:

What's wrong with some file organisation? Especially a variable as common as fvwm_script.

Nothing, other than making the assumption, and in some cases forcing, people to create such an option, when it already exists -- for free -- under the assumed $. variable.

-- Thomas Adam

Offline

Board footer

Powered by FluxBB