This is my messy (not tidely aligned) current Debian .twmrc version. The colouring is nice once set up as its more of a visual prompt for launching things, but unfortunately does involve having to define colours for one window/program in multiple places
Code: Select all
NoGrabServer
RestartPreviousState
DecorateTransients
# This font supports font size 8, 10, 11, 12, 14, 17, 18, 19, 20, 24, 25, 26, 34 values
# and bold or medium weights (r regular and i italic slants)
# -b&h-lucida-medium-r-*-*-20-*-*-*-*-*-iso8859-14
TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
IconFont "-b&h-lucida-medium-r-*-*-34-*-*-*-*-*-iso8859-14"
IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*"
#ClientBorderWidth
###############################################
TitleFont "-b&h-lucida-bold-r-*-*-20-*-*-*-*-*-*-*"
ResizeFont "-b&h-lucida-medium-r-*-*-24-*-*-*-*-*-*-*"
MenuFont "-b&h-lucida-medium-r-*-*-24-*-*-*-*-*-*-*"
IconFont "-b&h-lucida-medium-r-*-*-24-*-*-*-*-*-*-*"
IconManagerFont "-b&h-lucida-medium-r-*-*-24-*-*-*-*-*-*-*"
ShowIconManager
IconManagerGeometry "500x900+470+64" 1
NoDefaults # Using own title button definitions
SqueezeTitle # shorter window titlebar (like tab)
# can justify tab ... left, center right particular windows
#{
# "xterm" right 0 0
#}
TitleButtonBorderWidth 0
TitlePadding 20
OpaqueMove
RandomPlacement
#########################
IconifyByUnmapping # No Icons shown
# I've set no icons, however some apps when you minimise the help, about or
# search boxes still appear as icons. Some can be large so I've set the known
# ones to show just a X logo icon. firefox, pcmanfm, mtpaint, galculator all
# move to iconmgr ok, geany, libre (soffice) don't (they iconify). Think gnumeric
# also moves to a icon but I haven't got that installed.
# Weird behaviour. If iconify a help window, and shows the above X logo icon and
# then iconmgr minimise that window and restore it, the icon is restored to the
# window size again, but can be behind (hidden) the main window and lost focus
# (seems like keyboard is locked from entering things into the main window because
# the hidden window has focus).
IconDirectory "/mnt/sda2/home/ff/.twm/bitmaps"
ForceIcons # force usage of our icons rather than apps
Icons
{
"pcmanfm" "xlogo64.xbm"
# "geany" "xlogo64.xbm"
"leafpad" "xlogo64.xbm"
"soffice" "xlogo64.xbm"
}
#########################
NoTitle
{
"stalonetray"
"TWM Icon Manager"
# "xmessage"
"xload"
"oclock"
"xclock"
"WorkSpaceManager"
"xeyes"
"gkrellm"
# "yad"
"Vol "
# "Conky"
}
NoBorder
{
"stalonetray"
# "gkrellm"
"TWM Icon Manager"
"mpv"
"xmessage"
"xload"
"WorkSpaceManager"
"oclock"
"xclock"
"xeyes"
"yad"
# "Conky"
}
NoHighlight # global
IconManagerDontShow
{
"stalonetray"
"xmessage"
"xload"
"oclock"
"xclock"
"xeyes"
"WorkSpaceManager"
"gkrellm"
"Programs"
"Vol "
# "Conky"
}
Color
{
DefaultBackground "#000000"
DefaultForeground "white"
# Title default Title colour ... then with selective programs having other colours
# Use xprop and/or xwininfo commands to identify WM names such as XTerm ...etc.
BorderColor "#000000"
{
"galculator" "#004900"
"galculator" "#004900"
"Firefox-esr" "#DD5D25"
"mtpaint" "orange"
"leafpad" "#00B6FF"
"pcmanfm" "#E3D0B5"
"osmo" "#7399B7"
"masterpdfeditor3" "#CF3638"
"libreoffice-writer" "blue"
"libreoffice-calc" "#006D00"
"xterm" "#494949"
"soffice" "#DCDAD5"
"LibreOffice" "#006D00"
"xclock" "#000024"
"Conky" "#000024"
"stalonetray" "#000024"
"gkrellm" "#0067F6"
"yad" "#5E0707"
"Audacity" "#F5D922"
"openshot" "#A0D6F1"
"recordMyDesktop" "#6D006D"
}
TitleBackground "#494949"
{
"galculator" "#004900"
"galculator" "#004900"
"Firefox-esr" "#DD5D25"
"mtpaint" "orange"
"leafpad" "#00B6FF"
"pcmanfm" "#E3D0B5"
"osmo" "#7399B7"
"masterpdfeditor3" "#CF3638"
"libreoffice-writer" "blue"
"libreoffice-calc" "#006D00"
"xterm" "black"
"mpv" "black"
"xclock" "SteelBlue4"
"yad" "#5E0707"
"Audacity" "#F5D922"
"openshot" "#A0D6F1"
"recordMyDesktop" "#6D006D"
}
TitleForeground "white"
{
"mtpaint" "black"
"leafpad" "black"
"pcmanfm" "black"
"openshot" "black"
"Audacity" "black"
}
MenuBackground "#020a09"
MenuForeground "#00ff00" # "#2EFCED"
MenuBorderColor "slategrey"
MenuTitleBackground "#3400FF" # "#005B5B"
MenuTitleForeground "white"
IconBackground "#020a09"
MenuShadowColor "black"
IconForeground "gray85"
{
"galculator" "#004900"
"galculator" "#004900"
"Firefox-esr" "#DD5D25"
"mtpaint" "orange"
"leafpad" "#00B6FF"
"pcmanfm" "#E3D0B5"
"osmo" "#7399B7"
"masterpdfeditor3" "#CF3638"
"libreoffice-writer" "blue"
"libreoffice-calc" "#006D00"
"xterm" "white"
"soffice" "#DCDAD5"
"LibreOffice" "#006D00"
"xclock" "SteelBlue4"
"yad" "#5E0707"
"Audacity" "#F5D922"
"openshot" "#A0D6F1"
"recordMyDesktop" "#6D006D"
}
IconBorderColor "#000000"
IconManagerBackground "#151515"
{
"galculator" "#004900"
"galculator" "#004900"
"Firefox-esr" "#DD5D25"
"mtpaint" "orange"
"leafpad" "#00B6FF"
"pcmanfm" "#E3D0B5"
"osmo" "#7399B7"
"masterpdfeditor3" "#CF3638"
"libreoffice-writer" "blue"
"libreoffice-calc" "#006D00"
"xterm" "black"
"soffice" "#DCDAD5"
"LibreOffice" "#006D00"
"xclock" "SteelBlue4"
"yad" "#5E0707"
"Audacity" "#F5D922"
"openshot" "#A0D6F1"
"recordMyDesktop" "#6D006D"
}
IconManagerForeground "white"
{
"mtpaint" "black"
"leafpad" "black"
"pcmanfm" "black"
"Audacity" "black"
"openshot" "black"
}
IconManagerHighlight "slategrey"
}
Cursors
{
Frame "top_left_arrow"
Title "top_left_arrow"
Icon "top_left_arrow"
IconMgr "top_left_arrow"
Move "fleur"
Resize "fleur"
Menu "sb_left_arrow"
Button "hand2"
Wait "watch"
Select "dot"
Destroy "pirate"
}
###############################################
#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 }
#Function "click" { f.warpto "stalonetray" f.warpto "TWM Icon Manager" }
Function "deiconify-raise" { f.deiconify f.raise }
Function "fullscreen" { f.fullzoom f.winrefresh }
Function "Reveal" { f.warpto "stalonetray" f.warpto "Vol " f.warptoiconmgr "" }
# Title buttons
#LeftTitleButton "minimize2.xbm" = f.menu "Ops"
LeftTitleButton "resize5.xbm" = f.resize
LeftTitleButton "minimize2.xbm" = f.iconify
LeftTitleButton "maximize2.xbm" = f.function "fullscreen"
LeftTitleButton "close2.xbm" = f.delete
#
# Set some useful bindings. Sort of uwm-ish, sort of simple-button-ish
#
Button1 = m : root : f.move
Button1 = : root : f.menu "defops"
#Button2 = : root : f.function "Reveal" # f.warpto "Vol " # f.menu "Volume"
Button3 = : root : f.function "Reveal" # f.showiconmgr #f.function "Reveal" # f.warpto "TWM Icon Manager" #f.showiconmgr # f.function "click"
Button1 = m : window : f.move
#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
Button2 = : title : f.warpto "Vol "
Button3 = : title : f.showiconmgr # f.function "Reveal" # f.warpto "TWM Icon Manager" #f.showiconmgr # function "click"
Button1 = : icon : f.function "move-or-iconify"
Button2 = : icon : f.iconify
Button1 = : iconmgr : f.function "deiconify-raise"
Button2 = : iconmgr : f.delete
Button3 = : iconmgr : f.iconify
###############################################
# Keys
"Tab" = m : all : f.circleup
"Print" = : all : f.exec "/mnt/sda2/home/ff/bin/snap3sec &"
"Menu" = : all : f.exec "/usr/bin/env LANG=en_GB.UTF-8 xterm &"
"Super_R" = : all : f.fullzoom
"Left" = m : all : f.warptoiconmgr ""
"Up" = m : all : f.upiconmgr
"Down" = m : all : f.downiconmgr
"Right" = m : all : f.function "select"
###############################################
#
# And a menus with the usual things
#
menu "defops"
{
"Twm" f.title
"Files" ( "black" : "#E3D0B5" ) !"pcmanfm &"
"Firefox-esr" ( "white" : "#DD5D25" ) !"firefox-esr &" #f.function "ff-fullscreen" # !"firefox-esr &"
"Text Edit" ( "black" : "#00B6FF" ) !"leafpad &"
"Terminal" ( "white" : "black" ) !"xterm &"
# "Spreadsheet" ( "white" : "#006D00" ) !"libreoffice --calc &"
# "Writer" ( "white" : "blue" ) !"libreoffice --writer &"
# "masterPDF" ( "white" : "#CF3638" ) !"/mnt/sda2/home/ff/bin/masterpdfeditor &"
"Calculator" ( "white": "#004900" ) !"galculator &"
"mtpaint" ( "black" : "orange" ) !"mtpaint &"
# "osmo" ( "white" : "#7399B7" ) !"osmo &"
# "Diary" !"/mnt/sda2/home/ff/bin/YAD/diary &"
"Alarm" !"/mnt/sda2/home/ff/bin/YAD/alarm &"
# "galculator" ( "white": "#004900" ) !"galculator &"
# "LBC" !"/mnt/sda2/home/ff/bin/lbc &"
"Weather" !"/mnt/sda2/home/ff/bin/weather &"
# "kcheckers" !"kcheckers &"
#"" f.nop
"Exit" ( "white" : "red" ) f.quit
# "Kill" f.destroy
# "Resize" f.resize
# "Move" f.move
# "Delete" f.delete
"Utilities" f.menu "utils"
# "" f.nop
# "Refresh" f.refresh
# "" f.nop
# "record desktop" ("white" : "#6D006D" ) !"gtk-recordmydesktop &"
# "audacity" ( "black" : "#F5D922" ) !"audacity &"
# "openshot" ( "black" : "#A0D6F1" ) !"openshot &"
# "Volume" ( "#00FFFF" : "black" ) f.menu "Volume"
}
menu "utils"
{
"Utils" f.title
"Twm Windows" f.menu "TwmWindows"
"Yad Volume" !"/mnt/sda2/home/ff/bin/YAD/volume &"
"(Re)Start" f.startwm "twm" # f.menu "Restart"
"Utilities" f.menu "Utilities"
"Window Ops " f.menu "Window Ops"
"Preferences" f.menu "Preferences"
}
menu "Utilities"
{
"Utilities" f.title
"Top" !"xterm -T Top -n Top -e top &"
"htop" !"xterm -T htop -n htop -e htop &"
"Xcalc" !"xcalc &"
"Xman" !"xman &"
"Xmag" !"xmag &"
"Editres" !"editres &"
"" f.nop
#"XEmacs" !"xemacs &"
#"Mail" !"xmh -font fixed &"
#"" f.nop
"XLock" !"xlock -mode random &"
"Reset X defaults" !"xrdb -load $HOME/.Xdefaults"
}
#menu "Ops"
#{
# "Iconify" f.iconify
# "Resize" f.resize
# "Move" f.move
# "Raise" f.raise
# "Lower" f.lower
# "Delete" f.delete
# "Focus" f.focus
# "Unfocus" f.unfocus
#}
menu "Window Ops"
{
"Win Ops" f.title
"Iconify" f.iconify
"Resize" f.resize
"Move" f.move
"Raise" f.raise
"Lower" f.lower
"Delete" f.delete
"Focus" f.focus
"Unfocus" f.unfocus
"Show Iconmgr" f.showiconmgr
"Hide Iconmgr" f.hideiconmgr
"Identify" f.identify
}
menu "Volume"
{
"Volume" f.title
" 0%" ( "#00B6FF" : "black" ) !"amixer set Master 0%"
" 5%" ( "#00B6FF" : "black" ) !"amixer set Master 5%"
" 10%" ( "#00B6FF" : "black" ) !"amixer set Master 10%"
" 15%" ( "#00B6FF" : "black" ) !"amixer set Master 15%"
" 20%" ( "#00B6FF" : "black" ) !"amixer set Master 20%"
" 25%" ( "#00B6FF" : "black" ) !"amixer set Master 25%"
" 30%" ( "#00B6FF" : "black" ) !"amixer set Master 30%"
" 35%" ( "green" : "black" ) !"amixer set Master 35%"
" 40%" ( "green" : "black" ) !"amixer set Master 40%"
" 45%" ( "green" : "black" ) !"amixer set Master 45%"
" 50%" ( "green" : "black" ) !"amixer set Master 50%"
" 55%" ( "green" : "black" ) !"amixer set Master 55%"
" 60%" ( "green" : "black" ) !"amixer set Master 60%"
" 65%" ( "green" : "black" ) !"amixer set Master 65%"
" 70%" ( "red" : "black" ) !"amixer set Master 70%"
" 75%" ( "red" : "black" ) !"amixer set Master 75%"
" 80%" ( "red" : "black" ) !"amixer set Master 80%"
" 85%" ( "red" : "black" ) !"amixer set Master 85%"
" 90%" ( "red" : "black" ) !"amixer set Master 90%"
" 95%" ( "red" : "black" ) !"amixer set Master 95%"
" 100%" ( "red" : "black" ) !"amixer set Master 100%"
}
menu "Preferences"
{
"Preferences" f.title
"Bell Loud" !"xset b 80&"
"Bell Normal" !"xset b on&"
"Bell Off" !"xset b off&"
"Click Loud" !"xset c 80&"
"Click Soft" !"xset c on&"
"Click Off" !"xset c off&"
"Lock On" !"xset led on&"
"Lock Off" !"xset led off&"
"Mouse Fast" !"xset m 4 2&"
"Mouse Normal" !"xset m 2 5&"
"Mouse Slow" !"xset m 1 1&"
"Monitor Power Saving OFF" !"xset s off;xset -dpms&"
"Monitor Power Saving ON" !"xset s on;xset +dpms&"
}
Code: Select all
GEO="--geometry 44x160+0-0"
# retrieve current volume level
VALUE=`amixer get Master |grep % |awk '{print $5}'|sed 's/[^0-9]//g'`
yad --scale --vertical --title="Vol " $GEO --value=$VALUE --no-buttons --print-partial | while read x ; do x=`echo $x*1 | bc`; x=`printf "%.0f\n" "$x"`;amixer set Master ${x}% ; done
Code: Select all
yad --notification \
--no-middle \
--text="" \
--image=applications-office \
--separator="\\n" \
--menu="PulseAudio!pavucontrol!/usr/share/icons/gnome/16x16/apps/multimedia-volume-control.png
htop!/mnt/sda2/home/ff/bin/ht!/mnt/sda2/home/ff/.twm/icons/htop16.png
kcheckers!/usr/games/kcheckers!/usr/share/icons/Adwaita/16x16/apps/preferences-system-sharing.png
MasterPDFEditor!/mnt/sda2/home/ff/bin/masterpdfeditor!/usr/share/icons/hicolor/16x16/apps/masterpdfeditor3.png
Audacity!audacity!/mnt/sda2/home/ff/.twm/icons/audacity16.png
OpenShot!openshot!/mnt/sda2/home/ff/.twm/icons//openshot16.png
Record Desktop!gtk-recordmydesktop!/mnt/sda2/home/ff/.twm/icons/gtk-recordmydesktop.png" \
--command='/home/user/bin/choosefile' &
With the tab titles leaving visible desktop space I have it set so a left click of the desktop shows the volume, icon manager and stalonetray, and right mouse press shows the normal twm menu, so easy to get to other things when a window is maximised (and no real need to have multiple desktops as you can just have multiple maximised windows and easily flip between those).
Like twm a lot, have it installed as the default now in both Debian and OpenBSD. Of the two Debian (Linux) runs quicker for things like libreoffice moving charts around and has more programs in its main repository. I'm tracking Debian oldstable i.e. I'll still be using Jessie for a while yet, until Stretch drops into being old stable (when Jessie will start seeing security updates no longer being provided). Nicer having 2 years between releases, rather than OpenBSD's 6 monthly upgrade intervals.