You are not logged in.

#1 2019-06-23 03:37:19

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 243

[Solved] Throbber for use with customised /etc/issue

I have  customised /etc/issue to create a personalised login screen and am trying to spice it up with a simple text throbber which is launched from $HOME/.bash_profile.

#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

# Added by me to launch ny text based throbber
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]] && [[ $XDG_SESSION_TYPE = tty ]]; then
  "/usr/local/bin/EtcIssueThrobber" &
fi

# Added by me to launch gnome-shell (see https://wiki.archlinux.org/index.php/GNOME#Wayland_sessions)
# Redirected stndout and stnderror so as not to interfere with throbber
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]] && [[ $XDG_SESSION_TYPE = tty ]]; then
  QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session gnome-session > /dev/null 2>&1
fi

And the throbber is:

#!/bin/bash

# Throbber for use with /etc/issue logon prompt

source TerminalTricks

echo
for i in {1..75} ; do
    printf "${Red}#${End}"
    sleep 0.3
done
printf "\n\n"

Everything works, (up to a point,) without any errors or catastrophes showing up in the logs. But, unfortunately, only the first hash-mark is displayed while I am waiting on the gnome shell to fully launch.

Setting up a simulation test on my gnome-terminal:

#!/bin/bash

# Throbber test disown

source TerminalTricks

/usr/local/bin/EtcIssueThrobber &

gnome-terminal > /dev/null 2>&1

I get the following output:

[stupidme@mine ~]$ '/home/stupidme/Documents/InstallNotes/Throbber/ThrobberDisownTest' 

#[stupidme@mine ~]$ ##########################################################################


[stupidme@mine ~]$ 

This leads me to believe that it may be something to do with: After the first hash-mark is printed the gnome shell has set the $DISPLAY to something other than null, redirected $(tty) away from dev/tty1 and/or the $XDG_SESSION_TYPE is now Wayland.

Is the case? If so, is there an  easy way of keeping the output from my EtcIssueThrobber on tty1?

Irvine

edited spelling

Last edited by IrvineHimself (2019-06-23 04:19:31)


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#2 2019-06-23 04:13:51

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 243

Re: [Solved] Throbber for use with customised /etc/issue

Well, I have found a solution which is to redirect with tee
for example:

for i in {1..75} ; do
    printf "${Red}#${End}" > /dev/tty1
    sleep 0.05
done

Since sleep waits for a command to finish,  the throbber appears to pause. So, a minor cosmetic improvement is to speed up the interval, this has the effect of making the throbber more obvious smile

If anybody can think of any improvements or criticisms, I would love to hear them
Irvine

Edited to make it a simple redirect, (brain wasn't fully engaged when I thought about redirecting the output with 'tee')

Last edited by IrvineHimself (2019-06-23 10:09:12)


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

Board footer

Powered by FluxBB