You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



System startup time on your desktop

Author (Read 6793 times)

0 Members and 1 Guest are viewing this topic.

System startup time on your desktop
« Reply #1 on: March 15, 2021, 09:06:28 PM »
 

Moltke

  • Platinum Level Poster
  • **********
  • 1134
    Posts
  • Reputation: 126
  • Linux Lite Member
    • View Profile

  • CPU: amd athlon 64 x2

  • MEMORY: 4Gb

  • VIDEO CARD: amd radeon hd 6750

  • Kernel: 5.x
Hi everyone! Hope you're all having a nice life!  :027:

I've seen many post from people asking how to reduce/improve startup time, more often than not, to give any kind of advice, they're asked to provide the output of
Code: [Select]
systemd-analyzeand according to that, troubleshoot and narrow down the possible solutions, i.e. disable some service. So, I wrote a simple script which runs that command on startup and display the output in the desktop in a gtk box using zenity.
Code: [Select]
#!/bin/bash

#Creator: Moltke
#Date: August 2020

#Summary
#Runs systemd-analyze at startup and displays a gtk message box using zenity with the output of the command
#place this script at «/usr/local/bin», make it executable and add it to your startup session, please refer to your
#desktop environment or windows manager's documentation to know how to do that, i.e in XFCE4 go to:
#startup & session, click on «startup applications» tab, next click the «add» button, browse to the script's
#location, select it and click on «close». Now on every boot you should see the message box indicating
#systemd-analyze command output in the center of your desktop.

#These variables define «width» and «height» values of the zenity gtk box, uncomment as per your convenience
#and/or add your own values if none of these work for you.

#Width: The width of the gtk box, default is 400
#width="100"
#width="200"
#width="300"
width="400"
#width="500"

#Height: The height of the gtk box, default is 160
#height="100"
#height="150"
height="160"
#height="200"
#height="250"
#height="300"
#height="350"
#height="400"

#The code
#here runs the code; once the desktop's started the script waits 5s before running
sleep 5 &
#after 5s has passed, systemd-analyze is run and its output is piped/redirected to zenity command which
#results in a gtk message box, showing how much time took your system to start displayed in the center of your screen.
#click «ok» to close.
systemd-analyze |zenity --text-info \
 --title=" " \                 #set the title to whatever you want; Startup Time, Boot Time, etc, etc ...
 --width="$width" \
 --height="$height"

Copy/paste to a file and name it whatever you want, i.e. start_up_time.sh, make it executable
Code: [Select]
chmod +x start_up_time.sh and move/copy it to /usr/local/bin.
Code: [Select]
sudo cp start_up_time.sh /usr/local/bin  Go to: startup & session, select startup applications tab, next click the add button, browse to the script's location, select it and click on close. Now on every boot you should see the message box indicating systemd-analyze's command output in the center of your desktop. Like this:



You can copy the contents to post in a thread in the forum.  :027:
« Last Edit: March 15, 2021, 09:10:44 PM by Moltke »
Without each others help there ain't no hope for us :)
Need a translation service? https://www.deepl.com/es/translator
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section