User Tools

Site Tools


linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
linux [2024/01/21 20:22] – [Future Config Tips] dblumelinux [2024/04/26 22:31] – [i3] dblume
Line 11: Line 11:
   sudo apt install exuberant-ctags cscope moreutils   sudo apt install exuberant-ctags cscope moreutils
    
-Now that you have vim and git:+Now that you have vim and git, get [[https://github.com/dblume/dotfiles|your dotfiles]]:
      
   git clone ssh://dblume@dlma.com/~/git/dotfiles.git   git clone ssh://dblume@dlma.com/~/git/dotfiles.git
Line 21: Line 21:
   sudo apt install tmux entr   sudo apt install tmux entr
   tmux   tmux
-  sudo apt install curl jq tree expect gnuplot httpie visidata+  sudo apt install curl jq tree expect gnuplot httpie visidata ripgrep at
   sudo apt install python3-pip   sudo apt install python3-pip
   python3 -m pip install matplotlib   python3 -m pip install matplotlib
Line 78: Line 78:
  
 The [[https://i3wm.org/|i3 Window Manager]]. The [[https://i3wm.org/|i3 Window Manager]].
 +
 +==== Install Alacritty ====
 +
 +gnome-terminal won't distinguish between C-i and Tab, so [[https://www.how2shout.com/linux/how-to-install-alacritty-terminal-on-ubuntu-22-04-lts/|install a terminal emulator that can, like Alacritty]], and set TERMINAL in .bashrc for i3-sensible-terminal to use.
 +
  
 ==== Configuration ==== ==== Configuration ====
Line 97: Line 102:
 xinput set-prop "PIXA3854:00 093A:0274 Touchpad" "libinput Natural Scrolling Enabled" 1 xinput set-prop "PIXA3854:00 093A:0274 Touchpad" "libinput Natural Scrolling Enabled" 1
 xinput set-prop "PIXA3854:00 093A:0274 Touchpad" "libinput Tapping Drag Lock Enabled" 1 xinput set-prop "PIXA3854:00 093A:0274 Touchpad" "libinput Tapping Drag Lock Enabled" 1
 +xinput set-prop "PIXA3854:00 093A:0274 Touchpad" "libinput Scrolling Pixel Distance" 40
 </file> </file>
  
Line 155: Line 161:
     nmtui     nmtui
  
-==== Future Config Tips ==== +==== Suspend and Hibernation ====
- +
-You can use ''xprop'' to learn the Window Class (the second value) for assigning apps to workspaces +
- +
-  assign[class="Rhythmbox"] $workspace10+
  
 +A note on battery life. Frame.work batteries work best at charges between 80% and 30%. I went into BIOS ([[https://knowledgebase.frame.work/how-do-i-enter-the-bios-on-the-framework-laptop-HydmWf5Ad|pressing F2 on start up]]) and set maximum charge to 90%.
  
-If you keep accidentally typing Ctrl+Shift+C in Chrome, [[https://askubuntu.com/questions/604434/chrome-disable-or-change-keyboard-shortcut-ctrlshiftc-developer-tools-console|you can disable it with shortkeys extension]]: +Suspend worked out of the box. See This PSA from frame.work: [[https://www.reddit.com/r/framework/comments/19bf3ki/linux_suspend_and_amd_reminder/|Linux Suspend and AMD Reminder]]. Per that PSA and [[https://community.frame.work/t/tracking-linux-battery-life-tuning/6665/536|[TRACKING] Linux Battery Life tuning]], I ran [[https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py?ref_type=heads|amd_s2idle.py]]. It ended with:
- +
-Install [[https://chrome.google.com/webstore/detail/shortkeys-custom-keyboard/logpjaacgmcbpdkdchjiaagddngobkck|shortkeys]] and set (and save) the following: +
-  * Keyboard shortcut: ctrl+shift+c +
-  * Behavior: Run JavaScript +
-  * Javascript code to run: ''document.execCommand('copy')'' +
- +
-=== Suspend and Hibernation === +
- +
-See if you can get your laptop to conserve battery better when closing the lidAlex_Maras provides some potential tips here: +
- +
-  * [[https://community.frame.work/t/resolved-amd-framework-arch-linux-suspend-wakes-every-5-minutes/39022|[RESOLVED] AMD Framework - Arch Linux - Suspend wakes every 5 minutes]] +
-  * [[https://community.frame.work/t/responded-amd-hot-while-suspended-in-suspend-then-hibernate/39050|[RESPONDED] AMD - Hot while suspended in suspend-then-hibernate]] +
-  * [[https://community.frame.work/t/tracking-linux-battery-life-tuning/6665/536|[TRACKING] Linux Battery Life tuning]] +
- +
-Per the third link above, I ran [[https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py?ref_type=heads|amd_s2idle.py]]. It ended with:+
 <code> <code>
 🚦 RTC driver `rtc_cmos` configured to use ACPI alarm 🚦 RTC driver `rtc_cmos` configured to use ACPI alarm
Line 188: Line 176:
  https://github.com/systemd/systemd/issues/24279  https://github.com/systemd/systemd/issues/24279
 </code> </code>
-So per the third link above, I edited /etc/default/grub like so:+So per the third link above, I [[https://askubuntu.com/questions/19486/how-do-i-add-a-kernel-boot-parameter|added a kernel boot parameter]] by editing /etc/default/grub like so:
 <file bash /etc/default/grub> <file bash /etc/default/grub>
 ... ...
Line 196: Line 184:
 And then I ran ''sudo update-grub'' per the file's instructions. And then I ran ''sudo update-grub'' per the file's instructions.
  
-Everything is still commented out in ''/etc/systemd/sleep.conf''. May need to turn some of those lines on.+Enable suspend-then-hibernate. To hibernate, [[https://community.frame.work/t/hibernation-using-it/6060/11|you need swap to be as big as RAM, then update GRUB]]. (32GiB in my case.) You may also have to [[https://community.frame.work/t/battery-drain-on-suspend-sleep-with-linux/42395/4?u=david_blume|disable Secure Boot]]. 
 + 
 +I had a 2GiB /swapfile, and this is how I resized it: 
 +<code bash> 
 +~$ sudo swapoff /swapfile  
 +~$ sudo dd if=/dev/zero of=/swapfile count=32K bs=1M 
 +... 
 +~$ sudo mkswap /swapfile  
 +~$ sudo swapon /swapfile 
 +</code> 
 +Then it became time to update the kernel boot params again with the UUID of the volume with the swapfile, and the physical offset of the swapfile. 
 +<code bash> 
 +$ blkid 
 +/dev/nvme0n1p2: UUID="de9f6aca-85a1-461b-b8b8-15f44441f64d" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="121db783-104a-4138-b7c2-c0451ab10454" 
 + 
 +$ sudo filefrag -v /swapfile | head 
 +Filesystem type is: ef53 
 +File size of /swapfile is 34359738368 (8388608 blocks of 4096 bytes) 
 + ext:     logical_offset:        physical_offset: length:   expected: flags: 
 +   0:        0..    2047:    1257472..   1259519:   2048:             
 +</code> 
 +That means, in my case, I add this to ''/etc/default/grub'''s ''GRUB_CMDLINE_LINUX_DEFAULT''
 +<code> 
 +resume=UUID=de9f6aca-85a1-461b-b8b8-15f44441f64d resume_offset=1257472 
 +</code> 
 +Don't forget to ''sudo update-grub''
 + 
 +Then I enabled this line in  
 +<file bash /etc/systemd/logind.conf>    
 +HandleLidSwitch=suspend-then-hibernate 
 +</file> 
 + 
 +Everything is still commented out in ''/etc/systemd/sleep.conf'' (Also see [[https://community.frame.work/t/tracking-suspend-on-linux-drains-a-lot-of-battery-compared-to-other-laptop/24737/60|suspend drains battery]]). May need to turn some of those lines on. 
 + 
 +==== Future Config Tips ==== 
 + 
 +You can use ''xprop'' to learn the Window Class (the second value) for assigning apps to workspaces 
 + 
 +  assign[class="Rhythmbox"] $workspace10 
 + 
 + 
 +If you keep accidentally typing Ctrl+Shift+C in Chrome, [[https://askubuntu.com/questions/604434/chrome-disable-or-change-keyboard-shortcut-ctrlshiftc-developer-tools-console|you can disable it with shortkeys extension]]: 
 + 
 +Install [[https://chrome.google.com/webstore/detail/shortkeys-custom-keyboard/logpjaacgmcbpdkdchjiaagddngobkck|shortkeys]] and set (and save) the following: 
 +  * Keyboard shortcut: ctrl+shift+c 
 +  * Behavior: Run JavaScript 
 +  * Javascript code to run: ''document.execCommand('copy')''
  
 ===== Gnome (Desktop Env) ===== ===== Gnome (Desktop Env) =====
linux.txt · Last modified: 2024/04/27 00:13 by dblume