(openbsd-cwm) Living in the terminal

11 risposte [Ultimo contenuto]
damidu
Offline
Iscritto: 03/30/2021

I would like to share a link to another window manager.
cwm https://en.wikipedia.org/wiki/Cwm_%28window_manager%29

$ sudo apt-get -y install cwm

What can i say... Well xterm is in full screen (ctrl+alt+f)

that work with all graphical windows

And emacs is running...

I can open abrowser or other apps with shift+alt+?

It's a stacking window manager and it's keyboard driven.

Yeah, I started X and xterm in full screen but no... Not now! I'm happy because I can see more or less where I'm going with emacs. https://hack.org/mc/computers.html

It's only the beginning :-)

damidu
Offline
Iscritto: 03/30/2021

And I can have all the source code I ever dreamed off

with

apt-get source emacs
apt-get source coreutils
apt-get source linux

I don't do programming but emacs with xterm. Wonderful! :-)

andyprough
Offline
Iscritto: 02/12/2015

I thought you were promoting the virtues of just staying in the tty and not using any window managers? Isn't cwm bloat?

Just kidding, looks pretty cool actually.

An old friend named zapper who used to post here all the time has me trying out jwm, with something called "jwm kit": https://codeberg.org/JWMKit/JWM_Kit

You get a whole desktop-looking environment and lots of typical desktop tools for barely any memory usage.

damidu
Offline
Iscritto: 03/30/2021

I don't have my thinkpad. I'm using a desktop with a big screen. But the color schemes of emacs in tty or with xterm with a black background are the same.

$ ls -lh /usr/bin/openbsd-cwm

-rwxr-xr-x 1 root root 99K Nov 19 2018 /usr/bin/openbsd-cwm

I don't have the patience to stick hours in tty yet. I need to switch to something else every 20/25/30 minutes. I'm a noob.

damidu
Offline
Iscritto: 03/30/2021

I come back to my computer and I use xterm in full screen with emacs. That's a very stable and pleasant layout running in the background. It's possible to open another windows (abrowser or other) on top of that. alt+tab is very useful. I don't have that if I start the X server with only xterm.

andyprough
Offline
Iscritto: 02/12/2015

I'm experimenting this past couple of weeks with the Netsurf browser, a GPL'd browser written in C, very minimal. Yesterday, I opened the 'netsurf-fb' browser - a "framebuffer" version of Netsurf that needs no GTK or QT or other integration into a desktop, and can be launched from a tty. It opens most websites, and I can interact fully with Trisquel, but it has hardly any javascript functionality (which is just fine by me for 90% of my browsing). It even has good ad-blocking. I'm using it right now to type this comment.

Anyway, when I opened it yesterday it was using 5mb of memory(!!!!) After I browsed with it for awhile, it used a bit more, but it's really something in terms of minimalism.

You can get the latest developer snapshots from here: https://ci.netsurf-browser.org/debian/buster/amd64/?C=M;O=D

Download and install the latest .deb files for the 'netsurf-fb' package and the latest 'netsurf-common' package.

To determine netsurf-fb's valid framebuffer interfaces, you can run this command:
$ netsurf-fb -f ?

My options were to run it with the following surface names (some of which I do not know what they are) - "ram" "sdl" "x" "vnc" and "wld" (wld is Wayland). I used "x", as follows:

$ netsurf-fb -f x

This opens a browser in a small window that couldn't be resized with the mouse. You can feed it a height and width for the window by starting it as follows (choose your preferred dimensions):

$ netsurf-fb -f x -w 1440 -h 900

If you want to open it in a tty, then you need to make sure that libsdl2 is installed. I was able to start it in a tty using sdl with sudo:
$ sudo netsurf-fb -f sdl -w 1920 -h 1080

Apparently I need to somehow give netsurf read permission for /dev/input/mouse(or mice?) in order to get it to start with sdl in the tty with regular user. I'm not sure how to feed that permission to the mouse, or which device under /dev/input I'm targeting, but I'll work to figure that part out. Here's a reference to this sudo/mouse issue with sdl in tty: https://bugs.netsurf-browser.org/mantis/view.php?id=2568

damidu
Offline
Iscritto: 03/30/2021

Thank you for sharing. I have the same issue with permission. If I want to read a pdf with fbi/fbgs it need to work as "root".

The quick fix that I have found it to use cwm and xterm in full screen and open other windows on top of that. I can switch between them with atl+tab.

True tty are better but yeah, I need to deal with permissions.

andyprough
Offline
Iscritto: 02/12/2015

Apparently not having the proper permissions to use the mouse device will stop you from opening a graphical program as the regular user. With netsurf-fb, the graphics are not the problem, it's only the lack of access to the mouse. I wish I could understand how to give netsurf-fb read permission for /dev/input/mouse. Another problem is I don't even have /dev/input/mouse on my system; I have /dev/input/mice, or /dev/input/mouse1, /dev/input/mouse2, etc. Have to see if I can find where someone has written about this.

damidu
Offline
Iscritto: 03/30/2021

I think that the tty is not really made for mouse oriented applications. It was not build for that. I'm not a big fan to use "root" or anything else for permissions.

xterm in full screen do the trick for now. I'm not ready to use the tty full time yet. But yes, "GNU/Linux" is really a command line oriented system.

https://www.linusakesson.net/programming/tty/

Edit:

"Write permissions to the device file are required, so when a user logs in on a particular TTY, that user must become the owner of the device file. This is traditionally done by the login(1) program, which runs with root privileges."

Do you think there is a group?

andyprough
Offline
Iscritto: 02/12/2015

I figured it out from reading this page: https://puredata.info/docs/faq/how-can-i-set-permissions-so-hid-can-read-devices-in-gnu-linux

You have to set up an "input" group and give it read permission under /etc/udev

1. check to see if you have an /etc/udev/rules.d/ directory. If not, make one:
$ sudo mkdir -p /etc/udev/rules.d/

2. Then create a new file in /etc/udev/rules.d/ and add permissions for a group you call "input":
$ sudo nano /etc/udev/rules.d/85-netsurf.rules
#add this line into the 85-netsurf.rules file:
GROUP="input", MODE="660"

3. Save and close the 85-netsurf.rules file. Now make an "input" group and add yourself to it:
$ sudo groupadd -f input
$ sudo gpasswd -a YOURUSERNAME input

4. Reboot, and now you should be able to start a graphical program in tty as the regular user. I was able to start netsurf-fb with:
$ netsurf-fb -f sdl -w 1920 -h 1028

5. You can check to see the change you made going into effect with this command:
$ ls -al /dev/input/

#now you'll see all the input devices have "crw-rw" as their properties - so this includes read-write mode for all input devices as long as I'm the user that interacts with them.

damidu
Offline
Iscritto: 03/30/2021

Thank you I'll try. I'm lazy with cwm because I have xterm open all the time in full screen in front of me. I don't leave the terminal and I can switch between abrowser or a pdf file. It's not look like a "real tty" but it's an habit.

It is a nice window manager. In tty the screen is more blurred. Basically I have the same tings. That don't change a lot.

damidu
Offline
Iscritto: 03/30/2021

I really like this window manager. It's possible to set any application in full screen mode. I can read pdf files or use abrowser and switch with alt+tab. Move and rearrange the windows. It's not like a tiling manager, you are in control of your windows.