Various dotfiles, associated scripts and cheatsheets as well as installation scripts and notes
-
Make sure we're using UEFI (system setup). This will affect how the installation of third-party stuff goes, so we need to do it first.
-
Run install.sh after updating any explicitly-specified versions
Note that zsh-install.sh & vscode-install-extensions.sh are run automatically after Oh-My-Zsh & VS Code are installed, respectively.
Note also that vim-plug installs fzf, so the latter won't be available
until nvim is started for the first time.
Note finally that the iriun deps installation will
require some interaction when UEFI is configured. I haven't tested this in the
script as of writing.
After setting up displays, if the login dialog is still on the wrong monitor, run
sudo cp ~/.config/monitors.xml ~gdm/.config/monitors.xml
Ubuntu will repeatedly install all network printers on every connect and quite annoyingly inform the user everytime it has done so. Per ask ubuntu, it's possible to turn this off as follows:
sudo systemctl stop cups-browsed
sudo systemctl disable cups-browsed
This isn't included in install.sh in case it's desirable behavior.
Timeshift is automatically installed but needs to be configured. Open the Timeshift application and set up as appropriate. Boot + monthly/weekly/daily snapshots seem appropriate.
All tweaks are automatically set via gsettings during installation. If
desired, additional customization can be performed via the Tweaks interface or
gsettings. Here is a convenient one-liner for listing available settings into
a searchable file:
gsettings list-schemas | \
perl -ne 'print; chomp; $schema = $_; for my $key (`gsettings list-keys $schema`) { \
print " $key"; for my $rangeItem (`gsettings range $schema $key`) { \
print " $rangeItem" } }' > all-gsettings.txt
If the system is dual boot with windows, run this command to fix windows time going awry every time linux is booted:
timedatectl set-local-rtc 1 --adjust-system-clock
In reverse:
timedatectl set-local-rtc 0 --adjust-system-clock
While it's possible to install GNOME extensions programmatically, one has to match the download url with one's shell version, and the maintenance cost just isn't worth it for a small list of extensions. I'm only using a few at the moment, so it's much easier to manually enable it using the GNOME shell integration chrome plugin. A list of install url(s) follows:
OverviewNavigation(Not compatible with gnome > 42)Dash to Panel. (Not currently using in preference to Dash to Dock) This extension has a config dump baked into the GUI, so we don't have to usedconf(see below) but probably can. I exported its settings to dash-to-panel.ini- V-Shell
- WSP (Windows Search Provider)
- Dash to Dock
- Hide Cursor (Wayland replacement for unclutter)
- Just Perfection
- All
Windows.
I'm using this for the save/restore window positions feature. I
forked the extension and exposed
those functions to DBus so I can trigger them from a script (see
laptop-monitor-toggle). As such, we can't install from the the extensions page until it's merged upstream and published. Follow the instructions I wrote down in the testing section of the readme. - CHC-E.
I use this for a few custom shortcuts (prefixed by
Super+Shift) and nothing else. Note that its visual effects (none of which I use) seem largely broken. - Focus
- Space Bar
For extensions with lots of configuration, we can dump it to file using
dconf. For example, the Just Perfection config can be exported via dconf dump /org/gnome/shell/extensions/just-perfection/ > just-perfection.ini (see
just-perfection.ini) and
imported via dconf load /org/gnome/shell/extensions/just-perfection/ < just-perfection.ini. Anything I've dumped at any point lives in this repo. The
dump/load cycle is scripted by
dconf_sync.sh.
Note that the GNOME Shell Integration Chrome extension is supposedly able to sync these, so this may no longer be a manual step. (Untested)
Needed for Github Credential Manager.
The first git action will trigger login.
gpg --full-generate-keypass init <gpg-id>
This
answer
is exactly what's needed for a clear drive. For an encrypted drive, rsync per
the answer and then use the Disks GUI to set up auto-unlock/mount.
This first time running navi, it will
need to load cheat sheet repos. After installing the default, make sure to also
run navi add thisisrandy/cheatsheets.
Ubuntu puts the audio interface to sleep after a few seconds by default. This
results in a loud popping sound in headphones when the interface cycles, and
Bluetooth speakers may go to sleep and not recover without manual cycling.
Fortunately, the fix is easy: Add the following lines to
/etc/modprobe.d/audio-powersave.conf (which may not exist):
options snd_hda_intel power_save=0
options snd_hda_intel power_save_controller=N
This probably drains battery powered output devices faster, but it's worth the trade-off.
I was observing some bad mouse chugging when the system was under network load
only (lots of CPU available). This is probably due to the mouse experiencing
interrupt starvation since the network interface is generating tons of packet
interrupts. Amazingly, my first attempt to fix this succeeded. We can modify
/etc/default/grub as follows:
GRUB_CMDLINE_LINUX_DEFAULT="usbhid.mousepoll=2"
If the variable isn't already empty, append to it. Per the archlinux
wiki, this changes the
frequency of mouse polls in ms. Also according to that page, the default is 8
(rounded down to a power of 2 from 10), so I've 4x'ed the work my CPU has to do
to handle the mouse. I doubt I'll notice any negative impact from this, but
need to remember that it's set just in case. The mouse is noticeably smoother
with this setting on.
The wisdom found collectively in Ubuntu doesn't "see" external USB Hard Disk, mount: unknown filesystem type 'linux_raid_member', and mount unknown filesystem type 'lvm2_member' gets us through to the win. In particular:
ls /dev/ | grep sdbefore/after to detect whether the HDD is even seensudo fdisk -lto find the correct devicemountcomplains about 'linux_raid_member'mdadm --assemble --run /dev/md0 <DEVICE>, assuming/dev/md0does not currently exist
mountcomplains about 'LVM2_member'sudo apt-get install lvm2to install the logical volume management toolsvgdisplayto get volume group UUIDvgrename <VG UUID> new_nameto rename it if there's a name conflictmodprobe dm-modto add a device mapping drivervgchange -ayto activatelvscanto list all logical volumes in all volume groupsmount /dev/new_name/root /(mnt|media/user)/whereever. May need to create mount location first
A note upfront: I have abandoned Boxes for VirtualBox, which is also free and just way better at basically everything. I'll leave this around for reference, I guess.
- Launch the client, then click on the client in the Boxes menu and go to Preferences -> Devices & Shares -> Folder Shares and add a folder
- On the client, install
spice-webdavd, then runsudo spice-webdavd -p 10000. "Spice client folder" should now be available from the "Other Locations" menu in Files - Sometimes when attempting to open the Spice client folder, it will error
with
HTTP error: Could not connect: Connection refused. It seems, per this discussion, that the best way to fix the issue is to manually typedav://localhost:9843into theOther Locations -> Connect to Servertextbox
First, get the necessary software using
sudo apt-get install qemu-kvm libvirt-daemon-system
- Grab the QCOW disk image(s) in
~/.local/share/gnome-boxes/images - Dump the machine config(s) as follows:
sudo apt install qemu-kvm libvirt-daemon-system
virsh -c qemu:///session list --all | awk 'NR>2 { print $2 }' | \
xargs -I {} sh -c 'virsh -c qemu:///session dumpxml $1 > $1.xml' -- {}
- Replace the QCOW image(s) in the same location
- Run
virsh create CONFIG.xmlfor each
- Remember to adjust the power settings on new VMs. Boxes doesn't seem able to recover when the guest blanks its screen
Ubuntu does a pretty good job of automatically installing
nouveau, but it uses the on-board
graphics by default for everything. We can tell any application to use the
Nvidia GPU by specifying DRI_PRIME=1 in its environment. See this
answer and also this
documentation. There's also an
application called
switcherooctl that
handles this in a more complete way. Note that prime-select from the
nvidia-prime functions, but doesn't seem to have any effect.
DroidCam Virtual Camera Audio Setup
The naive instructions below don't persist, and in kind of an asymmetrical way.
Despite the fact that I set up a default.pa under my home directory,
VirtualSpeaker doesn't exist after rebooting. However, OBS remembers
VirtualSpeaker, except it's really just remembering some dangling reference.
So the best I have right now is to set this up manually for every session. That
means the following:
- Open
OBSsettings and set Monitoring Device to something other thanVirtualSpeaker. - Run the
pactlcommands to createVirtualSpeakerandVirtualMic. - Reselect
VirtualSpeakerinOBS. - Hit "Start Virtual Camera" in
OBS.
Get pactl
sudo apt-get install pulseaudio pulseaudio-utilsCreate a virtual speaker and mic that connects to it
pactl load-module module-null-sink sink_name=VirtualSpeaker sink_properties=device.description=VirtualSpeaker
pactl load-module module-virtual-source source_name=VirtualMic master=VirtualSpeaker.monitorFor persistence, put these lines (sans pactl) in ~/.config/pulse/default.pa.
In OBS Studio, File -> Settings -> Audio -> Advanced and set Monitoring
Device to our new VirtualSpeaker. In the Audio Mixer pane, find the DroidCam
source and click "Enable Monitoring" (the headset icon near the bottom).
VirtualMic can now be selected as the system input source.