Skip to content

Latest commit

 

History

History
executable file
·
225 lines (151 loc) · 5.23 KB

README.md

File metadata and controls

executable file
·
225 lines (151 loc) · 5.23 KB

Dotfiles

Ubuntu 20.04 + i3wm

Install i3

sudo apt-get update && sudo apt-get install -y i3

Install tools

sudo apt install -y flameshot

Enable touchpad gestures

Check if /etc/X11/xorg.conf.d/ directory exists or not. If not, create one.

vim /etc/X11/xorg.conf.d/90-touchpad.conf

Add the following lines:

Section "InputClass"
        Identifier "touchpad"
        MatchIsTouchpad "on"
        Driver "libinput"
        Option "Tapping" "on"
        Option "TappingButtonMap" "lrm"
        Option "NaturalScrolling" "on"
        Option "ScrollMethod" "twofinger"
EndSection

Logout for changes to appear. Source

Screen tearing/flickering problem

sudo apt purge xserver-xorg-video-intel

No idea why this works but it does the job. But this also breaks backlight management.

But if there is no tearing/flickering problem then do the following:

sudo find /sys/ -type f -iname '*brightness*'

Make sure that your output device is present in /sys/class/backlight. If not, make a symlink to it.

sudo ln -s /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight  /sys/class/backlight

NOTE: The above path for the device may vary from system to system.

sudo mkdir -p /etc/X11/xorg.conf.d/ 
sudo vim /etc/X11/xorg.conf.d/00-backlight.conf
  Section "Device"
        Identifier  "Intel Graphics"
        Driver      "intel"
        Option      "Backlight"  "intel_backlight"
    EndSection

Source

Fix backlight function

If you had screen tearing and flickering issue and removed the intel drivers then use the below method to fix the backlight function.

wget https://github.com/haikarainen/light/releases/download/v1.2/light_1.2_amd64.deb
sudo apt install -f ./light_1.2_amd64.deb
sudo chgrp video /sys/class/backlight/*/brightness
sudo chmod 664 /sys/class/backlight/*/brightness

Volume control

pactl must work out of the box, but IF in case audio stuff breaks try pulseaudio-ctl

sudo apt install -y make
git clone https://github.com/graysky2/pulseaudio-ctl.git
cd pulseaudio-ctl
sudo make install

Source

Play/Pause button support

cd /tmp/nitish && \
wget https://github.com/altdesktop/playerctl/releases/download/v2.3.1/playerctl-2.3.1_amd64.deb && \
sudo apt install -f ./playerctl-2.3.1_amd64.deb

Volume goes beyond 100% issue

#!/bin/sh
current=$(pacmd dump-volumes | awk 'NR==1{print $8}' | sed 's/\%//')
[ $current -lt 100 ] && pactl set-sink-volume 0 +1%

Source

Or try to use pulseaudio-ctl instead which by default limits the volume to 100%.

Suddenly sound stops from speaker/headphones

sudo apt install pavucontrol -y
pavucontrol

and select the correct sound card. This could be due to HDMI attached, where the laptop sends the audio output to the HDMI sink (or card, whatever).

Bluetooth earphones issue

Error about "Protocal not available"

sudo apt-get install pulseaudio-module-bluetooth -y
pactl load-module module-bluetooth-discover
pulseaudio -k
pulseaudio -D
rm -r ~/.config/pulse; pulseaudio -k
sudo systemctl restart bluetooth

Source

Lid Management

Uncomment the following in /etc/systemd/logind.conf file

HandlePowerKey=ignore
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=suspend

You can leave HandleLidSwitchDocked=suspend commented if you do not wish to suspend when Docked.

Restart your system or run sudo systemctl restart systemd-logind after closing all the applications.

Source

Application Installation

Samba server setup

sudo apt install -y nautilus nautilus-share samba samba-client && \
sudo usermod -a -G sambashare $USER && \
sudo systemctl enable smbd && \
sudo systemctl start smbd

Then use Nautilus to share the folder.

How-to

Assign workspace to an application

Put terminal and the application in the same workspace in tiling mode.

xprop | grep WM_CLASS

The mouse cursor will change to a cross(+), click on the window of the application to get it's Class.

Ex output:

WM_CLASS(STRING) = "google-chrome", "Google-chrome"

Open the i3config and assign the workspace:

vim ~/.config/i3/config
assign [class="Google-chrome"] $ws2

Find the value of the key used

xev -event keyboard  | egrep -o 'keycode.*\)'

Setup multi-monitors

arandr gives a GUI and helps you store shell scripts with correct xrandr commands.

sudo apt install -y arandr