Add date, hostname, space, username plugins

This commit is contained in:
Ceda EI 2019-02-16 14:48:57 +05:30
parent 0a6695dbce
commit 7b7e165700
4 changed files with 65 additions and 0 deletions

17
plugins/date.sh Normal file
View File

@ -0,0 +1,17 @@
function wish_date_start() {
return 0
}
function wish_date_end() {
return 0
}
function wish_date_set_colors() {
WISH_DATE_FG=${WISH_DATE_FG:-$WISH_DEFAULT_FG}
WISH_DATE_BG=${WISH_DATE_BG:-$WISH_DEFAULT_BG}
}
function wish_date_main() {
local date_format=${WISH_DATE_FORMAT:-"%F %T"}
wish_append $WISH_DATE_BG $WISH_DATE_FG " $(date "+$date_format") "
}

16
plugins/hostname.sh Normal file
View File

@ -0,0 +1,16 @@
function wish_hostname_start() {
return 0
}
function wish_hostname_end() {
return 0
}
function wish_hostname_set_colors() {
WISH_HOSTNAME_FG=${WISH_HOSTNAME_FG:-$WISH_DEFAULT_FG}
WISH_HOSTNAME_BG=${WISH_HOSTNAME_BG:-$WISH_DEFAULT_BG}
}
function wish_hostname_main() {
wish_append $WISH_HOSTNAME_BG $WISH_HOSTNAME_FG " \h "
}

16
plugins/space.sh Normal file
View File

@ -0,0 +1,16 @@
function wish_space_start() {
return 0
}
function wish_space_end() {
return 1
}
function wish_space_set_colors() {
WISH_SPACE_BG=-1
WISH_SPACE_FG=-1
}
function wish_space_main() {
wish_append -1 -1 " "
}

16
plugins/username.sh Normal file
View File

@ -0,0 +1,16 @@
function wish_username_start() {
return 0
}
function wish_username_end() {
return 0
}
function wish_username_set_colors() {
WISH_USERNAME_FG=${WISH_USERNAME_FG:-$WISH_DEFAULT_FG}
WISH_USERNAME_BG=${WISH_USERNAME_BG:-$WISH_DEFAULT_BG}
}
function wish_username_main() {
wish_append $WISH_USERNAME_BG $WISH_USERNAME_FG " \u "
}