Fix issue where livesession is updated automatically, tidy init scripts

This commit is contained in:
natemaia 2018-05-12 11:00:19 -07:00
parent 14637331e0
commit 34ef33b9a9
8 changed files with 35 additions and 49 deletions

View File

@ -4,11 +4,13 @@
# for any user being created from /etc/skel # for any user being created from /etc/skel
# only after a valid internet connection is made # only after a valid internet connection is made
do_setup() { keys=(
keys=("AEFB411B072836CD48FF0381AE252C284B5DBA5D" "AEFB411B072836CD48FF0381AE252C284B5DBA5D"
"9E4F11C6A072942A7B3FD3B0B81EB14A09A25EB0" "9E4F11C6A072942A7B3FD3B0B81EB14A09A25EB0"
"35F52A02854DCCAEC9DD5CC410443C7F54B00041" "35F52A02854DCCAEC9DD5CC410443C7F54B00041"
) )
setup() {
sudo dirmngr </dev/null sudo dirmngr </dev/null
sudo pacman-key --init sudo pacman-key --init
sudo pacman-key --populate archlinux sudo pacman-key --populate archlinux
@ -20,10 +22,9 @@ do_setup() {
fi fi
done done
sudo pacman-key --populate archlabs sudo pacman-key --populate archlabs
sudo pacman -Syyu --noconfirm
} }
sleep 2 sleep 1
if grep -qi 'hypervisor' <<< "$(dmesg)"; then if grep -qi 'hypervisor' <<< "$(dmesg)"; then
$(grep "nitrogen" $HOME/config/openbox/autostart) $(grep "nitrogen" $HOME/config/openbox/autostart)
$(grep "polybar" $HOME/.config/openbox/autostart | sed 's/sleep 1; //g') $(grep "polybar" $HOME/.config/openbox/autostart | sed 's/sleep 1; //g')
@ -33,6 +34,6 @@ while ! ping -c1 8.8.8.8 &>/dev/null; do
sleep 1 sleep 1
done done
do_setup setup
sed -i '/keypack/d' "$HOME/.config/openbox/autostart" sed -i '/keypack/d' "$HOME/.config/openbox/autostart"
rm -f "$HOME/.config/keypack" rm -f "$HOME/.config/keypack"

View File

@ -11,9 +11,6 @@ nitrogen --restore &
# start panel # start panel
sleep 1; polybar --config=/home/liveuser/.config/polybar/config openbox-bar & sleep 1; polybar --config=/home/liveuser/.config/polybar/config openbox-bar &
# system tray
sleep 1; trayer --edge bottom --align left --widthtype request --SetDockType false --expand true &
# Openbox autostart # Openbox autostart
ob-autostart -d & ob-autostart -d &

View File

@ -3,12 +3,3 @@
# To set your language for displaying messages and time/date formats, use the following: # To set your language for displaying messages and time/date formats, use the following:
# LANG=en_US.UTF8 # LANG=en_US.UTF8
# xdg-open applications
# export XDG_CURRENT_DESKTOP=XFCE
# export DE="xfce"
# # dbus with openbox
# if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
# eval "$(dbus-launch --sh-syntax --exit-with-session)"
# fi

View File

@ -168,7 +168,7 @@ format = <label>
;;;;;;;;; ;;;;;;;;;
[module/coreuse] [module/coreuse]
type = internal/cpu type = internal/cpu
interval = 1 interval = 3
format-padding = 1 format-padding = 1
format = <label><ramp-coreload> format = <label><ramp-coreload>
label = %{A1:termite --exec=htop & disown:} %percentage%% %{A} label = %{A1:termite --exec=htop & disown:} %percentage%% %{A}

View File

@ -14,9 +14,6 @@ files=(
"$HOME/.mozilla/firefox/archlabs.default/sessionstore.js" "$HOME/.mozilla/firefox/archlabs.default/sessionstore.js"
) )
for f in "${files[@]}"; do for f in "${files[@]}"; do sed -i "s/liveuser/${USER}/g" "$f"; done
sed -i "s/liveuser/${USER}/g" "$f"
done
sed -i '/setup/d' "$HOME/.config/openbox/autostart" sed -i '/setup/d' "$HOME/.config/openbox/autostart"
rm -f "$HOME/.config/setup" rm -f "$HOME/.config/setup"

View File

@ -3,8 +3,8 @@
# sourced at boot by xinit # sourced at boot by xinit
[ -d "/sbin" ] && PATH="$PATH:/sbin" [ -d /sbin ] && PATH="$PATH:/sbin"
[ -d "/usr/sbin" ] && PATH="$PATH:/usr/sbin" [ -d /usr/sbin ] && PATH="$PATH:/usr/sbin"
[ -d "$HOME/bin" ] && PATH="$HOME/bin:$PATH" [ -d ~/bin ] && PATH="$HOME/bin:$PATH"
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"

View File

@ -9,9 +9,9 @@ while true; do
if ping -c1 8.8.8.8 &>/dev/null; then if ping -c1 8.8.8.8 &>/dev/null; then
ID=$(ip link | awk '/state UP/ {print $2}') ID=$(ip link | awk '/state UP/ {print $2}')
if [[ $ID == e* ]]; then if [[ $ID == e* ]]; then
echo "$ethernet_connected" ; sleep 10 echo "$ethernet_connected" ; sleep 20
else else
echo "$wireless_connected" ; sleep 10 echo "$wireless_connected" ; sleep 20
fi fi
else else
echo "$disconnected" ; sleep 0.6 echo "$disconnected" ; sleep 0.6

View File

@ -3,33 +3,33 @@
BAR_ICON="" BAR_ICON=""
ICON=/usr/share/icons/gnome/32x32/apps/system-software-update.png ICON=/usr/share/icons/gnome/32x32/apps/system-software-update.png
total() { UPD=$(checkupdates | wc -l) ;}
while true; do while true; do
updates=$(checkupdates | wc -l) total
if hash notify-send &>/dev/null; then if hash notify-send &>/dev/null; then
if [[ $updates -gt 50 ]]; then if [[ $UPD -gt 50 ]]; then
notify-send -u critical -i $ICON \ notify-send -u critical -i $ICON "You really need to update!!" "$UPD New packages"
"You really need to update soon!!" "$updates New package updates" elif [[ $UPD -gt 25 ]]; then
elif [[ $updates -gt 25 ]]; then notify-send -u normal -i $ICON "You should update soon" "$UPD New packages"
notify-send -u normal -i $ICON \ elif [[ $UPD -gt 2 ]]; then
"You should update soon" "$updates New package updates" notify-send -u low -i $ICON "$UPD New packages"
elif [[ $updates -gt 2 ]]; then
notify-send -u low -i $ICON "$updates New package updates"
fi fi
fi fi
while [[ $updates -gt 0 ]]; do while [[ $UPD -gt 0 ]]; do
if [[ $updates -eq 1 ]]; then if [[ $UPD -eq 1 ]]; then
echo "$updates Update" echo "$UPD Update"
elif [[ $updates -gt 1 ]]; then elif [[ $UPD -gt 1 ]]; then
echo "$updates Updates" echo "$UPD Updates"
fi fi
sleep 8 sleep 10
updates=$(checkupdates | wc -l) total
done done
while [[ $updates -eq 0 ]]; do while [[ $UPD -eq 0 ]]; do
echo $BAR_ICON echo $BAR_ICON
sleep 1600 sleep 1800
updates=$(checkupdates | wc -l) total
done done
done done