Эх сурвалжийг харах

add additional chassis type to laptop detection

separate sublime installation; experienced some bugs with adding and signing

remove openbox-themes package since it was deleted; possible impact still unknown

fix conditional check for directory not file when enabling dhcpcd on wired devices

add xcursor theme and size to xdefaults

add size restriction to journald configuration

add document regarding hi-dpi configuration; also journald tips

add laptop related configuration files and settings

add notes on x1 carbon
Casey DeLorme 5 жил өмнө
parent
commit
2d828d9265

+ 19 - 12
arch.sh

@@ -44,12 +44,13 @@ echo "FONT=koi8u_8x16" > /etc/vconsole.conf
 # enable multilib
 sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
 
-# add sublime text source
-curl -O https://download.sublimetext.com/sublimehq-pub.gpg && sudo pacman-key --add sublimehq-pub.gpg && sudo pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
-echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | sudo tee -a /etc/pacman.conf
-
 # update and install all packages
-pacman -Syu --noconfirm sudo bash-completion tmux vim linux-firmware linux-headers dkms smartmontools cryptsetup usbutils btrfs-progs gvfs dmidecode parted pkgfile pkgconf bison gcc gcc-libs cmake ccache ncurses xmlstarlet jq at bc cronie iptables rsync net-tools openssh sshfs ntp wget curl wireless_tools bluez bluez-utils lzop unzip p7zip xz unrar unace lrzip arj git mercurial subversion bzr postgresql mesa lib32-mesa dbus polkit xorg-server xorg-server-devel xorg-xinit xorg-xinit xorg-xdpyinfo xdotool xsel pulseaudio vulkan-tools arandr feh hsetroot openbox openbox-themes obmenu archlinux-xdg-menu compton xarchiver pavucontrol pasystray xdg-utils xdg-user-dirs tint2 conky pcmanfm gmrun rxvt-unicode urxvt-perls gnome-themes-extra gnome-icon-theme arc-gtk-theme gtk-engines gtk-engine-murrine lxappearance graphicsmagick imagemagick lame libwebp libid3tag libvorbis vorbis-tools faac x264 x265 libexif ffmpeg ffmpegthumbnailer tumbler joyutils evtest lm_sensors lshw gparted psensor gparted hardinfo fontconfig ttf-bitstream-vera ttf-droid ttf-dejavu ttf-freefont ttf-liberation ttf-hanazono mpv openshot gimp krita transmission-cli evince viewnior virtualbox-host-modules-arch virtualbox vagrant guvcview dia mednafen mame ppsspp lutris steam wine python-pip python-setuptools winetricks sublime-text
+pacman -Syu --noconfirm sudo bash-completion tmux vim linux-firmware linux-headers dkms smartmontools cryptsetup usbutils btrfs-progs gvfs dmidecode parted pkgfile pkgconf bison gcc gcc-libs cmake ccache ncurses xmlstarlet jq at bc cronie iptables rsync net-tools openssh sshfs ntp wget curl wireless_tools bluez bluez-utils lzop unzip p7zip xz unrar unace lrzip arj git mercurial subversion bzr postgresql mesa lib32-mesa dbus polkit xorg-server xorg-server-devel xorg-xinit xorg-xinput xorg-xdpyinfo xdotool xsel pulseaudio vulkan-tools arandr feh hsetroot openbox obmenu archlinux-xdg-menu compton xarchiver pavucontrol pasystray xdg-utils xdg-user-dirs tint2 conky pcmanfm gmrun rxvt-unicode urxvt-perls gnome-themes-extra gnome-icon-theme arc-gtk-theme gtk-engines gtk-engine-murrine lxappearance graphicsmagick imagemagick lame libwebp libid3tag libvorbis vorbis-tools faac x264 x265 libexif ffmpeg ffmpegthumbnailer tumbler joyutils evtest lm_sensors lshw gparted psensor gparted hardinfo fontconfig ttf-bitstream-vera ttf-droid ttf-dejavu ttf-freefont ttf-liberation ttf-hanazono mpv openshot gimp krita transmission-cli evince viewnior virtualbox-host-modules-arch virtualbox vagrant guvcview dia mednafen mame ppsspp lutris steam wine python-pip python-setuptools winetricks
+
+# add sublime text source
+curl -O https://download.sublimetext.com/sublimehq-pub.gpg && pacman-key --add sublimehq-pub.gpg && pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
+[ $(grep -c "sublime-text" /etc/pacman.conf) -eq 0 ] && echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | tee -a /etc/pacman.conf
+pacman -Syu --noconfirm sublime-text
 
 # install protontricks
 python3 -m pip install protontricks
@@ -112,14 +113,14 @@ sudo -u $aur_username git clone https://aur.archlinux.org/discord.git /home/${au
 
 # install laptop packages and optimize system configuration
 export chassistype=$(dmidecode --string chassis-type)
-if [[ "$chassistype" = "Laptop" || "$chassistype" = "Portable" || "$chassistype" = "Sub Notebook" ]]; then
-	pacman -Syu --noconfirm xf86-input-synaptics connman
+if [[ "$chassistype" = "Laptop" || "$chassistype" = "Portable" || "$chassistype" = "Notebook" || "$chassistype" = "Sub Notebook" ]]; then
+	pacman -Syu --noconfirm xf86-input-synaptics connman wpa_supplicant openvpn acpid ethtool hdparm sdparm acpilight
+	systemctl enable connman
+	systemctl enable acpid
 
 	sudo -u $aur_username git clone https://aur.archlinux.org/laptop-mode-tools.git /home/${aur_username}/laptop-mode-tools
 	(cd /home/${aur_username}/laptop-mode-tools && sudo -u ${aur_username} makepkg -rcsi --noconfirm)
-
-	# @todo: configuration of laptop-mode-tools
-	# @link: https://wiki.archlinux.org/index.php/Laptop_Mode_Tools
+	systemctl enable laptop-mode
 fi
 
 # cleanup temporary aur user
@@ -172,6 +173,8 @@ rsync -Pav /srv/arch-desktop/install/ /
 ln -sf .Xdefaults /etc/skel/.Xresources
 mkdir -p /etc/skel/.config/pulse
 sed "/module-suspend-on-idle/d" /etc/pulse/default.pa > /etc/skel/.config/pulse/default.pa
+# @note: we may want to avoid disabling this on laptops
+sed "/module-switch-on-port-available/d" /etc/pulse/default.pa > /etc/skel/.config/pulse/default.pa
 rsync -Pav /etc/skel/ $(getent passwd root | cut -d: -f6)/
 
 # update font cache
@@ -185,6 +188,10 @@ echo "PermitRootLogin no" >> /etc/ssh/sshd_config
 echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
 echo "X11Forwarding yes" >> /etc/ssh/sshd_config
 
+# set journald size
+sed -d '/^SystemMaxUse/' /etc/systemd/journald.conf
+echo "SystemMaxUse=2G" >> /etc/systemd/journald.conf
+
 # set root password
 printf "${root_password}\n${root_password}\n" | passwd
 
@@ -262,9 +269,9 @@ systemctl enable transmission
 systemctl enable postgresql
 systemctl enable cronie
 
-# extract active network device and if wired enable it so it works on reboot
+# enable wired connections on reboot
 export active_network_device=$(ip addr | awk '/state UP/ {print $2}' | sed 's/.$//')
-[ ! -f "/sys/class/net/${active_network_device}/wireless" ] && systemctl enable dhcpcd@${active_network_device}
+[ ! -d "/sys/class/net/${active_network_device}/wireless" ] && systemctl enable dhcpcd@${active_network_device}
 
 # build the init module
 mkinitcpio -p linux

+ 18 - 0
install/etc/X11/xorg.conf.d/70-synaptics.conf

@@ -0,0 +1,18 @@
+Section "InputClass"
+	Identifier "touchpad"
+	Driver "synaptics"
+	MatchIsTouchpad "on"
+	MatchDevicePath "/dev/input/event*"
+	Option "TapButton1" "1"
+	Option "TapButton2" "3"
+	Option "TapButton3" "2"
+	Option "VertScrollDelta" "-114"
+	Option "HorizScrollDelta" "-114"
+	Option "HorizTwoFingerScroll" "on"
+	Option "FingerLow" "30"
+	Option "FingerHigh" "50"
+	Option "MaxTapTime" "125"
+	Option "PalmDetect" "on"
+	Option "PalmMinWidth" "4"
+	Option "PalmMinZ" "120"
+EndSection

+ 6 - 2
install/etc/skel/.Xdefaults

@@ -2,7 +2,11 @@ Xft.dpi:                    96
 Xft.antialias:              true
 Xft.rgba:                   rgb
 Xft.hinting:                true
-Xft.hintstyle:              hintslight
+Xft.hintstyle:              hintfull
+Xft.autohint:               false
+Xft.lcdfilter:              lcddefault
+Xcursor.theme:              Chameleon-SkyBlue-Regular
+Xcursor.size:               14
 URxvt.depth:                32
 URxvt.geometry:             80x24
 URxvt*background:           [70]#001E27
@@ -23,7 +27,7 @@ URxvt.clipboard.pastecmd:   clipit -c
 URxvt.keysym.C-equal:       perl:font:increment
 URxvt.keysym.C-minus:       perl:font:decrement
 URxvt.matcher.button:       1
-URxvt.urlLauncher:          google-chrome-stable
+URxvt.urlLauncher:          /usr/bin/xdg-open
 URxvt.inputMethod:          ibus
 URxvt.preeditType:          OverTheSpot
 *background:                #001E27

+ 2 - 0
install/etc/skel/.config/openbox/rc.xml

@@ -38,6 +38,8 @@
 		<keybind key="C-A-Left"><action name="GoToDesktop"><to>left</to><wrap>no</wrap></action></keybind>
 		<keybind key="S-A-Right"><action name="SendToDesktop"><to>right</to><wrap>no</wrap></action></keybind>
 		<keybind key="S-A-Left"><action name="SendToDesktop"><to>left</to><wrap>no</wrap></action></keybind>
+		<keybind key="XF86MonBrightnessUp"><action name="Execute"><command>xbacklight -inc 5</command></action></keybind>
+		<keybind key="XF86MonBrightnessDown"><action name="Execute"><command>xbacklight -dec 5</command></action></keybind>
 		<keybind key="XF86AudioRaiseVolume"><action name="Execute"><command>pash increase</command></action></keybind>
 		<keybind key="XF86AudioLowerVolume"><action name="Execute"><command>pash decrease</command></action></keybind>
 		<keybind key="XF86AudioMute"><action name="Execute"><command>pash mute</command></action></keybind>

+ 2 - 0
install/etc/udev/rules.d/backlight.rules

@@ -0,0 +1,2 @@
+ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
+ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="acpi_video0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"

+ 13 - 0
notes/errors.md

@@ -0,0 +1,13 @@
+
+# errors
+
+These are known errors that are non-disruptive:
+
+- Failed deactivating swap
+	- _non-disruptive_
+- watchdog: watchdog0: watchdog did not stop!
+	- _this is normal activity; non-disruptive_
+- connman "cannot read /proc/net/pnp"
+	- _false positive related to NFS; non-disruptive_
+
+I am keeping track of these as I have not found a way to "solve" (eg. silence) them sanely.

+ 30 - 0
notes/hidpi.md

@@ -0,0 +1,30 @@
+
+# hidpi
+
+I recently installed on a laptop with a high DPI display.
+
+Turns out, the configuration needed numerous changes, which I will detail here.
+
+
+## compute DPI
+
+I recommend that you compute your DPI first.
+
+https://winaero.com/blog/find-change-screen-dpi-linux/
+
+
+## configuration
+
+First, for the openbox menu, conky, and others, changing `Xft.dpi`.
+
+For gnome based applications this is recommended:
+
+	gsettings set org.gnome.desktop.interface text-scaling-factor 2.0
+
+For `Sublime Text` you need to add `"ui_scale": 2.0` to user configuration.
+
+Finally, the scaling of `urxvt` makes the `urzvtq` dimensions a bit large, so I modify `geometry 200x24` to `geometry 200x16` inside `/usr/local/bin/urxvtq`.  _We rely on a width larger than the display to force Openbox to auto-shrink it._
+
+For the console displayed at boot, I ran `pacman -Syu terminus-font` and then modified `FONT=koi8u_8x16` to `FONT=ter-932n` inside `/etc/vconsole.conf`.  _I prefer `koi8u_8x16` aesthetically, but it is too small on large displays._
+
+To fix the cursor several files needed to be modified from `Chameleon-SkyBlue-Regular` to `Chameleon-SkyBlue-Large`.  _This includes `~/.gtkrc-2.0`, `~/.config/gtk-3.0/settings.ini`, `~/.icons/default/index.theme`, and `~/.Xdefaults`._

+ 8 - 0
notes/journald.md

@@ -0,0 +1,8 @@
+
+# journald
+
+While I am not sure if I agree with converting logs to binary format, and learning a new tool to parse logs even though we have so many other well known tools, this is just how it is by default now so I wanted to document some tips and tricks.
+
+Let's start with clearing all logs:
+
+	journalctl --rotate; journalctl --vacuum-time=1s

+ 62 - 0
notes/x1c.md

@@ -0,0 +1,62 @@
+
+# X1 Carbon
+
+I bought an X1 Carbon during their 2019 March sale; $2000 of laptop, $600 worth of upgrades, for $1500.
+
+I am transitioning from a 2015 12" Macbook; recent experience suggests Apple is going downhill.
+
+This is just a "scratch-pad" of things I experienced when I setup and began using the new machine.
+
+I am using [the wiki](https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon) as a reference.
+
+
+## first impressions
+
+It is very small and light weight.  Possibly lighter than my 2015 12" Macbook.
+
+The display is absolutely gorgeous.
+
+The speakers are an unimpressive contrast to the display.
+
+The battery life, even (or perhaps especially) with Linux seems amazing.  I spent 3 hours actively configuring the system and it only went down 10%.  The initial calculation claimed 8 hours, which went up to over 11 hours due to averaging my activity and consumption.  _I have not yet tested this under load such as during compilation._
+
+Thus far I have not encountered a single show-stopper or complex issue with setting up Arch Linux on this laptop.
+
+The keyboard is going to take some getting used to, mostly due to layout, but also the functionality such as soft-enable/disable of things like bluetooth and wifi, **which are working out-of-the-box.**
+
+The HiDPI display has required quite a few configuration tweaks.
+
+Sleep mode appears to work out-of-the-box as well when I close the lid, and even automatically disables networking (which is re-enabled when the lid is opened), but I will have to check battery consumption.
+
+The trackpad works, but feels slow so I am looking to reconfigure it (_almost certainly related to hiDPI_).
+
+_The display brightness is the only thing I have found so far that is not working "out-of-the-box"._
+
+
+## second day
+
+I closed the lid at midnight with 89% battery, and opened it this morning after 9AM.
+
+The display came back on immediately, and the battery level was 86%.
+
+I did have to modify settings to address [hiDPI](hidpi.md) as many visual tools launched too tiny, others already scaled but were too big.
+
+I found that I had to increase mouse acceleration, which could be touchpad related, or due to the display dimensions.  _For my use case this involve changing `xset m 7 5` to `xset m 14 3` inside `~/.config/openbox/autostart`._
+
+I finished setting up `laptop-mode-tools` and some dependencies (eg. `acpid`).
+
+I began to discover some of the shortcuts thanks to [the arch wiki](https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)).  For example, `fn+4` is instant sleep mode, and again to wake it back up.  The keyboard lighting is controlled with `fn+space`, meaning no extra work needed to get that working.
+
+**The only gripe I have so far is the lack of tap-to-click on the trackpad, and button placement throwing me off (I regularly rest my thumb where I expect buttons causing scrolling events).**
+
+I can also now confirm that the battery life is roughly half as good if playing media as opposed to editing files and browsing the web.  _4 hours of configuration, 9 hours in sleep mode prior to `laptop-mode-tools`, and another 4 hours of configuration and it still had over 50% battery, which listed as 6 hours remaining.  Then I began playing youtube videos and the calculation dropped to around 3 hours remaining._
+
+I was able to use the webcam and microphone with `guvcview`, I simply had to increase the microphone volume to get it to pick up the audio.
+
+**I was thrown off by the fact that I had to use `connmanctl` to run `enable bluetooth`, otherwise `bluetoothctl` does not see the controller.**  It might be possible to handle all connected devices entirely from `connmanctl` now.
+
+The system recharged its battery from 50% to 100% in just over 2 hours while in use.
+
+I had to add and modify a few configuration files to get brightness working as well as improved touchpad behavior.
+
+The display did accrue some smudges when I accidentally touched it, fortunately I had some cleaning cloths for that.

+ 1 - 0
readme.md

@@ -51,3 +51,4 @@ Finally, while I am not a fan of how `systemd` forced proliferation into all lin
 - [Arch Wiki AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository)
 - [ip command cheatsheat](https://access.redhat.com/sites/default/files/attachments/rh_ip_command_cheatsheet_1214_jcs_print.pdf)
 - [packer-arch by elasticdog](https://github.com/elasticdog/packer-arch)
+- [touchpad configuration](http://add4jhf.blogspot.com/2013/09/touch-pad-deactivation-while-typing-and.html)

+ 5 - 3
todo.md

@@ -1,11 +1,13 @@
 
 # todo
 
-- eliminate pulse `switch-on-port-available` module
+- investigate using `Ignorepkg` to lock the kernel and prevent disruption during daily updates
 
-- fix `setup/install.sh` to either parameterize or ask which disk is the primary
+- investigate a method of detecting "hidpi" displays without relying on xserver so we can automate configuration changes
 
-- fix `arch.sh` to replace hard-coded `/dev/sda` when setting up `bootctl`
+- replace hard-coded `/dev/sda`
+	- parameterize `setup/install.sh` to detect disks and interactively ask for primary
+	- parameterize disk so that `bootctl` in `arch.sh` determines the root partition
 
 - enhance `setup/install.sh` such that it can intelligently size swap
 	- detect if laptop (`pacman -S dmidecode`) or ask if user wishes to enable hibernation