Fix autostart
This commit is contained in:
parent
1c5ac00543
commit
41d2bc2a31
|
@ -1,4 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
# ubuntu hangs if network interface is not optional
|
# ubuntu hangs if network interface is not optional
|
||||||
sudo sed -i '/dhcp4/a\ optional: yes' /etc/netplan/00-installer-config-wifi.yaml
|
sudo sed -i '/dhcp4/a\ optional: yes' /etc/netplan/00-installer-config-wifi.yaml
|
||||||
sudo sed -i '/dhcp4/a\ optional: yes' /etc/netplan/00-installer-config.yaml
|
sudo sed -i '/dhcp4/a\ optional: yes' /etc/netplan/00-installer-config.yaml
|
||||||
|
@ -23,11 +23,14 @@ libxinerama-dev `# for compiling dwm` \
|
||||||
libharfbuzz-dev `# for compiling st` \
|
libharfbuzz-dev `# for compiling st` \
|
||||||
suckless-tools `# for dmenu` \
|
suckless-tools `# for dmenu` \
|
||||||
ncdu `# for disk usage analysys` \
|
ncdu `# for disk usage analysys` \
|
||||||
|
brightnessctl `# for keyboard backlight` \
|
||||||
|
xcompmgr `# for st opacity` \
|
||||||
telegram-desktop \
|
telegram-desktop \
|
||||||
slack \
|
slack \
|
||||||
xfe `# classic file manager` \
|
xfe `# classic file manager` \
|
||||||
surf `# suckless browser` \
|
surf `# suckless browser` \
|
||||||
firefox
|
firefox \
|
||||||
|
python3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,27 +44,40 @@ then
|
||||||
git clone https://git.digitalstudium.com/digitalstudium/ubuntu-gui ~/gui
|
git clone https://git.digitalstudium.com/digitalstudium/ubuntu-gui ~/gui
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for tool in dwm st sent
|
||||||
|
do
|
||||||
# compiling dwm
|
# compiling dwm
|
||||||
if ! command -v dwm &> /dev/null
|
if ! command -v $tool &> /dev/null
|
||||||
then
|
then
|
||||||
cd ~/gui/dwm
|
cd ~/gui/$tool
|
||||||
sudo make install clean
|
sudo make install clean
|
||||||
cd -
|
cd -
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
echo dwm > ~/.xinitrc # for starting dwm when startx
|
echo dwm > ~/.xinitrc # for starting dwm when startx
|
||||||
fi
|
|
||||||
|
|
||||||
# compiling st
|
for tool in create_systemd_service.py create_systemd_timer.py set_brightness.sh update_gui.sh
|
||||||
if ! command -v st &> /dev/null
|
do
|
||||||
|
if ! command -v $tool &> /dev/null
|
||||||
then
|
then
|
||||||
cd ~/gui/st
|
sudo cp $tool /usr/local/bin
|
||||||
sudo make install clean
|
|
||||||
cd -
|
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# compiling sent
|
git config --global user.name "Digital Studium"
|
||||||
if ! command -v sent &> /dev/null
|
git config --global user.email "digitalstudium001@gmail.com"
|
||||||
|
|
||||||
|
sudo create_systemd_service.py gui-updater /usr/local/bin/update_gui.sh
|
||||||
|
sudo create_systemd_timer.py gui-updater '*-*-* *:*:*'
|
||||||
|
|
||||||
|
if [ ! -d ~/.dwm ]
|
||||||
then
|
then
|
||||||
cd ~/gui/sent
|
mkdir $HOME/.dwm
|
||||||
sudo make install clean
|
|
||||||
cd -
|
|
||||||
fi
|
fi
|
||||||
|
echo "firefox &" > $HOME/.dwm/autostart.sh
|
||||||
|
echo "xcompmgr &" >> $HOME/.dwm/autostart.sh
|
||||||
|
echo "telegram-desktop &" >> $HOME/.dwm/autostart.sh
|
||||||
|
echo "st &" >> $HOME/.dwm/autostart.sh
|
||||||
|
echo "DISPLAY=:0 xhost +local:" >> $HOME/.dwm/autostart.sh # give permissions to display
|
||||||
|
chmod +x $HOME/.dwm/autostart.sh
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
H=$(date +%k)
|
||||||
|
|
||||||
|
if (( $H >= 0 && $H <= 7 )); then
|
||||||
|
/usr/bin/xrandr --output eDP --brightness .2
|
||||||
|
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 3
|
||||||
|
elif (( $H > 7 && $H <= 10 )); then
|
||||||
|
/usr/bin/xrandr --output eDP --brightness .5
|
||||||
|
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 1
|
||||||
|
elif (( $H > 10 && $H <= 19 )); then
|
||||||
|
/usr/bin/xrandr --output eDP --brightness .7
|
||||||
|
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 0
|
||||||
|
elif (( $H > 19 && $H <= 22 )); then
|
||||||
|
/usr/bin/xrandr --output eDP --brightness .5
|
||||||
|
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 1
|
||||||
|
elif (( $H > 22 && $H <= 23 )); then
|
||||||
|
/usr/bin/xrandr --output eDP --brightness .3
|
||||||
|
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 2
|
||||||
|
else
|
||||||
|
echo "Error"
|
||||||
|
fi
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
export DISPLAY=:0
|
||||||
|
set_brightness.sh # set monitor brightness
|
||||||
|
battery_capacity=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||||
|
MEM=$(free -h --kilo | awk '/^Mem:/ {print $3 "/" $2}')
|
||||||
|
CPU=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}' )
|
||||||
|
DISK=$(df -Ph | grep "/dev/mapper/ubuntu--vg-ubuntu--lv" | awk {'print $5'})
|
||||||
|
|
||||||
|
/usr/bin/xsetroot -name "$battery_capacity% `date +"%a %d.%m %H:%M"`; $MEM $CPU% $DISK" # set systray
|
Loading…
Reference in New Issue