Workspace menus are definied in dtwmrc files. This defines windows options, the right click menu, and many key bindings. The main workspace menu is found in "/etc/dt/config/C/sys.dtwmrc." Failing finding another menu in a home directory, this is what will be used.
If another menu is be found in the current user's home directory's .dt folder (such as "/export/home/user/.dt/dtwmrc), that menu will take precedence. If a role is assumed and another menu is found in the role's home directory's .dt folder (such as "/etc/security/home/primary admin/.dt/dtwmrc"), then that menu will take precendence.
Here is a sample (modified to be short) dtwmrc file:
- ###
- #
- # Root Menu Description
- #
- ###
- Menu DtRootMenu
- {
- "Workspace Menu" f.title
- no-label f.separator
- "Refresh Workspace Display..." f.refresh
- "Restart Workspace Manager..." f.restart
- no-label f.separator
- "Lock Display" f.action LockDisplay
- "Log out..." f.action ExitSession
- }
- ###
- #
- # Front panel Manu Description
- #
- ###
- Menu DtPanelMenu
- {
- Restore _R f.normalize
- Move _M f.move
- Minimize _n f.minimize
- Lower _L f.lower
- Refresh _f f.refresh
- no-label f.separator
- "Log out..." _o f.action ExitSession
- }
- ###
- #
- # Sample Window Menu Description
- # This menu description exists as a sample only.
- # The normal window manager menu is built in.
- #
- ###
- Menu SampleWindowMenu
- {
- "Restore" _R f.normalize
- "Move" _M f.move
- "Size" _S f.resize
- "Minimize" _n f.minimize
- "Maximize" _x f.maximize
- "Lower" _L f.lower
- no-label f.separator
- "Occupy Workspace..." _O f.workspace_presence
- "Occupy All Workspaces" _A f.occupy_all
- "Unoccupy Workspace" _U f.remove
- no-label f.separator
- "Close" _C Alt<Key>F4 f.kill
- }
- ###
- #
- # Alternate Window Menu Description without accelerators
- #
- ###
- Menu NoAcceleratorWindowMenu
- {
- "Restore" _R f.normalize
- "Move" _M f.move
- "Size" _S f.resize
- "Minimize" _n f.minimize
- "Maximize" _x f.maximize
- "Lower" _L f.lower
- no-label f.separator
- "Occupy Workspace..." _O f.workspace_presence
- "Occupy All Workspaces" _A f.occupy_all
- "Unoccupy Workspace" _U f.remove
- no-label f.separator
- "Close" _C f.kill
- }
- ###
- #
- # Key Bindings Description
- #
- ###
- Keys DtKeyBindings
- {
- Ctrl<key>c root|icon|window f.nop # Copy
- Ctrl<key>v root|icon|window f.nop # Paste
- Ctrl<key>x root|icon|window f.nop # Cut
- }
- ###
- #
- # Mouse Button Bindings Description
- #
- ###
- Buttons DtButtonBindings
- {
- <Btn1Down> root f.marquee_selection
- <Btn2Click> root f.toggle_frontpanel
- <Btn3Down> root f.menu DtRootMenu
- }
- ###
- #
- # Defaults: Window menus, key bindings, and mouse button bindings
- #
- ###
- Menu DefaultWindowMenu
- {
- "Restore" _R Alt<Key>F5 f.normalize
- "Move" _M Alt<Key>F7 f.move
- "Size" _S Alt<Key>F8 f.resize
- "Minimize" _n Alt<Key>F9 f.minimize
- "Maximize" _x Alt<Key>F10 f.maximize
- "Lower" _L Alt<Key>F3 f.lower
- no-label f.separator
- "Close" _C Alt<Key>F4 f.kill
- }
- Keys DefaultKeyBindings
- {
- Shift<Key>Escape icon|window f.post_wmenu
- Alt<Key>space icon|window f.post_wmenu
- Alt<Key>Tab root|icon|window f.next_key
- Alt Shift<Key>Tab root|icon|window f.prev_key
- Alt<Key>Escape root|icon|window f.next_key
- Alt Shift<Key>Escape root|icon|window f.prev_key
- Alt Ctrl Shift<Key>exclam root|icon|window f.set_behavior
- Alt<Key>F6 window f.next_key transient
- }
- Buttons DefaultButtonBindings
- {
- <Btn1Down> frame|icon f.raise
- <Btn3Down> icon f.post_wmenu
- }
- ###
- #
- # Designer Desktop Customization: $HOME/.dt/wsmenu.dtwmrc (if it exists)
- # User Customization: $HOME/.dt/user.dtwmrc (if it exists)
- #
- ###
- INCLUDE
- {
- $HOME/.dt/$LANG/wsmenu.dtwmrc
- $HOME/.dt/user.dtwmrc
- }
If you want to give user's special dtwmrc files based on some criteria (such as their group), you can use an executable file in the "/etc/dt/config/Xsession.d" directory. All scripts in this directory will be executed upon each login.
Here is a sample Xsession.d, which creates the user's home directory and copies in an admin dtwmrc if applicable. If they are not an admin, they will be using the default dtwmrc at /etc/dt/config/C/sys.dtwmrc.
- DTWMRC=/path/to/admin/dtwmrc
- HOME_BASE=`/usr/bin/dirname ${HOME}`
- HOME_DIR_OWNER=root
- HOME_DIR_GROUP=bin
- HOME_DIR_PERMS=drwxr-xr-x
- SET_PERMS=755
- ADMIN_GROUP=adm
- # If the directory doesn't exist, create it
- if [ ! -d ${HOME} ]
- then
- /usr/bin/mkdir -p ${HOME}
- fi
- # if the directory permissions are not correct, change them
- D_PERMS=`/usr/bin/ls -ld ${HOME_BASE}/${USER} | /usr/bin/awk ' { print $1 } '`
- D_OWNER=`/usr/bin/ls -ld ${HOME_BASE}/${USER} | /usr/bin/awk ' { print $3 } '`
- D_GROUP=`/usr/bin/ls -ld ${HOME_BASE}/${USER} | /usr/bin/awk ' { print $4 } '`
- if [ "${D_OWNER}" != "${HOME_DIR_OWNER}" ] || \
- [ "${D_GROUP}" != "${HOME_DIR_GROUP}" ] || \
- [ "${D_PERMS}" != "${HOME_DIR_PERMS}" ]
- then
- /usr/bin/chmod -R ${SET_PERMS} ${HOME_BASE}/$USER
- /usr/bin/chown -R ${HOME_DIR_OWNER}:${HOME_DIR_GROUP} ${HOME_BASE}/$USER
- fi
- # if the user is an administrator, copy the admin workspace menu
- USER_GROUP=`/usr/bin/groups $USER | /usr/bin/awk ' { print $1 } '`
- if [ "${USER_GROUP}" = "${ADMIN_GROUP}" ]
- then
- if [ ! -d ${HOME}/.dt ]
- then
- /usr/bin/mkdir ${HOME}/.dt
- fi
- if [ ! -f ${HOME}/.dt/dtwmrc ]
- then
- /usr/bin/cp ${DTWMRC} ${HOME}/.dt/dtwmrc
- fi
- /usr/bin/cp /opt/CONET/wm/dtwmrc.sysadm \
- /etc/security/tsol/home/sysadm/.dt/dtwmrc
- fi
No comments:
Post a Comment