-====== FreeBSD On the Desktop ======- I've been tinkering with the new install of FreeBSD 15 on my Dell 7390 laptop. And I'm happy with it so far! Initially I had difficulty with the X graphics - loading the recommended kernel module "i915kms" after installing the package "dmr-kmod" made the computer hang during boot... I initially ignored it, and used the "scfb" device for Xorg by adding the file: "20-vesa.conf" to /usr/local/etc/X11/xorg.conf.d/ ####_______________________________________________ Section "Device" Identifier "Card0" Driver "scfb" EndSection ####_______________________________________________ I had no access to DPMS to turn the LCD off... and I'm not sure if the "backlight" command wouldn't work either... I found a solution, with recommended packages and settings for /boot/loader.conf [0] This is what worked: -------------------------- Installed new packages: drm-latest-kmod gpu-firmware-intel-kmod-kabylake -------------------------- ----- added to /etc/rc.conf -------------- kld_list="i915kms" ----------------------------------------- ----- added to /boot/loader.conf ------------- # Graphics and power tuning i915kms_load="YES" drm.i915.enable_rc6=7 drm.i915.enable_fbc=1 drm.i915.lvds_downclock=1 drm.i915.enable_psr=1 compat.linuxkpi.i915_disable_power_well="0" ----------------------------- i915 now loads and I have access to DPMS for turning off the LCD screen. Other tweaks.... I made a few small shell scripts to assist in controlling the battery consumption by being able to alter LCD brightness, and turn the LCD off via DPMS and makde i3 shorcuts to them. now I can "$mod+Shift+o" to reduce brightness and "$mod+Shift+p" to increase it, and "$mod+Shift+i" to turn the LCD screen off completely. I also added a devd rule to turn the LCD screen off when the lid is closed - this confused me initially, as it worked when testing it by adding the rule, restarting devd and testing, from within an X-Session.... but didn't work when devd was started during bootup... This was due to the lack of DISPLAY if the script was triggered from "outside" the X session. Changing the script to set the DISPLAY variable was the solution. ===== /etc/devd/rules.d/lid.conf ============= notify 20 { match "system" "ACPI"; match "subsystem" "Lid"; match "notify" "0x01"; action "/home/g4slv/bin/on"; }; notify 20 { match "system" "ACPI"; match "subsystem" "Lid"; match "notify" "0x00"; action "/home/g4slv/bin/off"; }; --------------------------------------------------- The lid actions call one of these -> ======= ~/bin/on ================== #!/usr/local/bin/bash su g4slv -c 'setenv DISPLAY :0.0 && /usr/local/bin/xset dpms force on' ======= ~/bin/off ================ #!/usr/local/bin/bash su g4slv -c 'setenv DISPLAY :0.0 && /usr/local/bin/xset dpms force off' ============= To replace the function of a "power manager" to watch the state of the battery and warn the user, and then if necessary to shutdown the laptop when the battery is almost dead I wrote another script, that gets started via crontab at reboot. I'll put a copy of "battcheck.sh" in the files section. It has 2 main functions - to monitor battery level and warn/shutdown - and to write a log file of the state of the machine, so I can analyze what might extend battery life. The log records: Date & Time apm battery run-time estimate apm battery level % apm battery power drain in mW CPU speed in MHz LCD Brightness State of DPMS swithing : On, Suspend, Standby, Off AC Charger on or off-line Getting the DPMS state via xset needed the same "setenv DISPLAY" trick as the devd rule, when the battcheck.sh script is started at boottime, outside of the x-session. The user is notified once when the battery reaches 30%, but no other action is taken. The script increases is rate of checking battey level from 30 seconds to 5 seconds at this point, as things tend to speed up as we approach flat-battery territory.... The user is notified again when the battery reaches 20%, with a more severe warning... no other action is taken yet, but the notifications will keep coming every 5 seconds now!! When the battery reaches 15% the user is notified again and a shutdown is initiated via "shutdown -p +1" giving the user 1 minute to plug in power.... If the charger is plugged in the pending shutdown is cancelled, and no futher shutdowns will be triggered while it the battery is being charged. ============================================================ I've found that power consumption in mW is greatly dependant in LCD brighness, and on playing media/video. So far I've found battery life to be very good, if you control brightness, keeping it below "40", down to "20" or less in suitable light conditions, will extend life to > 6 hours. I haven't yet done a full "run to exhaustion" test to see how the apm estimations agree with reality. ============================================================= Other tweaks ============ Small scripts to automate swithing between Wifi and Ethernet ------------- net_wlan.sh ---------------------- #!/bin/sh doas service netif stop em0 doas service netif start wlan0 doas service dhclient restart wlan0 -------------- net_eth.sh ------------------------- #!/bin/sh doas service netif stop wlan0 doas service netif start em0 doas service dhclient restart em0 ----------------------------------------------- I'll update this list as I remember them..... +++ FIX ME +++ Main Applications installed ================================= doas to replace sudo bash Librewolf Alpine Claws-mail slrn self-compiled urxvt v9.30 Shotwell VLC mpv gopher vf1 bombadillo sacc nano lynx feh Thunar (and thunar-archive-plugin and xarchiver) Libreoffice Hplip for network Printer access via CUPS pulseaudio figlet neofetch anslilove gnucash tmux iperf mousepad rsync tightvnc I'll leave the "pkg prime-list" of all the intentionally installed packages in the files section. [0] https://blog.hofstede.it/freebsd-150-on-the-thinkpad-t480-efficient-stable-and-8-hours-on-battery/