Skip to content

Commit

Permalink
fix(fish): motd last login ip address
Browse files Browse the repository at this point in the history
  • Loading branch information
kyau committed Feb 6, 2024
1 parent 432d28a commit 3a3e9a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
13 changes: 4 additions & 9 deletions config/fish/motd.fish
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ANSI
set -l _fish_hostname (cat /proc/sys/kernel/hostname | cut -d '.' -f 1)
set -g ANSI $HOME/dot/ansi/$_fish_hostname.ans
set -g _SSL_DOMAINS "kyau.net" "kyau.org" "kyaulabs.com" "voidbbs.com"
set -g _SSL_DOMAINS "hexforged.com" "kyau.net" "kyau.org" "kyaulabs.com" "voidbbs.com"
set -g _SERVICES "docker" "libvirtd" "mariadb" "nginx" "nftables" "php-fpm" "sshd" "unbound" "unrealircd"

# Padding/Remove Color {{{
Expand Down Expand Up @@ -228,16 +228,11 @@ printf " \\x1b[38;5;235m│\\x1b[38;5;237m░░░ \\x1b[38;5;242muptime\\x1b[3
printf " \\x1b[38;5;235m└─────────────────────────────────────────────·─\\x1b[38;5;242m─\\x1b[1;39m·─\\x1b[38;5;242m─\\x1b[1;39m─\\x1b[38;5;242m──────\\x1b[38;5;255m┘\\x1b[0m\\n"
_motd_sysinfo
set -l _lastlog_ip
set -l _lastlog (string split " " (lastlog -u $USER | sed -n 's/ */ /gp' | sed -n 2p))
if test (count $_lastlog) = 8
set _lastlog_ip "localhost"
else
set _lastlog_ip $_lastlog[3]
end
#set -l _lastlog (lastlog -u $USER | sed -n 2p | tr -s ' ' | cut -d ' ' -f4-)
set -l _lastlog (string split " " (last -1 -w | sed -n 's/ */ /gp' | sed -n 1p))
set _lastlog_ip $_lastlog[3]
printf " \\x1b[38;5;244mlast\\x1b[0m\\x1b[38;5;240m/%s\\x1b[0m\\n\\n" "$_lastlog_ip"
_motd_services
if test $HOSTNAME = "web.kyaulabs"
if test $HOSTNAME = "orbit.kyaulabs"
or test $HOSTNAME = "baal.kyaulabs"
_motd_ssl
end
Expand Down
8 changes: 5 additions & 3 deletions config/htop/htoprc
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
htop_version=3.2.1
htop_version=3.2.2
config_reader_min_version=3
fields=0 48 17 18 38 39 40 2 46 47 49 1
hide_kernel_threads=1
hide_userland_threads=1
hide_running_in_container=0
shadow_distribution_path_prefix=0
shadow_other_users=0
show_thread_names=0
show_program_path=1
Expand Down Expand Up @@ -36,7 +38,7 @@ column_meters_0=LeftCPUs2 Blank Hostname Uptime Tasks Battery
column_meter_modes_0=1 2 2 1 2 2
column_meters_1=RightCPUs2 CPU Blank LoadAverage Memory Swap
column_meter_modes_1=1 1 2 2 1 1
tree_view=1
tree_view=0
sort_key=46
tree_sort_key=0
sort_direction=-1
Expand All @@ -46,7 +48,7 @@ all_branches_collapsed=0
screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command
.sort_key=PERCENT_CPU
.tree_sort_key=PID
.tree_view=1
.tree_view=0
.tree_view_always_by_pid=0
.sort_direction=-1
.tree_sort_direction=1
Expand Down

0 comments on commit 3a3e9a0

Please sign in to comment.