From 37f9d69162d50813f19ac2ba636621f04aa6b9ab Mon Sep 17 00:00:00 2001 From: VectorKappa Date: Fri, 16 Jul 2021 23:05:01 +0200 Subject: [PATCH] Added some scripts I use, Optimized keybinds and other settings, Added a script to install my personaly preferred apps via yay --- alacritty/.config/alacritty/alacritty.yml | 2 +- bin/magic-sysrq-enable | 3 + bin/set-trackpoint-sensitivity | 4 ++ bin/workspaces_multimonitor | 59 +++++++++++++++++++ polybar/.config/polybar/config | 17 ++++-- sxhkd/.config/sxhkd/sxhkdrc | 20 +++---- yay.sh | 69 +++++++++++++++++++++++ 7 files changed, 157 insertions(+), 17 deletions(-) create mode 100755 bin/magic-sysrq-enable create mode 100755 bin/set-trackpoint-sensitivity create mode 100755 bin/workspaces_multimonitor create mode 100644 yay.sh diff --git a/alacritty/.config/alacritty/alacritty.yml b/alacritty/.config/alacritty/alacritty.yml index 88ad82b..9f43937 100644 --- a/alacritty/.config/alacritty/alacritty.yml +++ b/alacritty/.config/alacritty/alacritty.yml @@ -151,7 +151,7 @@ bell: color: '#4C566A' command: - program: play + program: aplay args: ["/home/vectorkappa/Music/beeps/wav/honk-sound.wav"] hints: # URL launcher diff --git a/bin/magic-sysrq-enable b/bin/magic-sysrq-enable new file mode 100755 index 0000000..4f25adc --- /dev/null +++ b/bin/magic-sysrq-enable @@ -0,0 +1,3 @@ +#!/bin/sh +echo 1 | sudo tee /proc/sys/kernel/sysrq +exit diff --git a/bin/set-trackpoint-sensitivity b/bin/set-trackpoint-sensitivity new file mode 100755 index 0000000..025101b --- /dev/null +++ b/bin/set-trackpoint-sensitivity @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "100" | tee /sys/devices/platform/i8042/serio1/serio2/sensitivity +echo "75" | tee /sys/devices/platform/i8042/serio1/serio2/speed diff --git a/bin/workspaces_multimonitor b/bin/workspaces_multimonitor new file mode 100755 index 0000000..2c1f39e --- /dev/null +++ b/bin/workspaces_multimonitor @@ -0,0 +1,59 @@ +#!/bin/bash + +all_monitors=$(xrandr -q | awk '/connected/ {print $1}') +default_screen=$(xrandr | awk '/ connected/ {print $1;exit;}') +extra_monitors=$(xrandr -q | awk '/ connected/ {print $1}' | grep -v $default_screen) + + +#First, configure stuff with xrandr +#Get user path +[[ $(who) != "" ]] && USER=$(who | grep :0\) | cut -f 1 -d ' ') || \ +USER=$(echo /home/* | cut -f 3 -d '/') + +export DISPLAY=:0.0 +export XAUTHORITY=/home/$USER/.Xauthority + +for monitor in $extra_monitors; do + prev_mon=$(xrandr | awk '/ connected/ {print $1}' | grep -B1 "^$monitor" | grep -vE "^$monitor|^--$") + xrandr --output $monitor \ + --auto \ + --right-of $prev_mon +done + +##Then, create workspaces on all monitors + I=1 + M=$(bspc query -M | wc -l) + if [[ "$M" == 1 ]]; then + bspc monitor -d I II III IV V VI VII VIII IX X + elif [[ "$M" == 2 ]]; then + bspc monitor $(bspc query -M | awk NR==1) -d I II III IV V + bspc monitor $(bspc query -M | awk NR==2) -d VI VII VIII IX X + elif [[ "$M" == 3 ]]; then + bspc monitor $(bspc query -M | awk NR==1) -d I II III IV + bspc monitor $(bspc query -M | awk NR==2) -d V VI VII + bspc monitor $(bspc query -M | awk NR==3) -d VIII IX X + elif [[ "$M" == 4 ]]; then + bspc monitor $(bspc query -M | awk NR==1) -d I II III + bspc monitor $(bspc query -M | awk NR==2) -d IV V VI + bspc monitor $(bspc query -M | awk NR==3) -d VII VIII + bspc monitor $(bspc query -M | awk NR==4) -d IX X + elif [[ "$M" == 5 ]]; then + bspc monitor $(bspc query -M | awk NR==1) -d I II + bspc monitor $(bspc query -M | awk NR==2) -d III IV + bspc monitor $(bspc query -M | awk NR==3) -d V VI + bspc monitor $(bspc query -M | awk NR==4) -d VII VIII + bspc monitor $(bspc query -M | awk NR==5) -d IX X + else + for monitor in $(bspc query -M); do + bspc monitor $monitor \ + -n "$I" \ + -d $I/{a,b,c} + let I++ + done + fi + +##Polybar launch + /home/$USER/.dotfiles/polybar/.config/polybar/launch.sh & + +##Set wallpaper + /home/$USER/.fehbg diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index 1b32d2f..b9935ca 100644 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config @@ -51,9 +51,10 @@ padding-right = 2 module-margin-left = 1 module-margin-right = 1 -font-0 = SauceCodePro Nerd Font Mono:size=10 +font-0 = "SauceCodePro Nerd Font Mono:size=10" font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 font-2 = siji:pixelsize=10;1 +font-3 = "SauceCodePro Nerd Font Mono:size=16;4" modules-left = rofi bspwm modules-center = mpd title @@ -182,6 +183,8 @@ format =