Trisquel running a desktop or window manager with lowest memory usage

34 risposte [Ultimo contenuto]
andyprough
Offline
Iscritto: 02/12/2015

I'm running the DWM window manager on Trisquel 11 and have my starting memory usage down to 250mb, which is fairly good, but certainly not as low as it can go. I've seen DWM starting up in my Libre antiX respin with under 100mb.

I was wondering what other people's experiences are as far as minimalism on Trisquel 11. What's your lowest memory usage at startup, and what desktop or window manager are you using? This is not a question for people using the tty - I know you can easily get well under 100mb by staying in the tty.

I'm using the full Trisquel 11 installation - does anyone have experience starting out under 250mb of memory usage with Trisquel Mini?

Also, are there services you've disabled in order to reduce the memory footprint? I've disabled all bluetooth related services, but I'm sure there's more I could disable and still have a running system.

andyprough
Offline
Iscritto: 02/12/2015

Some things I've been doing with Trisquel to try to reduce resource usage [these changes are NOT recommended, as they could screw things up for you]:

1. Reduce the frequency that the man page database is automatically updated. Currently it is updated daily, which is far more often than I need. Here's how I reduced that frequency to once per week by editing the "man-db.timer" file in the pluma text editor:
sudo pluma /lib/systemd/system/man-db.timer

Once that file was open in pluma, I replaced the line "OnCalendar=daily" to "OnCalendar=weekly"
Then saved and closed pluma.

2. I've disabled all services related to telephony [dundee and ofono], bluetooth, modems, printers [cups], unattended upgrades, and update notifiers:
sudo systemctl disable bluetooth.service
sudo systemctl disable cups.service
sudo systemctl disable dundee.service
sudo systemctl disable ofono.service
sudo systemctl disable ModemManager.service
sudo systemctl disable unattended-upgrades.service
sudo systemctl disable update-notifier-download.timer
sudo systemctl disable update-notifier-motd.timer

I hope I'm not screwing anything up by disabling these services. So far everything is working as normal, including wifi with my Atheros card.

3. I've purged some bluetooth packages from my system:
sudo apt purge bluez-cups blueman

The packages bluez and bluez-obexd both appear to be important dependencies for the entire Trisquel system, so for the moment I haven't removed them. I'll probably try to figure out how to remove them as dependencies and then remove them from the system in the future.

4. I've attempted to drastically reduced the amount of logging that systemd-journald is doing on the system. [This is doubly NOT recommended, as I have no idea what I am doing here and it could cause all kinds of chaos].

First I backed up journald.conf:
sudo cp /etc/systemd/journald.conf /etc/systemd/journald.conf.bak

Then I opened journald.conf in the pluma text editor:
sudo pluma /etc/systemd/journald.conf

And I made this extensive list of changes, all of which I got from reading the journald man page, and none of which I'm sure they really do much or won't screw up the system:
Storage=none
Compress=no
Seal=no
SplitMode=none
SyncIntervalSec=10m
RateLimitIntervalSec=120s
RateLimitBurst=100
SystemMaxUse=1%
#SystemKeepFree=
SystemMaxFileSize=50M
SystemMaxFiles=10
RuntimeMaxUse=1%
#RuntimeKeepFree=
RuntimeMaxFileSize=50M
RuntimeMaxFiles=10
#MaxRetentionSec=
#MaxFileSec=1month
#ForwardToSyslog=yes
#ForwardToKMsg=no
#ForwardToConsole=no
ForwardToWall=no
#TTYPath=/dev/console
MaxLevelStore=err
MaxLevelSyslog=err
MaxLevelKMsg=err
MaxLevelConsole=err
MaxLevelWall=emerg
LineMax=4K
ReadKMsg=no
#Audit=no

I saved pluma and closed and rebooted the computer at that point. As I said, after using it like this for a couple of days I haven't noticed any problems. I thought that messing with telephony and the modem manager could possibly kill wifi, but wifi is still working with my Atheros card.

============================

If anyone knows good reasons I should not be doing any of the above, I'd be happy to read your replies and consider your arguments. I'm looking for good guides on how to minimize systemd or to replace it altogether on an Ubuntu-based distro like Trisquel. If anyone knows of good guides of that sort, please let me know, as I'm having a hard time finding any. I found one guide from about 6 years ago of how to replace systemd with runit, but it looks to me like that method no longer works.

prospero
Offline
Iscritto: 05/20/2022

> how to minimize systemd

You do not need to know how to minimize systemd. This is not the init system you are looking for.

You can go about your business.

EmiliaES
Offline
Iscritto: 06/28/2023

back when I used DWM I think with mini I would have like 200-220 but I don't remember all that well, it may have been less tbh

andyprough
Offline
Iscritto: 02/12/2015

Yes, I need to install Trisquel Mini and see if there are any differences in the way that systemd and the various services are set up. That's on my to-do list for the near future.

andyprough
Offline
Iscritto: 02/12/2015

So I installed Trisquel Mini, and with that DWM starts up using about 214mb of memory, fvwm about 221mb, and LXDE about 330mb.

So Trisquel Mini is definitely doing some things under the hood to reduce memory usage. I noticed that telephony packages and bluetooth packages weren't installed, so I'll need to dig around and find other differences between the main version of Aramo and Trisquel Mini Aramo.

andyprough
Offline
Iscritto: 02/12/2015

I turned the machine off overnight, and when I started it up this morning it was only using 148mb at the tty, and only 197mb in DWM. So that's quite a bit less.

I wonder why Trisquel uses less memory after I completely shut it down and leave it alone for awhile? I noticed that if I just do a normal shutdown, my machine does not really shut down with Trisquel 11, but instead it goes into some sort of sleep mode. I have to hold the power button for about 10 extra seconds to make it really shut down. At that point, it uses less memory when it is started back up.

Might be something in the bios settings, I need to do some exploring. Maybe somehow I've left bios fast start enabled, even though I normally make a point of turning that off.

andyprough
Offline
Iscritto: 02/12/2015

>"I wonder why Trisquel uses less memory after I completely shut it down and leave it alone for awhile? I noticed that if I just do a normal shutdown, my machine does not really shut down with Trisquel 11, but instead it goes into some sort of sleep mode. I have to hold the power button for about 10 extra seconds to make it really shut down. At that point, it uses less memory when it is started back up."

I see what's happening, I read the "halt" command man page, and it says that with Trisquel's systemd I have to use the "sudo poweroff" command instead of "sudo halt" if I want to completely un-power the machine. I'm more used to using sysvinit systems, where "halt" does all the powering off. I'll have to train myself to use "sudo poweroff" from DWM when I'm shutting the machine down.

andyprough
Offline
Iscritto: 02/12/2015

I've been getting super annoyed with Trisquel not wanting to give me a grub menu by default - why is it this way?

Anyway, to get a grub menu, I set the grub defaults to what I like to call "the correct and proper ones".

1. backup grub
sudo cp -n /etc/default/grub /etc/default/grub.backup

2. open the grub configuration file in a text editor as the super user
sudo pluma /etc/default/grub
or use "mousepad" instead of "pluma" in that command if you are using Trisquel Mini

3. Change the following in the grub file:
a. The grub timeout style is "hidden" by default, which means you don't get a grub menu, and you get to spend time searching around for the correct key or key combo for your machine to get to a grub menu or get to bios or something. Let's change that. Change the line that says "GRUB_TIMEOUT_STYLE=hidden" to:
GRUB_TIMEOUT_STYLE=menu
b. Trisquel comes with a default grub timeout of 0 seconds, which means you still don't get any grub menu options before it boots to the default grub option, which is also just super annoying. Change "GRUB_TIMEOUT=0" to:
GRUB_TIMEOUT=5
to give yourself 5 seconds to decide which option in the grub menu you'd like to select.
c. Save and close pluma or mousepad
d. Update grub:
sudo update-grub
e. Reboot and revel in the glory of a proper grub menu on restart.

If one of the Trisquel developers would like to debate on why sticking with Ubuntu's super annoying grub defaults is a good idea, I'd be happy to have that discussion here. Although the fix is super simple, and I'm sure there's some good reason somewhere (such as the ever present Ubuntu mantra "think of the poor new users who don't know anything and are used to the Windows startup defaults!!!") for this, so it doesn't really matter in the end.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

I set the grub defaults to what I like to call "the correct and proper ones".

Those defaults (menu displayed for 5s, unless a key is pressed) are actually GRUB's defaults: you would obtain the same behavior removing/commenting the lines defining GRUB_TIMEOUT and GRUB_TIMEOUT_STYLE and executing sudo update-grub.

The grub timeout style is "hidden" by default, which means you don't get a grub menu, and you get to spend time searching around for the correct key or key combo for your machine to get to a grub menu or get to bios or something.

For the record:
If ESC or F4 are pressed, or SHIFT is held down during that time, [GRUB] will display the menu and wait for input. If a hotkey associated with a menu entry is pressed, it will boot the associated menu entry immediately.
https://www.gnu.org/software/grub/manual/grub/html_node/Simple-configuration.html

I'd be happy to have that discussion here.

I personally chose to display the menu for 3s. Let us fight on that two-second difference: 3s is the "correct and proper" timeout! Lol.

I'm sure there's some good reason somewhere (such as the ever present Ubuntu mantra "think of the poor new users who don't know anything and are used to the Windows startup defaults!!!") for this, so it doesn't really matter in the end.

Thinking of less skilled users makes sense... but isn't it better for them to have the menu displayed? Here it looks like the boot time is optimized, not the user-friendliness.

andyprough
Offline
Iscritto: 02/12/2015

>"I personally chose to display the menu for 3s. Let us fight on that two-second difference: 3s is the "correct and proper" timeout! Lol."

Oh my word. I feel like I've been slapped right across the face with a yellow piece of fruit. I don't know how to respond, other than to note that 3 second timeouts are for children and gamers, and only 5 seconds is a properly dignified and serious delay for adults like myself.

andyprough
Offline
Iscritto: 02/12/2015

So the other super annoying thing is that when I want to remove default programs, I get hit with "you can't do that or it will remove trisquel*", or "you can't do that or it will remove trisquel-mini*", or "you can't do that or it will remove trisquel-mini-recommended*".

Why can't I just remove some packages? Trisquel Mini has a package called "gigolo", which is a really really not good word meaning a male prostitute. I wouldn't want anyone to see a package called "gigolo" on my computer, it looks like the name for an app to negotiate payment rates with a prostitution service. Beyond that, gigolo is a package for connecting to remote file systems. I don't want to connect to remote file systems, and having a package on my machine that's interested in connecting to remote file systems could be a potential vulnerability. Why can't I just remove gigolo from my computer without removing "trisquel-mini*"?

I guess I have some research to do on how to surgically cut away at these installations to my satisfaction. Once again, the defaults here are just super annoying. I know that this is the way Ubuntu does things, but I'm used to the Debian(ish) world and being able to add or remove anything I want. I don't want these Ubuntu default behaviors.

/rant off

Otherwise, this Trisquel Mini 11 is just a fantastic experience. Very light and fast and just overall fantastic work by the dev team.

EDIT: I just read magic banana's many many statements in the forum that trisquel* and trisquel-mini* and trisquel-mini-recommends are just metapackages that are safe to remove and don't install or uninstall anything by themselves. Please disregard my moronic rant above.

prospero
Offline
Iscritto: 05/20/2022

"I'm just a gigolo, and everywhere I go...gigolo, gigolo, gigolo gigolo gigolo..."

I am not using gigolo. You just need to install gvfs-backends on Mini and you can visit file systems on your other local machines by typing sftp:// followed by the local IP of the machine in the address bar of PCManFM. So just install and configure openssh-sftp-server on the machines you want to visit remotely, and...RIP gigolo. Maybe they should fork it into "escort", using ssh only.

"It mounts what it is told to." -- https://www.uvena.de/gigolo/

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

I decided to try dwm.

The manual is really small as there is not so much to learn, which is nice. However, it is only after I found https://ratfactor.com/dwm that I quickly became reasonably comfortable with it, in about 1 hour.

Indeed it is fast. I never used a tiling window manager before and it feels like my x200 screen has become much more usable.

I am somehow missing a system tray, so I started stalonetray and have put it in all tags. I run nm-applet for the network, cbatticon for battery status, but I have not found how to get a volume icon.

Jonathan Matt Gresham
Offline
Iscritto: 07/24/2023

On Mon, Aug 14, 2023 at 04:50:00PM +0000, name at domain wrote:
> I decided to try dwm.
>
> The manual is really small as there is not so much to learn, which is nice.
> However, it is only after I found https://ratfactor.com/dwm that I quickly
> became reasonably comfortable with it, in about 1 hour.
>
> Indeed it is fast. I never used a tiling window manager before and it feels
> like my x200 screen has become much more usable.
>
> I am somehow missing a system tray, so I started stalonetray and have put it
> in all tags. I run nm-applet for the network, cbatticon for battery status,
> but I have not found how to get a volume icon.

The main site is suckless.org

here are some links you may need:

http://dwm.suckless.org/

http://dwm.suckless.org/status_monitor/

http://tools.suckless.org/dmenu/

andyprough
Offline
Iscritto: 02/12/2015

Wow!! I had not heard of stalonetray before, I'm going to need to try that out. I use the 'systray' patch for DWM, which gives you a full and normal systray experience. You can get the patch from here, if you are interested in using it: https://dwm.suckless.org/patches/systray/
I use the 6.4 version, which corresponds with my 6.4 version of DWM.

Then you can patch it into DWM. I'll leave my patch procedure for you in case you decide to use it:
1. I backup config.def.h, dwm.c, and config.h to be safe, as they will all be overwritten during this process:
cp config.def.h config.def.h.bak
cp config.h config.h.bak
cp dwm.c dwm.c.bak

2. I've found that I need to delete the original config.h, so that my changes to config.def.h will properly overwrite config.h and properly get rolled into the newly compiled version of DWM:
rm config.h

3. Patch in the systray patch:
patch -p1 < dwm-systray-6.4.diff

4. If you don't get any "Failure" errors, then make and install DWM:
sudo make clean install

5. If you don't get any make/install failure errors, then restart DWM, and you'll have a working systray. If you do get errors, let me know and I can help you resolve them.

To get a simple volumeicon is just
sudo apt install volumeicon

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

Thanks, I will try the patch. Anyway, I need to recompile dwm because on an azerty keyboard layout, Alt+<any digit> does not work, perhaps because Shift is needed to make digits.

>sudo apt install volumeicon

There is no such package in Trisquel. I know pasystray but I am lost (it is really complicated) and it is English only. I compiled https://github.com/fernandotcl/pa-applet, it gives a much simpler icon, it works and it has translations.

andyprough
Offline
Iscritto: 02/12/2015

You should be able to download the volumeicon deb package from Debian and install it - https://packages.debian.org/buster/volumeicon-alsa

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

I tried the systray patch, it is much better than using stalonetray. I also applied the azerty patch, now the keyboard shortcuts for tags are functional, this changes life.

On my acer aspire one, it does not make abrowser faster (it is slow) but the usage of screen space is so much better (I can fit an emacs and two terminals with no overlap in my native 1366x768 resolution) and I don't spend time arranging windows anymore, this is fantastic.

To your steps, I would add the following:

Get the source:
sudo apt install dpkg-dev
apt-get source dwm

Get the dependencies:
sudo apt install make gcc libx11-dev libxinerama-dev

Go to the source directory:
cd dwm-6.3

Fetch and apply the azerty patch (for those using azerty layout):
curl https://dwm.suckless.org/patches/azerty/dwm-azerty-6.2.diff > dwm-azerty-6.2.diff
patch -p1 < dwm-azerty-6.2.diff

Fetch and apply the systray patch (I recommend it) and install the missing dependency:
curl https://dwm.suckless.org/patches/systray/dwm-systray-6.3.diff >dwm-systray-6.3.diff
patch -p1 < dwm-systray-6.3.diff
sudo apt install libxft-dev

It is installed in /usr/local/bin, while dwm from trisquel package is in /usr/bin and /usr/local/bin appears first in the PATH in trisquel.

For the volume, pa-applet (not a trisquel package but free software without non-free dependency) is simple and runs fine with dwm (and probably with anything that has a system tray):

cd
sudo apt install git autoconf automake libglib2.0-dev libgtk-3-dev libnotify-dev libpulse-dev libx11-dev
git clone https://github.com/fernandotcl/pa-applet
cd pa-applet/
./autogen.sh
./configure --prefix=/usr/local
sudo make install
pa-applet&

It is installed in /usr/local/bin.

andyprough
Offline
Iscritto: 02/12/2015

Interesting, I haven't tried installing DWM from the deb source package, only from the suckless downloads or from git cloning the suckless git repo. What is the final DWM installation command? 'sudo make clean install'?

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

> I haven't tried installing DWM from the deb source package, only from the suckless downloads or from git cloning the suckless git repo

I suppose that using the source package minimises the risk of compatibility issues, but I don't have any precise clue.

> What is the final DWM installation command? 'sudo make clean install'?

Yes, as in your instructions.

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

It turns out that I like dwm better than any window manager I used so far. I find dwm super easy to use, it automatically optimizes the screen usage and I don't waste time moving or resizing windows anymore.

However, when running only dwm I am missing all the configuration tools from MATE.

I tried opening a MATE session with dwm, after I made the mate panel a floating window, it works fine. For some reason, the dwm title bar is making it not possible to put the MATE panel at the exact top, but it works by hiding the title bar and moving the MATE panel there, then it is possible to show the title bar again (I unselect the "extend" option so the MATE panel will only very partially hide the dwm title bar).

With the systray patch, the icons that normally went to the notification area applet go to the dwm systray, which I find inconvenient, so I'd rather use dwm without the systray patch.

MATE + dwm is going to be my main setup now.

andyprough
Offline
Iscritto: 02/12/2015

I tried that years ago with the XFCE panel in DWM, but after running it for awhile I found that it was using a lot of cpu and the machine was running hot. I hope your experience with the Mate panel is better.

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

I decided to try dwm-only on my T400 with 8GB memory, I don't see much difference in CPU usage and temperature as compared with MATE + dwm.

However, I start dwm from the display manager and it seems things like dbus, ibus and others are anyway running, perhaps that is the reason why there is not much difference?

My x200 with 4GB memory tends to get warmer with MATE + dwm, but I noticed it had 1GB on swap, so perhaps the issue is lack of memory? For email, instead of evolution on my t400, I now use claws-mail as it takes less memory. It does not handle the agenda but gnome-agenda does not take much resources and is connected to my caldav server (perhaps because I configured evolution) so I am not missing any feature.

The main issue is still the web browser. On trisquel forum page doing nothing, for some reason abrowser regularly uses a lot of CPU, I really wonder why. Then free software projects increasingly use discourse (including the FSF associate member forum), which makes abrowser use a lot of CPU.

andyprough
Offline
Iscritto: 02/12/2015

dbus and its associated services will run no matter how you log in, unless you build a minimal system from netinstall that doesn't install those components, or you find some method of disabling them until needed. Maybe'systemctl disable dbus' or a command like that could help you. I've chased different no-dbus setups for years, but some program or other always requires it and drags it in. Abrowser requires it.

I don't use sites with discourse, that might be a good topic to start a new discussion thread about. I use links2 browser for simple sites like this Trisquel forum. Seems like you and I have discussed links2 previously in the different links2 threads.

prospero
Offline
Iscritto: 05/20/2022

> that might be a good topic to start a new discussion thread about

Only the Topic Police Brigade can decide what is off-topic and what is not. Currently voyaging steadily, en route to the Gemini system, where everything is a text document and there is no topic police: https://gemini.circumlunar.space.

"The nascent Permacomputing movement seeks to apply ideas from permaculture to the subject of computing and society's relationship to them. A core concern is the environmental impact of computing, stemming from both the large and ever-growing energy demands of consumer computing devices and the datacenters and other internet infrastructure used to supply them with content, and the burgeoning piles of hazardous, recycling-resistant e-waste produced by non-repairable computing hardware with rapid, largely artificial, cycles of obsolescence." -- 6.4 What is permacomputing?

andyprough
Offline
Iscritto: 02/12/2015

The description of the "small internet" [or 'smolnet'] sounds a lot like our Trisquel forum home here:

>"- Careful production of thoughtful content at a comfortable pace, rather than a frantic stream of reactive "takes"
- Small, human-scale communities rather than global public spaces
- Self hosting or community hosting, rather than corporate monopoly silos
- Reply posts and private email discussions, rather than low quality, low effort "social" interactions like "likes", "boosts" and comments
- Serendipitous discovery of interesting people and content through random exploration, rather than searching for what you know or think you want"

prospero
Offline
Iscritto: 05/20/2022

> frantic stream of reactive "takes"

Frantic web: https://yt.oelrichsgarcia.de/watch?v=6RJq3s4JqrU
Trisquel forum: https://yt.oelrichsgarcia.de/watch?v=IzlzBufgp1g

The name of that game is too harsh for me, though. We need to create "A peaceful journey to Watnoth" and its sequel "The tranquil dwellers of Smolnet".

> corporate monopoly silos

We could make good silage of corporate monopolies. Rich food for demanding times.

Sunny Day
Offline
Iscritto: 01/05/2023

Thanks for the intro to permacomputing prospero, a great one to think about!

Sunny Day
Offline
Iscritto: 01/05/2023

Thank you andyprough! I am smiling, as I agree and am experiencing the very thing:

Serendipitous discovery of interesting people and content through random exploration, rather than searching for what you know or think you want

prospero
Offline
Iscritto: 05/20/2022

This really is an amazing forum, beyond Trisquel being an amazingly free distro. We often discuss chickens, pigeons, horse cart maintenance and the pros and cons of the socialist revolution vs. corporate capitalism. Also, symphonic viking metal and mindfulness.

Our official 2023 anthem is: https://ia600204.us.archive.org/3/items/csr071/csr071_auld-lang-syne_17_lovebyte_-_auld-lang-syne.mp3.

Sunny Day
Offline
Iscritto: 01/05/2023

Thanks all for this very informative thread, I bookmarked it for reference!

openmind
Offline
Iscritto: 08/30/2023

Have you tried twm? It is the default WM for X and it looks very simple.
@Magic Banana and @andyprough I use 4 seconds timeout in GRUB by the way

Malsasa
Offline
Iscritto: 12/01/2016

What do you think of WindowMaker? I'm interested to it because of GNUstep, AppImage and helloSystem. I think it will have a very low memory usage although I have not yet tried.

http://www.windowmaker.org

https://gnustep.github.io

Sincerely yours,

Malsasa

pkotrcka
Offline
Iscritto: 04/15/2021

ratpoison has a pretty small memory footprint.