From cf075a3fddb359ca6a4f409d64b8c313ee8a601a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Mon, 21 Sep 2020 14:40:52 +0200 Subject: [PATCH] Added Logs-emerge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .local/bin/{checking-repo => Checking-repo} | 0 .local/bin/Logs-emerge | 13 ++++++++++ .xinitrc | 28 ++++++++++++++++++--- 3 files changed, 37 insertions(+), 4 deletions(-) rename .local/bin/{checking-repo => Checking-repo} (100%) create mode 100755 .local/bin/Logs-emerge diff --git a/.local/bin/checking-repo b/.local/bin/Checking-repo similarity index 100% rename from .local/bin/checking-repo rename to .local/bin/Checking-repo diff --git a/.local/bin/Logs-emerge b/.local/bin/Logs-emerge new file mode 100755 index 0000000..c1f9202 --- /dev/null +++ b/.local/bin/Logs-emerge @@ -0,0 +1,13 @@ +#!/bin/bash +LOGS=( $(sudo find /var/tmp/portage/ -mindepth 3 -name "build.log") ) +LEN=${#LOGS[@]} + +for (( i=0; i<$LEN; i++ )); +do + echo "$i - ${LOGS[$i]}" +done + +echo +read -p 'Select number to show logs: ' NUMBER + +sudo tail -f ${LOGS[$NUMBER]} | ccze -A diff --git a/.xinitrc b/.xinitrc index 6d84f48..9517c7b 100644 --- a/.xinitrc +++ b/.xinitrc @@ -1,14 +1,20 @@ #!/bin/sh export PATH=$HOME/.local/bin:$PATH +# NVDIA xrandr --setprovideroutputsource modesetting NVIDIA-0 xrandr --auto -xset s off -dpms& + +# Turn off beep xset b off& -xset s off& -xset -dpms& + +# Lock screen +xset s 300 +xautolock -time 5 -locker slock& + +# Programs compton& -feh --bg-fill $HOME/.wall.jpg & +feh --bg-fill "$HOME/.wall.jpg" & nm-applet --sm-disable& #sudo /root/.local/bin/protonvpn c -f& dunst -config& @@ -19,4 +25,18 @@ password-manager& sudo /usr/bin/rdate -s ntp.task.gda.pl && sudo /sbin/hwclock --systohc mega-cmd-server --debug-full > /var/log/megacmd/megacmd.log& dwmstatusbar& + +# Seetings of LID +while true +do + if [[ $(< /proc/acpi/button/lid/LID0/state ) = *closed ]] + then + case $(< /sys/class/power_supply/ADP0/online) in + 1) ( [[ ! "$(pidof slock)" ]] && slock ) ;; + 0) sudo pm-suspend && slock ;; + esac + fi + sleep 2 +done & + exec dbus-launch dwm