diff options
author | P. J. McDermott <pj@pehjota.net> | 2018-06-15 00:54:52 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2018-06-15 00:54:52 (EDT) |
commit | 4b3cc70554cd45aba2c4b3cee6a36a7e64512d1c (patch) | |
tree | 829e1eef7a2e6f8e7119cc0f0ab2f72fd3ce2e32 /bin/xsession | |
parent | 3283e2189c57074107d4a58956335b5e567187c6 (diff) | |
download | fluxbox-4b3cc70554cd45aba2c4b3cee6a36a7e64512d1c.zip fluxbox-4b3cc70554cd45aba2c4b3cee6a36a7e64512d1c.tar.gz fluxbox-4b3cc70554cd45aba2c4b3cee6a36a7e64512d1c.tar.bz2 |
bin/xsession: Add column headings to sessions list
Diffstat (limited to 'bin/xsession')
-rwxr-xr-x | bin/xsession | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/bin/xsession b/bin/xsession index 9b985f6..4166354 100755 --- a/bin/xsession +++ b/bin/xsession @@ -3,16 +3,21 @@ set -eu actions_icons='/usr/share/icons/gnome/16x16/actions' -awk_who_script=' +awk_who=' BEGIN { display_ere = " [(]" display "[)]$"; printed = 0; } - { + NR == 1 { + headings = $0; + } + NR > 1 { if (!match($0, display_ere)) { if (!printed) { print("\n\nThe following sessions will be " \ "hung up:\n"); + print("<tt><small> " headings \ + "</small></tt>"); printed = 1; } print("<tt><small> " $0 "</small></tt>"); @@ -35,8 +40,8 @@ do_shutdown() { zenity --question --title='Shut Down' \ --window-icon="${actions_icons}/system-shutdown.png" \ - --text="Are you sure you want to shut down this system?$(who | \ - awk -v "display=${DISPLAY}" "${awk_who_script}")" \ + --text="Are you sure you want to shut down this system?$(\ + who -H | awk -v "display=${DISPLAY}" "${awk_who}")" \ --ok-label='Shut Down' --cancel-label='Cancel' && \ sudo shutdown -hP now @@ -47,8 +52,8 @@ do_reboot() { zenity --question --title='Reboot' \ --window-icon="${actions_icons}/system-shutdown.png" \ - --text="Are you sure you want to reboot this system?$(who | \ - awk -v "display=${DISPLAY}" "${awk_who_script}")" \ + --text="Are you sure you want to reboot this system?$(\ + who -H | awk -v "display=${DISPLAY}" "${awk_who}")" \ --ok-label='Reboot' --cancel-label='Cancel' && \ sudo reboot |