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
|
||||
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
|
||||
|
@ -14,20 +14,23 @@ Pin-Priority: 1000
|
|||
sudo apt update
|
||||
sudo apt install -y nala
|
||||
sudo nala install -y \
|
||||
xorg `# for graphics` \
|
||||
make `# for compiling gui` \
|
||||
gcc `# for compiling gui` \
|
||||
libx11-dev `# for compiling dwm` \
|
||||
libxft-dev `# for compiling dwm` \
|
||||
libxinerama-dev `# for compiling dwm` \
|
||||
libharfbuzz-dev `# for compiling st` \
|
||||
suckless-tools `# for dmenu` \
|
||||
ncdu `# for disk usage analysys` \
|
||||
xorg `# for graphics` \
|
||||
make `# for compiling gui` \
|
||||
gcc `# for compiling gui` \
|
||||
libx11-dev `# for compiling dwm` \
|
||||
libxft-dev `# for compiling dwm` \
|
||||
libxinerama-dev `# for compiling dwm` \
|
||||
libharfbuzz-dev `# for compiling st` \
|
||||
suckless-tools `# for dmenu` \
|
||||
ncdu `# for disk usage analysys` \
|
||||
brightnessctl `# for keyboard backlight` \
|
||||
xcompmgr `# for st opacity` \
|
||||
telegram-desktop \
|
||||
slack \
|
||||
xfe `# classic file manager` \
|
||||
surf `# suckless browser` \
|
||||
firefox
|
||||
xfe `# classic file manager` \
|
||||
surf `# suckless browser` \
|
||||
firefox \
|
||||
python3
|
||||
|
||||
|
||||
|
||||
|
@ -41,27 +44,40 @@ then
|
|||
git clone https://git.digitalstudium.com/digitalstudium/ubuntu-gui ~/gui
|
||||
fi
|
||||
|
||||
# compiling dwm
|
||||
if ! command -v dwm &> /dev/null
|
||||
for tool in dwm st sent
|
||||
do
|
||||
# compiling dwm
|
||||
if ! command -v $tool &> /dev/null
|
||||
then
|
||||
cd ~/gui/$tool
|
||||
sudo make install clean
|
||||
cd -
|
||||
fi
|
||||
done
|
||||
|
||||
echo dwm > ~/.xinitrc # for starting dwm when startx
|
||||
|
||||
for tool in create_systemd_service.py create_systemd_timer.py set_brightness.sh update_gui.sh
|
||||
do
|
||||
if ! command -v $tool &> /dev/null
|
||||
then
|
||||
sudo cp $tool /usr/local/bin
|
||||
fi
|
||||
done
|
||||
|
||||
git config --global user.name "Digital Studium"
|
||||
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
|
||||
cd ~/gui/dwm
|
||||
sudo make install clean
|
||||
cd -
|
||||
echo dwm > ~/.xinitrc # for starting dwm when startx
|
||||
mkdir $HOME/.dwm
|
||||
fi
|
||||
|
||||
# compiling st
|
||||
if ! command -v st &> /dev/null
|
||||
then
|
||||
cd ~/gui/st
|
||||
sudo make install clean
|
||||
cd -
|
||||
fi
|
||||
|
||||
# compiling sent
|
||||
if ! command -v sent &> /dev/null
|
||||
then
|
||||
cd ~/gui/sent
|
||||
sudo make install clean
|
||||
cd -
|
||||
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