Added Oh My Posh Script.

This commit is contained in:
Andrew Schott 2024-07-02 03:51:30 -05:00
parent cdc90f83e7
commit 96a8c61f00
7 changed files with 174 additions and 108 deletions

View file

@ -1,6 +1,6 @@
#/bin/bash #/bin/bash
SERVERLIST=("shadow.schotty.com" "schotty.com" "gitlab.schotty.com" "mx.andrewschott.com") SERVERLIST=("shadow.schotty.com" "schotty.com" "matrix.schotty.com" "mx.andrewschott.com")
for i in ${SERVERLIST[*]}; do for i in ${SERVERLIST[*]}; do
echo | openssl s_client -servername $i -connect $i:443 2>/dev/null | openssl x509 -noout -subject -enddate echo | openssl s_client -servername $i -connect $i:443 2>/dev/null | openssl x509 -noout -subject -enddate

67
df.script Normal file
View file

@ -0,0 +1,67 @@
Script started on 2023-04-21 09:38:08-05:00 [TERM="xterm-256color" TTY="/dev/pts/1" COLUMNS="206" LINES="55"]
[?25l[?7l .',;::::;,'.
.';:cccccccccccc:;,.
.;cccccccccccccccccccccc;.
.:cccccccccccccccccccccccccc:.
.;ccccccccccccc;.:dddl:.;ccccccc;.
.:ccccccccccccc;OWMKOOXMWd;ccccccc:.
.:ccccccccccccc;KMMc;cc;xMMc:ccccccc:.
,cccccccccccccc;MMM.;cc;;WW::cccccccc,
:cccccccccccccc;MMM.;cccccccccccccccc:
:ccccccc;oxOOOo;MMM0OOk.;cccccccccccc:
cccccc:0MMKxdd:;MMMkddc.;cccccccccccc;
ccccc:XM0';cccc;MMM.;cccccccccccccccc'
ccccc;MMo;ccccc;MMW.;ccccccccccccccc;
ccccc;0MNc.ccc.xMMd:ccccccccccccccc;
cccccc;dNMWXXXWM0::cccccccccccccc:,
cccccccc;.:odl:.;cccccccccccccc:,.
:cccccccccccccccccccccccccccc:'.
.:cccccccccccccccccccccc:;,..
'::cccccccccccccc::;,.
andrew@fedora
-------------
OS: Fedora x86_64
Kernel: 6.2.11-300.fc38.x86_64
Uptime: 14 hours, 7 mins
Packages: 5874 (rpm), 116 (flatpak)
Shell: bash 5.2.15
Resolution: 1920x1080, 1920x1080
WM: i3
Theme: Adwaita-dark
Icons: breeze-dark
Terminal: script
CPU: Intel i7-4790K (8) @ 4.4GHz [57.0°C]
GPU: AMD ATI Radeon RX 470/480/570/570X/580/580X/590
Memory: 6463MiB / 32021MiB (20%)
        
[?25h[?7h


Oak Creek, US
.-. 46.08 (40.66) °F
( ).-. Clouds. Broken Clouds
(________) 1013hPa 72% ↗ 11.5mph
09:38 UTC-05:00

]0;andrew@fedora:~/workspace/scripts[?2004h andrew  ~  workspace  scripts     master df -H
[?2004l Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.2M 0 4.2M 0% /dev
tmpfs 17G 680M 17G 5% /dev/shm
tmpfs 6.8G 2.2M 6.8G 1% /run
/dev/sdf5 89G 47G 38G 55% /
tmpfs 17G 2.8M 17G 1% /tmp
/dev/sdf2 2.1G 1.7G 285M 86% /boot
/dev/sdf4 1.1G 19M 1.1G 2% /boot/efi
/dev/mapper/vg_home-lv_home 5.0T 3.4T 1.4T 72% /home
tmpfs 3.4G 5.5M 3.4G 1% /run/user/1000
]0;andrew@fedora:~/workspace/scripts[?2004h andrew  ~  workspace  scripts     master wait -you didnt see this^C[?2004l [?2004h[?2004l
]0;andrew@fedora:~/workspace/scripts[?2004h andrew  ~  workspace  scripts    SIGINT   master [?2004l
exit
Script done on 2023-04-21 09:38:30-05:00 [COMMAND_EXIT_CODE="130"]

81
df.timing Normal file
View file

@ -0,0 +1,81 @@
0.322490 11
0.042582 11
0.001215 1217
0.000049 15
0.002453 65
0.000107 29
0.002396 55
0.003978 68
0.002547 62
3.085176 73
0.003138 56
0.006427 70
0.008908 44
0.010719 57
0.009286 56
0.008130 54
0.009284 80
0.013403 90
0.003843 70
0.001963 118
0.001591 4
0.001450 11
0.000331 12
0.000013 6
0.786654 372
0.024058 14
0.009229 38
0.000919 8
0.000034 323
0.483844 1
0.074546 1
0.166875 1
0.419776 1
0.511529 1
0.886812 11
0.002757 594
0.008363 38
0.000796 8
0.000025 323
3.642022 1
0.202981 1
0.109831 1
0.184434 1
0.202946 1
0.170287 1
0.942797 4
0.658974 4
0.040648 4
0.039799 4
0.040754 4
0.041035 4
0.040212 1
0.040479 1
0.047654 1
0.033273 1
0.050002 1
0.033379 1
2.625550 1
0.104294 1
0.209870 1
0.092007 1
0.081686 1
0.101116 1
0.100752 1
0.216495 1
0.123001 1
0.112162 1
0.147769 1
0.102125 1
0.200884 1
0.114131 1
0.081929 1
0.121726 1
0.103010 1
0.076023 1
1.743907 19
0.000058 9
0.000081 2
0.009835 38
0.000820 388
1.166096 17

BIN
dfdemo,gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
dfdemo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

25
install_ohmyposh.sh Normal file
View file

@ -0,0 +1,25 @@
#!/bin/sh
# Notify of application launch
echo -e "Oh My Posh bash installer by Schotty.\n"
read -p "Press enter to continue"
# Warn about powerline if need be
if [ command -v powerline ] ; then
echo -e "Oh My Posh has been detected as being installed.\n"
echo -e "Oh My Posh is not compatible with powerline.\n"
echo -e "You need to remove it, if not already removed, from your :\n"
echo -e "~/.bashrc or ~/.bash_profile\n"
read -p "Press enter to continue"
fi
# Install OMP
echo -e "Installing Oh My Posh into your user account (~/.local/bin).\n"
mkdir -p ~/.local/bin/
cp ~/.bashrc ~/.bashrc.ompbackup
echo "PATH=\$PATH:~/.local/bin" >> .bashrc
curl -s https://ohmyposh.dev/install.sh | bash -s -- -d ~/.local/bin
read -p "Installing meslo font. Please configure your terminal to use 'Meslo LGM NF'. Press enter to continue."
oh-my-posh font install meslo
# Insert OMP command with stock theme into ~/.bashrc
echo "eval \"\$(oh-my-posh init bash)\"" >> ~/.bashrc

View file

@ -1,107 +0,0 @@
#!/bin/bash
# Universal updater by Andrew Schott andrew@schotty.com
# Will detect and update via various packaging formats for distros I currently use.
# Globals
# edit as needed to set colors and soforth
# presuming echo thus tput is chosen here as default\
# tput text formatting
# bold=bold dim=dimmed
# rev=reverse bel=bell sound
# smul=underline on rmul=underline off
# setaf=foreground setab=background
# sgr0=clear
#
# Colors
# 0 Black 1 Red 2 Green 3 Yellow
# 4 Blue 5 Magenta 6 Cyan 7 White
#
# Default is
# * green for a true finding
# * yellow for a false finding
# * clear at the end to resume normal output for said command's output
CMD_NOTIFY="tput rev bold setaf 7 setab 0"
CMD_TRUE="tput rev bold setaf 2 setab 0"
CMD_FALSE="tput rev bold setaf 1 setab 7"
CMD_CLEAR="tput sgr0"
echo $($CMD_NOTIFY)"Looking for native package managers"$($CMD_CLEAR)
# apt -- Debian and derivatives
if `which apt &> /dev/null 2>&1`
then
echo $($CMD_TRUE)"Found apt. Updating: ($(which apt))"$($CMD_CLEAR)
sudo apt udate -y
sudo apt upgrade -y
else
echo $($CMD_FALSE)"apt not found/needed"$($CMD_CLEAR)
fi
# dnf -- RHEL 8+, Fedora, Openmandriva, and derivatives
if `which dnf &> /dev/null 2>&1`
then
echo $($CMD_TRUE)"Found dnf. Updating: ($(which dnf))"$($CMD_CLEAR)
sudo dnf --refresh --skip-broken --nobest -y update
else
echo $($CMD_FALSE)"dnf not found/needed"$($CMD_CLEAR)
fi
# pacman -- arch & arch derivatives
if `which pacman &> /dev/null 2>&1`
then
echo $($CMD_TRUE)"Found pacman. Updating: ($(which pacman))"$($CMD_CLEAR)
sudo pacman -Syu
else
echo $($CMD_FALSE)"pacman not found/needed"$($CMD_CLEAR)
fi
# yum -- RHEL 7 > (Ignored if dnf is present)
if `which yum &> /dev/null 2>&1` && ! `which dnf &> /dev/null 2>&1`
then
echo $($CMD_TRUE)"Found yum. Updating: ($(which yum))"$($CMD_CLEAR)
sudo yum --refresh --skip-broken --nobest -y update
else
echo $($CMD_FALSE)"yum not found/needed"$($CMD_CLEAR)
fi
# urpmi -- Mageia
if `which urpmi &> /dev/null 2>&1` && ! `which dnf &> /dev/null 2>&1`
then
echo $($CMD_TRUE)"Found urpmi. Updating: ($(which urpmi))"$($CMD_CLEAR)
sudo urpmi --auto-update -y
else
echo $($CMD_FALSE)"urpmi not found/needed"$($CMD_CLEAR)
fi
# zypper -- SuSE products
if `which zypper &> /dev/null 2>&1`
then
echo $($CMD_TRUE)"Found zypper. Updating: ($(which zypper))"$($CMD_CLEAR)
sudo zypper in -y
else
echo $($CMD_FALSE)"zypper not found/needed"$($CMD_CLEAR)
fi
echo $($CMD_NOTIFY)"Looking for sandboxed package managers"$($CMD_CLEAR)
# flatpak
if `which flatpak &> /dev/null 2>&1`
then
echo $($CMD_TRUE)"Found flatpak. Updating: ($(which flatpak))"$($CMD_CLEAR)
flatpak update --user -y
sudo flatpak update -y
else
echo $($CMD_FALSE)"flatpak not found/needed"$($CMD_CLEAR)
fi
# snap
if `which snap &> /dev/null 2>&1`
then
echo $($CMD_TRUE)"Found snap. Updating: ($(which snap))"$($CMD_CLEAR)
sudo snap refresh -y
else
echo $($CMD_FALSE)"snap not found/needed"$($CMD_CLEAR)
fi