2 новым установкам Ubuntu Server 20.04 (1 на Hyper-V 1 на голом железе) не удается правильно запустить интерфейс моста во время загрузки. Запуск netplan apply вручную успешно запустит мост (это в настоящее время находится в crontab во время загрузки в качестве обходного пути).
Считает, что шлюз на мосту применяется до того, как IP-адрес применен, или оператор связи работает и, таким образом, Ошибка - чисто спекуляция, но, учитывая, что она работает нормально, когда применяется постзагрузка, определенно похоже на какое-то условие гонки.
Любая помощь будет оценена. Конфигурация netplan и результаты ниже.
/ etc / netplan / 50 netinit-конфигурации. и автоматически переключаются в «легкий» режим на рассвете.
Для GNOME существует такое расширение оболочки: Night Theme Switcher
Оно имеет довольно много опций и уже работает из коробки, без необходимости что-либо настраивать, но конфигурация также проста!
The terminal command for changing theme is gsettings set org.gnome.desktop.interface gtk-theme Yaru-dark
for dark theme, and gsettings set org.gnome.desktop.interface gtk-theme Yaru-light
for light theme.
Now, there's something called CronJobs for scheduling jobs (basically executing something, repeatedly at specific time). So, you can write a cronjob to execute these commands at specified times (something like change to dark theme at 9 pm and light theme at 6 am).
Add the following to a file named script.sh:
#!/bin/bash
echo export DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS > lightscript.sh
echo export DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS > darkscript.sh
echo "gsettings set org.gnome.desktop.interface gtk-theme Yaru-light" >> lightscript.sh
echo "gsettings set org.gnome.desktop.interface gtk-theme Yaru-dark" >> darkscript.sh
chmod 755 lightscript.sh
chmod 755 darkscript.sh
currenttime=$(date +%H:%M)
if [[ "$currenttime" > "21:00" ]] || [[ "$currenttime" < "06:00" ]]; then
./darkscript.sh
else
./lightscript.sh
fi
Make the file executable: chmod 755 /path/to/script.sh
or chmod +x /path/to/script.sh
Enter gnome-session-properties
in terminal. Add a new start up program by clicking add on right side and selecting script.sh file by browsing and save it with some name and comment. This will tell gnome to create lightscript.sh and darkscript.sh whenever you login through GUI.
Add your job (change theme) to crontab by using the command crontab -e
and choosing suitable editor (or you can go to /var/spool/cron/crontabs and edit the file with your username, accessing the file this way requires sudo privileges). Add the two lines (with /path/to/
replaced by actual path):
0 6 * * * /path/to/lightscript.sh
0 21 * * * /path/to/darkscript.sh
It says crontab: installing new crontab
after exiting the command. You can also check with crontab -l
. This should do it. The above two lines tell cron to execute lightscript.sh at 6:00 am and darkscript.sh at 9:00 pm everyday.
We are taking this detour instead of just adding 0 6 * * * gsettings set org.gnome.desktop.interface gtk-theme Yaru-light
to crontab because this requires the DBUS_SESSION_BUS_ADDRESS
variable to be set correctly.