*BSDThis forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If in your .twmrc you assign a maximise button on the twm window title along with a f.fullzoom function call, then whilst the window will maximise using a single click it takes two clicks to restore. The reason looks to be due to f.fullzoom waits for the next click after maximisation to focus the next window (documented feature, not a bug). A workaround to get to the more usual single click to maximise and another single click to restore back down again is to instead create a function, something like ...
Code:
Function "fullscreen" { f.fullzoom f.focus f.nop }
As twm celebrated its 30th Birthday recently (November 2017), rather than this thread just becoming a search engine single reference, I intend to add to various twm tips/tricks and make it a more comprehensive reference point, specifically for OpenBSD.
twm was started in 1987 by Tom LaStrange, it has been the standard window manager for the X Window System since X11 Consortium adopted it in 1989.
The default configuration isn't pretty and only relatively functional. Configuring your own ~/.twmrc is preferable IMO however there is relatively little around in the way of examples. So with that I'll add examples here over time in order to hopefully create a single reference point. Others are more than welcome to pipe in with their own contributions.
The base OpenBSD system and the twm that incorporates doesn't include a root window (desktop) background image setting tools other than for bitmap files (monochrome). You have to add something like feh or xv or whatever to be able to set a .png or .jpg ...etc image file as the wallpaper.
You can however use something like xpaint to create a .xbm (bitmap) image file from another image. Much of the detail will be lost due to just the two (black or white) pixel colour limit, however along with setting the colour mapping of those two colours and perhaps xclock you can make the desktop look a little more respectable.
For instance I loaded a wire frame type OpenBSD puffy fish image into xpaint, edited it to include some text, scaled it to be the same size as my screen resolution and then saved that as a .xbm, that I load in my .xsession file (I use xenodm, if you use startx then that uses .xinitrc instead of .xsession).
So instead of a single colour wallpaper, or a black and white image, I now have a green coloured wire-frame puffy fish image with some text below that, on top of a dark blue background together with a blueish analogue clock in the top right and a digital clock below that that just shows the current date in a more pale-blue type colour.
Wire-frame images work well when limited to bitmaps images. A nice one IMO is to create/find a skull bitmap image and add xeyes to that. Align/size the eyes to coincide with the skull's eye sockets and its a bit of fun to have that skull watching your mouse movements
Of course installing feh or xv (pkg_add feh) and using that to load a .png image (or whatever) would be the more usual option, however if you wanted to keep additional programs installed to a minimum then the above could suffice.
I like to use colours in twm, so for instance I have firefox menu entry along with its icon manager (like panel/tray) and window title/borders all coloured to a firefox orange/red type colour, and similarly LibreOffice writer menu/icon manager/title and window borders all a blue colour ...etc.
I have the first button in each window title (far left of title, before the window name/text) set to show the icon manager. That way from any full screen window a click of that button shows the icon manager and hence all other windows that can be switched to. So for instance whilst typing this posting, clicking that top left button reveals a drop down type list of all other windows that can be switched to and I can click on any of those to switch to that window.
I have my desktop set so that a right mouse press presents the twm main menu. I also have it set so that a right press of the title bar also shows that menu, so in a full screened window I don't have to find desktop space to click, and can just press the windows title instead.
Being able to perform actions within a full screened window that otherwise required visibility of some desktop space is a great enhancement IMO. Makes for easier switching between windows so there's less need to use multiple desktops or having to move windows out of the way.
... before I forget, some don't tend to use twm resize properly. The correct intent is to press the resize button (usually in the top right of a window) and move the mouse into the window, and then continue outward in the direction in which you want the window resized, i.e. in one of the N, NE, E, SE, S, SW, W, NW directions. Once the mouse is outside of the original window it can be moved back/forth to scale the window size as desired.
I use a multi-boot desktop PC setup. Originally I installed grub4dos bootloader using PuppyLinux and have a menu.lst entry of ...
Code:
title BSD sda4
root (hd0,3)
makeactive
chainloader +1
boot
The trick to install openbsd in its own partition is to use gdisk (for GPT drives) or fdisk (for msdos drives) to create the OpenBSD disklabel before running the installer — i.e. select type a600 in gdisk or type a6 in fdisk — and then use the default option during the OpenBSD installs partitioning stage to install to that disklabel and leave the rest of the disk alone.
OpenBSD didn't work well with a nvidia graphics card for me. I ended up removing the 8600GTX Nvidia card (in a pci slot) and used the onboard Radeon ATI graphics instead. After reinstallation of OpenBSD with that hardware setup its worked fine for me ever since. Not as snappy/quick as Linux, but it does stick to the rules so is solid (for instance uses synchronous IO so if a power outage occurs its less likely to have lost/corrupt data). Some set /etc/fstab to include noatime,softdep parameters (async IO), but whilst that can be quicker it comes with greater potential data corruption risk.
If you've booted/installed from a installation CD (I opted to use the basic via HTTP type CD to install from as that automatically sets up repositories for you), then you can always boot that using the boot -s (single user mode), and after running fsck to ensure the disks are clean, run the mount -a command to mount all disk, after which you can cd /home/user or whatever in order to fix problems.
Remember ALWAYS MAKE A BACKUP before making changes ... my first attempt at installing OpenBSD to a partition ended up with it taking over the entire disk (my other boot choices were lost and had to be restored from backup).
Note that I didn't install the 'quirks' package, rather that is a system 'package' that is used for package security purposes. i.e. I only installed
Code:
pkg_add firefox-esr libreoffice mpv mtpaint xfe
I use firefox as a PDF viewer and for both mail and calendar/diary via online services. Those installed packages cover my general needs for office, file management, video, image editing and browsing type purposes.
Setting twm to show no icons, only using the iconmgr, and instead of twm menus that require press and hold/drag type mouse actions, a alternative is to install stalonetray and yad and have a single desktop icon that is used to access/launch your programs that can be popped up on top of full screened (or above) windows with a simple mouse click or two.
For instance in .xsession (assuming using xenodm, .xinitrc if using startx) adding
... and on bootup you'll have just a single desktop icon that is contained within a scrollable stalonetray (bars that pop up either side of the icon that you can scrollwheel to scroll if there are more than one icon in the tray).
When just one icon is in the tray then with the above settings right mouse clicking on the desktop, or in a windows title bar and the stalonetray icon will be revealed. Another right click and the favourites menu will be shown (files, firefox, text editor, xterm in the above). Left clicking the icon and another list type menu of programs is shown. A neat feature is that the mouse warps to the tray on a right click action, so you soon get used to positioning the mouse on the desktop or on a window title bar and just tapping the right mouse twice for your favourites, or right and then a left mouse clicks to pop up the list of programs.
#!/bin/sh
yad --geometry 810x272+557+489 --color --init-color=red &
Pops up a calendar, select a day and opens the text editor (geany in my case) to save a filename with that date (diary)
Code:
#!/bin/sh
cd /home/user/Documents/diary
CHOOSEFILE=`yad --geometry 397x310+778+435 --title="Diary" --calendar --date-format="%b_%d_%Y"`
if [ ! -z "$CHOOSEFILE" ]; then
geany $CHOOSEFILE &
fi
twm's icons aren't that nice, too dated. The icon manager when set to use colours is still nice/good IMO. twm menus and the press/hold/move type motion to move through the menu isn't the best of methods IMO and certainly would be more difficult on a laptop with a touchpad. right click, right click, move a little and click the program you want type actions to launch programs both from the desktop and within full screened windows (by ensuring the first right click in on the titlebar) is a much quicker and relatively natural type way to access/launch programs. Along with the first (top left) title button on windows set to show the iconmgr ... and twm + stalonetray + yad are a great little (yet powerful) combination IMO.
Rather than using a yad --list as a program launcher, a yad icon viewer is much nicer. You can set it to single click to launch programs and have it read a folder of .desktop files that it populates its window with so adding or removing things is much easier than having to change the yad script code.
--button=gtk-close:0 ensures that only a close button is displayed. I have the above script being launched by gkrellm ... a right mouse click on the desktop or on a window titlebar warps to the gkrellm clock (bringing it into view if covered) and a left click pops up the menu (where a single click on any of the choices launches the respective program).
In effect using a minimal twm menu (that requires sliding (mouse press/hold movements)) just for system functions (destroy window ...etc type options), no twm icons, and using colour coded twm iconmgr as a form of tasklist (open programs). Where the menu used more often is a gtk type style as provided by yad.
9 packages installed in total on top of base OpenBSD 6.2 (xv is being used to load a desktop wallpaper image which pcmanfm could do, so the list could be reduced down to 8)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.