Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Should be included from .twinrc
- # vim:ww=0:tw=0:
- # Screen stuff
- #
- # set screen background
- Background 1 High Black On Blue (
- "\xb2"
- )
- AddScreen 2
- Background 2 High Black On Green (
- "\xb1"
- )
- AddScreen 3
- Background 3 High Black On Cyan (
- "\xb0"
- )
- # the screen `1' is created by twin at startup,
- # so we do not need to `AddScreen 1',
- # and `High Black On Blue' means `high intensity black' (i.e. gray) foreground
- # on `blue' background.
- #
- # AddScreen 2
- # AddScreen 3
- # the complete list of colors is:
- # Black Blue Green Cyan Red Magenta Yellow White
- #
- # and `High' can be applied both to foreground and background.
- # depending on the display you use, `High' background may actually blink.
- #
- # the strings inside ( ) are just the screen background,
- # each string representing a line.
- #
- # every time you must write a string, you can use hexadecimal codes like "\xb1"
- # or octal codes like "\261", and double quotes surrounding the string
- # are only needed to protect special characters (i.e. parentheses,
- # non-alphanumerical chars, etc.). Sequences like "\?" where ? is a character
- # have the same meaning as in C language:
- # "\"" is a string containing a double quote,
- # "\n" is a newline, and so on.
- #
- # create the common part of all menus
- #
- # you need quotes to protect reserved names
- # or strings containing non-alphanumerical chars.
- # again, parenthesis '(' and ')' are used to group together a list
- #
- # this creates the menuitem " Window ", shared by all applications,
- # with the contents you see below.
- #
- # the command `Nop' is a do-nothing command used to insert a linebreak.
- # `_Next' is a user function (all other ones are predefined by twin) and
- # is defined below.
- #
- AddToFunc ONEScreen (
- Window 0
- SendToScreen 1
- )
- AddToFunc TWOScreen (
- Window 0
- SendToScreen 2
- )
- AddToFunc THREEScreen (
- Window 0
- SendToScreen 3
- )
- AddToMenu " Window " (
- " Full Screen " FullScreen
- " UnFocus " Focus Off
- " Refresh " Refresh
- " Move " Interactive Move
- " Resize " Interactive Resize
- " Scroll " Interactive Scroll
- " Center " Center
- " Maximize " Maximize
- " Roll Up " Roll Toggle
- "" Nop
- " Raise/Lower " RaiseLower
- " Next " _Next
- " Prev " _Prev
- " First Screen " ONEScreen
- " Second Screen " TWOScreen
- # " Third Screen " THREEScreen
- " List... " WindowList
- "" Nop
- " Send Pause " SyntheticKey Pause
- #
- # this is a user contributed idea: ALT-TAB to cycle through windows.
- # feel free to uncomment this line and the `Key Alt Tab _Next' far below
- #
- " Send Alt-Tab " SyntheticKey Alt Tab
- " Send F10 " SyntheticKey F10
- " Send F11 " SyntheticKey F11
- " Send F12 " SyntheticKey F12
- #
- "" Nop
- " Close " Close
- "" Nop
- " Kill Client " Kill
- )
- #AddToMenu " Keys 1 " (
- # " Send \x80 " SyntheticKey "Ç"
- # " Send \x81 " SyntheticKey "ü"
- # " Send \x82 " SyntheticKey "é"
- # " Send \x83 " SyntheticKey "â"
- # " Send \x84 " SyntheticKey "ä"
- # " Send \x85 " SyntheticKey "à"
- # " Send \x86 " SyntheticKey "å"
- # " Send \x87 " SyntheticKey "ç"
- # " Send \x88 " SyntheticKey "ê"
- # " Send \x89 " SyntheticKey "ë"
- # " Send \x8A " SyntheticKey "è"
- # " Send \x8B " SyntheticKey "ï"
- # " Send \x8C " SyntheticKey "î"
- # " Send \x8D " SyntheticKey "ì"
- # " Send \x8E " SyntheticKey "Ä"
- # " Send \x8F " SyntheticKey "Å"
- #)
- #AddToMenu " Keys 2 " (
- # " Send \x90 " SyntheticKey "É"
- # " Send \x91 " SyntheticKey "æ"
- # " Send \x92 " SyntheticKey "Æ"
- # " Send \x93 " SyntheticKey "ô"
- # " Send \x94 " SyntheticKey "É"
- # " Send \x95 " SyntheticKey "É"
- # " Send \x96 " SyntheticKey "É"
- # " Send \x97 " SyntheticKey "É"
- # " Send \x98 " SyntheticKey "É"
- # " Send \x99 " SyntheticKey "É"
- # " Send \x9A " SyntheticKey "É"
- # " Send \x9B " SyntheticKey "É"
- # " Send \x9C " SyntheticKey "É"
- # " Send \x9D " SyntheticKey "É"
- # " Send \x9E " SyntheticKey "É"
- # " Send \x9F " SyntheticKey "É"
- #)
- #
- # define the user function `_Next' :
- # group commands in '(' ')' and put either a newline or a ';'
- # after each command. `Window 1' means first window, while
- # `Window 0' is the currently focused window.
- #
- AddToFunc _Next ( Lower; Window 1; Focus; )
- # AddToFunc _Prev ( Lower; Window -1; Focus; Raise; )
- # this would be exactly the same
- #
- # AddToFunc _Next (
- # Lower
- # Window 1
- # Focus
- # )
- #
- # or you can even split the function definition:
- #
- # AddToFunc _Next ( Lower; Window 1; )
- # AddToFunc _Next (
- # Focus
- # )
- #
- #
- # These are not needed... and they override
- # the borders defined by Alternate Font
- #
- # Border "*" Inactive (
- # "ÚÄ¿"
- # "³ ³"
- # "ÀÄÙ"
- # )
- #
- # Border "*" Active (
- # "ÉÍ»"
- # "º º"
- # "Èͼ"
- # )
- #
- # But maybe you feel funky and want different borders
- # for different windows:
- #
- # Border "*Term*" Inactive (
- # " ß "
- # "Ý Þ"
- # " Ü "
- # )
- #
- # Border "Clock" Active (
- # " "
- # " "
- # " "
- # )
- #
- # Border "Tw*" Active (
- # "ÖÍ·"
- # "³ ³"
- # "Óͽ"
- # )
- #
- # menu windows have no name... and are always considered Inactive
- #
- # Border "" Inactive (
- # "ÛßÛ"
- # "Û Û"
- # "ÛÜÛ"
- # )
- #
- # create the buttons on window top border.
- # allowed buttons range from 0 to 9.
- #
- # syntax:
- # Button <number> "shape" {Left|Right} [[+|-]<position>]
- #
- # creates button <number> with given "shape", either on Left or Right
- # of window title. Optionally, you can control where exactly to place it:
- #
- # `Left +<n>' or `Right +<n>' leaves <n> free spaces between this button
- # and the last one on the same side.
- #
- # `Left <n>' or `Right <n>' specifies exact distance between button and
- # window Left (Right) edge.
- #
- # `Left -<n>' or `Right -<n>' says to place the button <n> characters nearer
- # to the border than just `Left' or `Right', possibly intersecting
- # other buttons.
- #
- # WARNING: Button 0 must ALWAYS be the close button...
- #
- Button 0 "XX" Left
- Button 1 "\x12\x12" Right
- Button 2 "^^" Right
- #
- # a maximize/fullscreen button. feel free to uncomment :-)
- Button 3 "+-" Right
- #
- # override the Options specified at compile time
- #
- # set shadows to 3x2 and enable them
- GlobalFlags Shadows 1 1 +Shadows
- #
- # enable blink/high background
- GlobalFlags -Blink
- #
- # do not force cursor always visible
- GlobalFlags -CursorAlways
- #
- # disable edge screen scrolling
- GlobalFlags -ScreenScroll
- #
- # don't hide the menu, it's the only way we can get to the screens
- GlobalFlags -MenuHide
- #
- # disable menu information row
- GlobalFlags -MenuInfo
- #
- # don't relax menu navigation
- GlobalFlags -MenuRelax
- GlobalFlags +AltFont
- #
- #
- # choose the mouse button used for click-to-focus,
- # for text selection and to activate window gadgets.
- # 1 means Left, 2 means Middle, 3 means Right.
- # this also implies a 'Focus' action when clicking in a non-focused window.
- #
- GlobalFlags ButtonSelection 1
- #
- # choose the mouse button used to paste text selection
- #
- GlobalFlags ButtonPaste 2
- #
- # keyboard bindings syntax:
- #
- # Key <flags> <name> <function>
- #
- # <flags> is optional and can be one or more of
- # Shift
- # Ctrl
- # Alt
- # remember anyway that except on X11 display twin can detect these flags
- # only deducing them from the ASCII sequences it receives from the keyboard,
- # so Shift is almost useless and not all keys combined with Ctrl and Alt
- # make sense (i.e. they must produce a unique, identificable ASCII sequence)
- #
- # <name> is the name of the key as in libTwkeys.h, without the TW_ prefix.
- # some examples:
- # Tab Return Escape BackSpace
- # Left Up Right Down
- # Prior (Page_Up) Next (Page_Down)
- # Home End Insert Delete
- # Pause Num_Lock
- # F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
- # or any ASCII character in double quotes:
- # "A" "[" "\xFF" and so on
- #
- # Pause pops up the menu
- # Key Pause Interactive Menu
- # Key Shift "Tab" Interactive Menu (doesn't seem to work)
- # Key Shift "F11" _Next
- Key Shift F11 WindowList
- #Key Shift F12 Interactive Menu
- Key F12 Interactive Menu
- # this is a user contributed idea: ALT-TAB to cycle through windows.
- # feel free to uncomment this line and the one far above saying this
- # same comment.
- #
- #Key Shift "Tab" _Next
- Key Alt Home Refresh
- Key Alt Down _Next
- #Key Alt "Up" _Prev
- Key Alt "Next" Focus Off
- #Key F10 "Send vqd"
- #AddToFunc _MySize ( FullScreen; Resize +0 -6; Move 0 +6; )
- AddToFunc _MySize ( FullScreen; Refresh; )
- AddToFunc _MiniSize ( FullScreen; Resize 80 6; Refresh; )
- AddToFunc _MyRadioSize ( FullScreen; Resize 80 35; Refresh; )
- AddToFunc _MaxTwTerm ( ExecTty bash "-login"; Wait bash; _MySize; )
- AddToFunc _MaxRemoteTerm ( ExecTty "/usr/local/bin/myterm"; Wait myterm; _MySize; Refresh; )
- # I commented this next line and renumbered the F10 above to F11
- # seeing as we now have a menu entry to create my own shell
- #Key F11 _MaxTwTerm
- # First command:
- _MaxTwTerm
- #
- # ALT-UP spawns a new terminal.
- #
- #Key Alt "Insert" _MaxTwTerm
- Key Alt "Prior" _MaxTwTerm
- #
- # SHIFT-PAGEUP scrolls up focused window
- #
- Key Shift "Prior" Scroll +0 -10
- #
- # SHIFT-PAGEDOWN scrolls down focused window
- #
- Key Shift "Next" Scroll +0 +10
- #
- # mouse bindings syntax:
- #
- # Mouse <buttons-list> <context> <function>
- #
- #
- # context is a string consisting of one or more of the following:
- # 0..9 corresponding button in window title
- # C window resize corner
- # T window title bar
- # S window sides
- # B window scroll bars
- # W one of T,S,B (i.e. window border except buttons and corner)
- # I window inside
- # M menu
- # R root (screen background)
- # A any of the above
- #
- #
- # mouse bindings: left click on button 0 graciously closes the window
- #
- Mouse 1 0 Close
- # this is subtle: doing
- # Mouse H1 0 Close
- # instead of
- # Mouse 1 0 Close
- # would close the window when you PRESS mouse left button on window close button,
- # NOT when you CLICK (i.e. PRESS, then RELEASE) on it!
- #
- # (note: `H' means `hold'. there is also `C' which means `click',
- # but it's the default and can be omitted, unless you want you want to use
- # them together, meaning to execute on PRESS and again on CLICK,
- # by specifying `HC' )
- #
- # any mouse click on button 1 does RaiseLower
- Mouse 123 1 RaiseLower
- # any mouse click on button 2 does Roll / UnRoll
- Mouse 123 2 Roll Toggle
- # these are do-nothing if Button 3 above is commented out
- #
- # mouse left click on button 3 does Maximize
- Mouse 1 3 Maximize
- # mouse middle click on button 3 does FullScreen
- Mouse 2 3 FullScreen
- # holding mouse left button on window title or sides does interactive move
- Mouse H1 TS Interactive Move
- # mouse left on window resize corner does interactive resize
- # mouse-based window resize works "as expected" only on window resize corner
- # (try yourself to bind some window button to Interactive Resize and see...)
- #
- Mouse H1 C Interactive Resize
- # mouse left on window bars does interactive scroll
- # unluckily, mouse-based window scrolling works properly ONLY
- # on window bars...
- #
- Mouse H1 B Interactive Scroll
- # mouse left on root unfocuses currently focused window
- #
- # you can create functions as complex as you like and use them
- # just like built-in functions...
- AddToFunc _UnFocus ( Window 0; Focus Off; )
- Mouse H1 R _UnFocus
- # middle button on root opens window list
- Mouse H2 R WindowList
- # Choose your favorite setup... for twin-classic menus, which appear only
- # after you press right mouse button, use this:
- #
- # GlobalFlags +MenuInfo
- # right button always opens the menu
- # Mouse H3 A Interactive Menu
- # mouse left on menu-bar does screen resize
- # Mouse H1 M Interactive Screen
- # # Otherwise you can use turbovision style menus:
- # # they always stay visible and are selected with left button
- # # _on_menu_bar_
- # #
- # GlobalFlags -MenuInfo
- # # left button on menu-bar opens the menu
- Mouse H1 M Interactive Menu
- # # in this case, use mouse right button on menu-bar for screen resize
- Mouse H3 M Interactive Screen
- # # Or better yet, create your personal style!
- # #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement