Advertisement
custompc

TWM .twmrc config file

Mar 7th, 2024 (edited)
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.44 KB | None | 0 0
  1. #*********************************
  2. # GENERAL SETTINGS
  3. #*********************************
  4. AutoRelativeResize # No cross of window edge needed for resize
  5. DecorateTransients # Also decorate transient windows
  6. NoBackingStore # Minimize repainting of menus
  7. NoCaseSensitive # Case ignoring for icon manager
  8. NoDefaults # No default title buttons, we will define them
  9. NoGrabServer # Do not grab the server when not needed
  10. NoHighLight # Dont change border of windows on mouse over
  11. NoTitleHighlight # No highlight for titlebar of selected window
  12. OpaqueMove # Move window instead of outline
  13. RandomPlacement # Windows without geometry are placed randomly
  14. #RestartPreviousState # Try to restart defaults from last x session
  15. UsePPosition "on" # Honor placement
  16. #NoIconManagers # No icon manager is showed
  17. IconifyByUnMapping # Dont use desktop minimized icons
  18. #DontMoveOff # Windows can't move outside the screen
  19. IconManagerGeometry "1200x10+0+1176" 10
  20. IconManagerDontShow {"conky" "xclock"}
  21. # ClientBorderWidth {"conky"}
  22. # InterpolateMenuColors
  23.  
  24. #*********************************
  25. # WINDOW BORDERS ETC
  26. #*********************************
  27. BorderWidth 1 # Number of pixels for entire window border
  28. FramePadding 2 # Number of pixels between titlebar buttons and frame
  29. MenuBorderWidth 5 # Number of pixels for menu border
  30. #NoMenuShadows # No shadow behind the popup menu
  31. TitleButtonBorderWidth 0 # Number of pixels for button border
  32. ButtonIndent 0 # Larger seems to squash buttons together
  33. TitlePadding 4 # Number of pixels around title buttons
  34.  
  35. #*********************************
  36. # TITLE BAR BUTTONS
  37. #*********************************
  38. IconDirectory "~/.twm/icons/" # Dir for own icon buttons
  39. LeftTitleButton "resize.xbm"=f.resize # Northwest arrow.xbm file
  40. LeftTitleButton "wmenu.xbm"=f.menu "WindowMenu" # Burger menu wmenu.xbm file
  41. RightTitleButton "minimize.xbm"=f.iconify # Down chevron .xbm file
  42.  
  43. # RightTitleButton "maximize.xbm"=f.fullzoom # Up chevron .xbm file
  44. # Above takes 2 clicks to restore [feature]
  45. # Below takes 1 clicks inc lower function
  46.  
  47. RightTitleButton "maximize.xbm"=f.function "maximize" # Up chevron .xbm file
  48. RightTitleButton "close.xbm"=f.delete # X character .xbm file
  49. Pixmaps { TitleHighlight "titlebar.xbm" } # Stippled when enabled
  50.  
  51. #*********************************
  52. # COLOR SETTINGS
  53. #*********************************
  54. Color {
  55. BorderColor "#2c2b2b" # Border colour of all windows
  56. DefaultBackground "#2c2b2b" # BG Colour of transient popups
  57. DefaultForeground "#C0c0c0" # FG Colour of transient popups
  58.  
  59. TitleBackground "#2c2b2b" # Window Titlebar main colour
  60. TitleForeground "#C0c0c0" # Window Titlebar text colour
  61.  
  62. MenuTitleBackground "#2c2b2b" # BG colour of root menu title
  63. MenuTitleForeground "#C0c0c0" # Font colour of root menu title
  64.  
  65. MenuBackground "#2c2b2b" # BG colour of root menu
  66. MenuForeground "#C0c0c0" # Font colour of root menu
  67.  
  68. MenuBorderColor "#2c2b2b" # Border colour entire root menu
  69. MenuShadowColor "#2c2b2b" # Drop shadow colour of root menu
  70.  
  71. IconManagerBackground "#2c2b2b"
  72. IconManagerForeground "#C0c0c0"
  73.  
  74. PointerForeground "Black"
  75. PointerBackground "White"
  76. }
  77.  
  78. #*********************************
  79. # FONT SETTINGS
  80. #*********************************
  81.  
  82. MenuFont "-adobe-helvetica-medium-r-normal--12-120-*-*-*-*-iso8859-1"
  83. TitleFont "-adobe-helvetica-medium-r-normal--12-120-*-*-*-*-iso8859-1"
  84. ResizeFont "-adobe-helvetica-medium-r-normal--12-120-*-*-*-*-iso8859-1"
  85. IconManagerFont "-adobe-helvetica-medium-r-normal--12-120-*-*-*-*-iso8859-1"
  86.  
  87. #*********************************
  88. # CURSOR ICON SETTINGS
  89. #*********************************
  90. Cursors {
  91. Frame "top_left_arrow"
  92. Title "top_left_arrow"
  93. Icon "top_left_arrow"
  94. IconMgr "top_left_arrow"
  95. Button "right_ptr"
  96. Menu "right_ptr"
  97. Wait "watch"
  98. Destroy "pirate"
  99. Resize "sizing"
  100. Move "fleur"
  101. Select "plus"
  102. }
  103.  
  104. #*********************************
  105. # NO TITLE BAR SETTINGS
  106. #*********************************
  107. NoTitle {
  108. "xclock"
  109. "xmessage"
  110. "TWM Icon Manager"
  111. }
  112.  
  113. #*********************************
  114. # TAB STYLE TITLE BARS
  115. #*********************************
  116. # SqueezeTitle {""}
  117.  
  118. #*********************************
  119. # AUTORAISE WINDOWS
  120. #*********************************
  121. # Autoraise {"xterm"}
  122.  
  123. #*********************************
  124. # CURSOR TO WINDOW ON DE-ICONIFY
  125. #*********************************
  126. WarpCursor { "xterm" }
  127.  
  128. #***********************************************************************
  129. # MOUSE SETTINGS AND WINDOW BEHAVIOURS
  130. #***********************************************************************
  131. # Button1=left, Button2=middle, Button3=right, m=alt, c=ctrl, s=shift
  132.  
  133. # The root window actions i.e. clicking on the desktop backgound
  134. # Right click menu ala Fluxbox
  135. Button3 = : root : f.menu "RootMenu"
  136.  
  137. # Wheel button system menu
  138. Button2 = : root : f.menu "System"
  139.  
  140. # Wheel button on Window to bring forward
  141. Button2 = : window : f.raise
  142.  
  143. # Left click on desktop to bring up window list
  144. Button1 = : root : f.menu "TwmWindows"
  145.  
  146. # Left click the window title to lower / raise + gain focus or move
  147. Movedelta 1
  148. Button1= :title: f.function "raise-lower-move"
  149. Function "raise-lower-move" { f.move f.raiselower }
  150.  
  151. # Middle click the window title for options for individual windows
  152. Button2= : title|frame : f.menu "WindowMenu"
  153.  
  154. # Right click window title to resize the window by mousing beyond frame
  155. Button3 = : title|frame : f.resize
  156.  
  157. # Hold alt key and left click to move entire window
  158. Button1 = m : window : f.move
  159.  
  160. # Hold shift key and right click / move to resize. Best near edges.
  161. Button3 = s : window : f.resize
  162.  
  163. # Hold Alt and Tab cycles through windows bringing up focus
  164. Function "winup" { f.circleup }
  165. "Tab" = m : root|window|frame|title : f.function "winup"
  166.  
  167. # Hold Alt plus left click window title to maximize window vertically
  168. Button1 = m : title|frame : f.zoom
  169.  
  170. # Hold Alt plus right click window title to maximize window horizontally
  171. Button3 = m : title|frame : f.horizoom
  172.  
  173. # Click to de-iconfy using IconManager
  174. Button1 = : iconmgr : f.iconify
  175.  
  176. DefaultFunction f.nop
  177.  
  178. #*********************************************************************
  179. # KEYBINDINGS AND FUNCTIONS FOR VDESK http://offog.org/code/vdesk.html
  180. #*********************************************************************
  181. # Change Virtual Desktops with vdesk
  182.  
  183. function "desktop-1" {
  184. f.exec "xmessage -center -timeout 1 -buttons OK DESKTOP NO: 1 &"
  185. f.exec "vdesk 1"
  186. }
  187. function "desktop-2" {
  188. f.exec "xmessage -center -timeout 1 -buttons OK DESKTOP NO: 2 &"
  189. f.exec "vdesk 2"
  190. }
  191. function "desktop-3" {
  192. f.exec "xmessage -center -timeout 1 -buttons OK DESKTOP NO: 3 &"
  193. f.exec "vdesk 3"
  194. }
  195. function "desktop-4" {
  196. f.exec "xmessage -center -timeout 1 -buttons OK DESKTOP NO: 4 &"
  197. f.exec "vdesk 4"
  198. }
  199.  
  200. # Ctrl-1 to 4 or Ctrl-R/L to change Virtual Desktops
  201.  
  202. "1" = c : all : f.function "desktop-1"
  203. "2" = c : all : f.function "desktop-2"
  204. "3" = c : all : f.function "desktop-3"
  205. "4" = c : all : f.function "desktop-4"
  206.  
  207. function "next" {
  208. f.exec "A=$((`vdesk`+1)); if [ $A = 5 ] ; then A=1 ; fi ; vdesk $A"
  209. f.exec "B=$((`vdesk`)); xmessage -center -timeout 1 -buttons OK DESKTOP NO: $B &"
  210. }
  211.  
  212. function "prev" {
  213. f.exec "A=$((`vdesk`-1)); if [ $A = 0 ] ; then A=4 ; fi ; vdesk $A"
  214. f.exec "B=$((`vdesk`)); xmessage -center -timeout 1 -buttons OK DESKTOP NO: $B &"
  215. }
  216.  
  217. "Right" = c : all : f.function "next"
  218. "Left" = c : all : f.function "prev"
  219.  
  220. # See note above
  221. function "maximize" { f.fullzoom f.focus f.nop }
  222.  
  223.  
  224. #*********************************
  225. # THE POPUP MENU
  226. #*********************************
  227.  
  228. menu "RootMenu" {
  229. #"Editor" f.exec "xfw &"
  230. #"Editor" f.exec "adie &"
  231. "Fileman" ("#1A88F2":"#2c2b2b") f.exec "xfe &"
  232. "Terminal" ("#FFB816":"#2c2b2b") f.exec "xterm &"
  233. "Internet" f.menu "Internet"
  234. "MultiMedia" f.menu "Multimedia"
  235. "Graphics" f.menu "Graphics"
  236. "Utilities" f.menu "Utilities"
  237. "Office" f.menu "Office"
  238. "Games" f.menu "Games"
  239. "Command" ("#009200":"#2c2b2b") f.exec "xterm +sb -fg dimgrey -bg white -geometry 25x1+840+1150 -name Run -title Run -e ~/.twm/scripts/getrun &"
  240. "Exit" ("#db0000":"#2c2b2b") f.quit
  241. }
  242.  
  243. menu "Internet" {
  244. # ">> Web Browser" !"chromium --force-device-scale-factor=.96 &"
  245. "> Web Browser" !"firefox &"
  246. "> Text Browser" !"links -g http://www.google.com &"
  247. "> Email Client" !"seamonkey -mail &"
  248. "> FTP Client" !"/usr/local/bin/filezilla &"
  249. "> MC FTP" !"xterm -geometry 177x56+317+107 -e mc . ftp://un:pw@ftp.dom.com &"
  250. "> SSH Client" !"putty &"
  251. }
  252.  
  253. menu "Multimedia" {
  254. "> Dead Beef" !"xterm -geometry 80x20+300+300 -e mpg123 http://ice1.somafm.com/groovesalad-128-mp3 &"
  255. "> Media Player" !"vlc &"
  256. "> Audio Mixer" !"xterm -geometry 80x20+300+300 -e cmixer &"
  257. #"> Sound App" !"pavucontrol &"
  258. }
  259.  
  260. menu "Graphics" {
  261. "> xPaint" !"xpaint &"
  262. "> Colours" !"gcolor2 &"
  263. "> Sshot!" !"xterm -bg black -fg grey -e scrot -d 6 -c -e 'mv $f ~/' &"
  264. "> Magnify" !"xmag &"
  265. "> X Font" !"xfontsel &"
  266. "> X Fig" !"xfig &"
  267. "> Xv" !"xv &"
  268. }
  269.  
  270. menu "Utilities" {
  271. "> Root XTerm" f.exec "xterm -fg goldenrod -bg black -e su - &"
  272. "> Manuals" f.exec "/home/orby/.twm/scripts/tkman &"
  273. "> Weather" f.exec "xterm -geometry 125x45 -e /home/orby/.twm/scripts/weather &"
  274. "> Htop" f.exec "xterm -e htop &"
  275. "> Neofetch" f.exec "xterm -e /home/orby/.twm/scripts/neofetch.sh &"
  276. "> Stick Clock" f.exec "~/.twm/scripts/getclock &"
  277. "> Clipboard" f.exec "xclipboard &"
  278. "> About..." f.identify
  279. "> Env Vars" f.exec "env | xmessage -nearmouse -buttons OK:1 -file - &"
  280. "> Wallpaper" f.menu "Wallpaper"
  281. }
  282.  
  283. menu "Wallpaper" {
  284. "> Set NeXTStep" !"xsetroot -solid '#545476' &"
  285. "> Set MacOS9B" !"xsetroot -solid '#54679c' &"
  286. "> Set Slate" !"xsetroot -solid '#4A5562' &"
  287. "> Plaid" !"xsetroot -mod 4 4 -bg '#595959' -fg '#696969' &"
  288. }
  289.  
  290. menu "Office" {
  291. "> Wordpro" f.exec "~/Office/Wordpro &"
  292. "> Ssheets" f.exec "~/Office/Spreadsheet &"
  293. "> Presents" f.exec "~/Office/Presentations &"
  294. "> PDF Docs" f.exec "xpdf &"
  295. "> Calculator" f.exec "xcalc &"
  296. "> Calendar" f.exec "cal -y -w | xmessage -nearmouse -buttons OK:1 -file - &"
  297. "> Fox Calc" f.exec "calculator &"
  298. }
  299.  
  300. menu "Games" {
  301. "> Galacta" !"xgalaga-sdl -window &"
  302. "> Xmahjong" !"xmahjongg --background green --tileset gnome &"
  303. }
  304.  
  305. menu "WindowMenu" {
  306. "Vertical" f.zoom
  307. "Horizontal" f.horizoom
  308. "Left" f.leftzoom
  309. "Right" f.rightzoom
  310. "Top" f.topzoom
  311. "Bottom" f.bottomzoom
  312. "AutoRaise" f.autoraise
  313. "Sticky" f.exec "~/.twm/scripts/stickwin &"
  314. "Sendto 1" f.exec "~/.twm/scripts/sendto-1 &"
  315. "Sendto 2" f.exec "~/.twm/scripts/sendto-2 &"
  316. "Sendto 3" f.exec "~/.twm/scripts/sendto-3 &"
  317. "Sendto 4" f.exec "~/.twm/scripts/sendto-4 &"
  318. }
  319.  
  320. menu "System" {
  321. "> Load Config" f.twmrc
  322. "> Edit Config" f.exec "xfw ~/.twmrc &"
  323. "> Hide Icomgr" f.hideiconmgr
  324. "> End Task" f.exec "xkill &"
  325. "> Restart" f.restart
  326. "> LCD Off" f.exec "xset -display :0 dpms force off &"
  327. "> Saver 2m" f.exec "xset s 120 120 -display $DISPLAY &"
  328. "> Saver 10m" f.exec "xset s 600 600 -display $DISPLAY &"
  329. }
  330.  
  331. #*******************
  332. # SCRIPTS REFERENCE
  333. #*******************
  334. # sendto-n: winid=$(xdotool click 1 & xwininfo | awk '/id: / {print $4}');vdesk n $winid;
  335. # stickwin: winid=$(xdotool click 1 & xwininfo | awk '/id: / {print $4}');vdesk 0 $winid;
  336. # getclock: winid=$(xwininfo -name xclock | awk '/id: / {print $4}');vdesk 0 $winid;
  337. #
  338. # getrun:
  339. # read "userinput?# "
  340. # nohup $userinput >/dev/null 2>&1 &
  341. # PPPID=$(awk '{print $4}' "/proc/$PPID/stat")
  342. # kill $PPPID
  343. # (nb:read params=os specific)
  344. #
  345. # weather:
  346. # curl wttr.in/country
  347. # sleep 30
  348. #
  349. # tkman:
  350. # MANPATH=/usr/share/man:/usr/local/man
  351. # export MANPATH
  352. # tkman
  353. #
  354. # xinitrc:
  355. # xrdb -load ~/.Xresources # load config
  356. # xmodmap ~/.Xmodmap # load kb mods
  357. # setxkbmap gb # UK pound symbol
  358. # xset r rate 200 40 # kb repeat rate
  359. # xset b 100 600 100 # beep tone
  360. # xsetroot -cursor_name left_ptr # cursor type
  361. # xset m 30/10 4 # mouse speed
  362. # xset +dpms # lcd powersaving
  363. # xset dpms 1200 1500 1800 # powersave times
  364. # xset s blank # screen blanking
  365. # xset s 300 # idle timeout
  366. # xsetroot -mod 4 4 -bg '#696969' -fg '#797979'
  367. # beforelight & # screensaver
  368. # vdesk & # virtual desks
  369. # xclock & # the clock
  370. # twm -v # the wm!
  371. #
  372. # https://www.cpcnw.co.uk/twm2/Grahams_TWM_page2.html
  373. # TWM: Started in 1987 by Tom LaStrange
Tags: Linux BSD TWM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement