View previous topic :: View next topic |
Author |
Message |
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Fri Jul 12, 2013 9:53 pm Post subject: Problem with twm |
|
|
I can't add any menus to the main menu. If I do, twm complains about syntax errors, and the main menu stops working. I checked my .twmrc file MANY times. All I did was add two new menus to it.
Code: | NoGrabServer
RestartPreviousState
DecorateTransients
TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*"
#ClientBorderWidth
Color
{
BorderColor "slategrey"
DefaultBackground "rgb:2/a/9"
DefaultForeground "gray85"
TitleBackground "rgb:2/a/9"
TitleForeground "gray85"
MenuBackground "rgb:2/a/9"
MenuForeground "gray85"
MenuBorderColor "slategrey"
MenuTitleBackground "gray70"
MenuTitleForeground "rgb:2/a/9"
IconBackground "rgb:2/a/9"
IconForeground "gray85"
IconBorderColor "gray85"
IconManagerBackground "rgb:2/a/9"
IconManagerForeground "gray85"
}
#
# Define some useful functions for motion-based actions.
#
MoveDelta 3
Function "move-or-lower" { f.move f.deltastop f.lower }
Function "move-or-raise" { f.move f.deltastop f.raise }
Function "move-or-iconify" { f.move f.deltastop f.iconify }
#
# Set some useful bindings. Sort of uwm-ish, sort of simple-button-ish
#
Button1 = : root : f.menu "defops"
Button1 = m : window|icon : f.function "move-or-lower"
Button2 = m : window|icon : f.iconify
Button3 = m : window|icon : f.function "move-or-raise"
Button1 = : title : f.function "move-or-raise"
Button2 = : title : f.raiselower
Button1 = : icon : f.function "move-or-iconify"
Button2 = : icon : f.iconify
Button1 = : iconmgr : f.iconify
Button2 = : iconmgr : f.iconify
#
# And a menus with the usual things
#
menu "defops"
{
"Twm" f.title
"Iconify" f.iconify
"Resize" f.resize
"Move" f.move
"Raise" f.raise
"Lower" f.lower
"" f.nop
"Focus" f.focus
"Unfocus" f.unfocus
"Show Iconmgr" f.showiconmgr
"Hide Iconmgr" f.hideiconmgr
"" f.nop
"Xterm" f.exec "exec xterm -fg white -bg black&"
"" f.nop
menu "network"
{
"Network" f.title
"Aurora" f.exec "firefox &"
"EarlyBird" f.exec "thunderbird &"
"KTorrent" f.exec "ktorrent &"
}
menu "system"
{
"System" f.title
"PCManFM" f.exec "pcmanfm &"
"XScreenSaver" f.exec "xscreensaver-demo &"
}
"" f.nop
"Kill" f.destroy
"Delete" f.delete
"" f.nop
"Restart" f.restart
"Exit" f.quit
} |
|
|
Back to top |
|
|
lost+found Guru
Joined: 15 Nov 2004 Posts: 509 Location: North~Sea~Coa~s~~t~~~
|
Posted: Sat Jul 13, 2013 6:09 am Post subject: |
|
|
I think submenus can't be nested. It needs a "f.menu" poining to the menu.
Like mine (without the ++++ and @@ from diff)...
Code: | $ whatis diff
diff (1) - compare files line by line
...
$ diff -u /usr/share/X11/twm/system.twmrc $HOME/.twmrc
...
#
# And a menus with the usual things
#
@@ -80,6 +92,7 @@
"Show Iconmgr" f.showiconmgr
"Hide Iconmgr" f.hideiconmgr
"" f.nop
+"More..." f.menu "more"
"Xterm" f.exec "exec xterm &"
"" f.nop
"Kill" f.destroy
@@ -88,3 +101,17 @@
"Restart" f.restart
"Exit" f.quit
}
+
+menu "more"
+{
+"More" f.title
+"AlsaMixer" f.exec "exec xterm -e alsamixer &"
+"Nano" f.exec "exec xterm -e nano &"
+"Opera" f.exec "exec opera -geometry 1021x746-1-1 -nolirc &"
+"Xine" f.exec "exec xine -HLZ --loop=shuffle &"
+"" f.nop
+"Top" f.exec "exec xterm -e top &"
+"" f.nop
+"Manual" f.exec "exec xterm -e man twm &"
+"Settings" f.exec "exec xterm -e nano -w ~/.twmrc &"
+} |
-- Cheers |
|
Back to top |
|
|
lost+found Guru
Joined: 15 Nov 2004 Posts: 509 Location: North~Sea~Coa~s~~t~~~
|
Posted: Sat Jul 13, 2013 7:36 am Post subject: |
|
|
Another thing I use are Multimedia keys on the keyboard and remote control (Internet, E-mail, Search), which can be added easily.
.twmrc
Code: | ...
"XF86HomePage" = : all : f.exec "exec opera -geometry 1021x746+255+191 -nolirc &"
"XF86Mail" = : all : f.exec "exec opera -geometry 1021x746+255+191 -nolirc -nosession -mail &"
"XF86Search" = : all : f.exec "killall xine; ln -sf .lircrc-opera .lircrc && exec opera -geometry 1021x746+255+191 -nosession -nomail &"
"XF86MenuKB" = : all : f.exec "ln -sf .lircrc-xine .lircrc && exec xine -H &"
... |
Keyboard volume can be done adding ACPI events/scripts.
I keep Twm around as an "emergency" desktop. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Mon Jul 15, 2013 2:22 am Post subject: |
|
|
But I saw lots of people nesting menus in their .twmrc files. Plus I've done it before, I did it on Fedora 16 when I used to have it. Did TWM change? I'll try the f.menu thing though. Thanks! |
|
Back to top |
|
|
|