Compare commits
10 Commits
4b2490c4aa
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a18dfd678a | |||
| 696bacb597 | |||
| 109bf0f93b | |||
| 844c10948b | |||
| 28f98a23d6 | |||
| 16194ce20f | |||
| 524bdf030d | |||
| 88ccccdb50 | |||
| f2f34750ac | |||
| 8e5ea523b2 |
3
Makefile
3
Makefile
@@ -2,6 +2,7 @@ BUILD_COMMIT = $(shell git rev-parse HEAD)
|
|||||||
BASE_IMAGE = registry.fedoraproject.org/fedora-toolbox
|
BASE_IMAGE = registry.fedoraproject.org/fedora-toolbox
|
||||||
BASE_IMAGE_VERSION = $(shell cat /etc/os-release | grep VERSION_ID | cut -d = -f 2)
|
BASE_IMAGE_VERSION = $(shell cat /etc/os-release | grep VERSION_ID | cut -d = -f 2)
|
||||||
REPOSITORY = localhost/toolbox-dev-env
|
REPOSITORY = localhost/toolbox-dev-env
|
||||||
|
STARSHIP_COLOR = $(shell cat starship.$(HOSTNAME).color)
|
||||||
|
|
||||||
.PHONY: container
|
.PHONY: container
|
||||||
container:
|
container:
|
||||||
@@ -29,5 +30,7 @@ scripts:
|
|||||||
cp bashrc.sh ~/.bashrc
|
cp bashrc.sh ~/.bashrc
|
||||||
cp inputrc ~/.inputrc
|
cp inputrc ~/.inputrc
|
||||||
cp starship.toml ~/.config/starship.toml
|
cp starship.toml ~/.config/starship.toml
|
||||||
|
sed -i "s/#XXXXXX/$(STARSHIP_COLOR)/g" ~/.config/starship.toml
|
||||||
|
|
||||||
install: container scripts;
|
install: container scripts;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
function set_window_title() {
|
function set_window_title() {
|
||||||
if [ "${PWD}" == "$PROJECTS_DIR/*" ]; then
|
if [[ "${PWD}" == $PROJECTS_PATH/* ]]; then
|
||||||
echo -ne "\033]0; Toolbox: Development \007"
|
echo -ne "\033]0; Project: $(basename ${PWD}) \007"
|
||||||
else
|
else
|
||||||
echo -ne "\033]0; $LOCATION \007"
|
echo -ne "\033]0; $LOCATION \007"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ function dev() {
|
|||||||
echo "WARNING: Missing project name";
|
echo "WARNING: Missing project name";
|
||||||
project=""
|
project=""
|
||||||
else
|
else
|
||||||
project="${2}"
|
project="${1}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f '/run/.toolboxenv' ]; then
|
if [ -f '/run/.toolboxenv' ]; then
|
||||||
cd "${PROJECTS_DIR}/${project}";
|
cd "${PROJECTS_PATH}/${project}";
|
||||||
|
|
||||||
if [ -f "${PWD}/ansible.cfg" ]; then
|
if [ -f "${PWD}/ansible.cfg" ]; then
|
||||||
export ANSIBLE_CONFIG="${PWD}/ansible.cfg";
|
export ANSIBLE_CONFIG="${PWD}/ansible.cfg";
|
||||||
@@ -19,7 +19,7 @@ function dev() {
|
|||||||
if [ -f "${PWD}/pyproject.toml" ]; then
|
if [ -f "${PWD}/pyproject.toml" ]; then
|
||||||
poetry_venv=$(poetry env info --path)
|
poetry_venv=$(poetry env info --path)
|
||||||
|
|
||||||
if [ ! -z "${poetry_venv}" ]; then
|
if [ ! -z "${poetry_venv}" ] && [ -f "${poetry_venv}/bin/activate" ]; then
|
||||||
source "${poetry_venv}/bin/activate";
|
source "${poetry_venv}/bin/activate";
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -40,7 +40,7 @@ function dev() {
|
|||||||
echo ">>> ${PWD}"
|
echo ">>> ${PWD}"
|
||||||
toolbox enter "${container_name}"
|
toolbox enter "${container_name}"
|
||||||
echo ">>> Exited: ${container_name}"
|
echo ">>> Exited: ${container_name}"
|
||||||
cd ${current}
|
cd "${current}"
|
||||||
|
|
||||||
podman container stop "${container_name}" &>/dev/null
|
podman container stop "${container_name}" &>/dev/null
|
||||||
podman container rm --force "${container_name}" &>/dev/null
|
podman container rm --force "${container_name}" &>/dev/null
|
||||||
@@ -48,7 +48,8 @@ function dev() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if [ -f '/run/.toolboxenv' ]; then
|
if [ -f '/run/.toolboxenv' ]; then
|
||||||
if [ "${PWD}" == "$PROJECTS_PATH/*" ]; then
|
if [[ "${PWD}" == $PROJECTS_PATH/* ]]; then
|
||||||
dev $(basename "${PWD}")
|
dev $(basename "${PWD}")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
1
starship.discovery.color
Normal file
1
starship.discovery.color
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#893937
|
||||||
@@ -1,19 +1,20 @@
|
|||||||
add_newline = false
|
add_newline = false
|
||||||
|
|
||||||
format = '${custom.toolbox}${custom.localhost}[](bold fg:#01568e bg:#000000)$directory$python$git_branch$git_status$status$character'
|
format = '[ ](bold fg:#000000 bg:#XXXXXX)${custom.toolbox}${custom.localhost}[](bold fg:#XXXXXX bg:#444444)$directory$python$git_branch$git_status$status$character'
|
||||||
|
|
||||||
[directory]
|
[directory]
|
||||||
format = "[](fg:#000000 bg:#444444)[$read_only]($read_only_style)[$path ]($style)[](fg:#444444 bg:#000000)"
|
format = "[$read_only]($read_only_style)[$path ]($style)[](fg:#444444 bg:#000000)"
|
||||||
style = "fg:bright-white bg:#444444"
|
style = "fg:bright-white bg:#444444"
|
||||||
read_only = ''
|
read_only = ' '
|
||||||
read_only_style = "bold fg:bright-red bg:#444444"
|
read_only_style = "bold fg:red bg:#444444"
|
||||||
truncation_symbol = ' '
|
truncation_symbol = ' '
|
||||||
home_symbol = ''
|
home_symbol = '~'
|
||||||
[directory.substitutions]
|
[directory.substitutions]
|
||||||
'/' = ' '
|
'/' = ' '
|
||||||
|
'~ ' = ''
|
||||||
|
|
||||||
[character]
|
[character]
|
||||||
success_symbol = ''
|
success_symbol = '[](bold fg:#000000)'
|
||||||
error_symbol = '[](bold fg:#6d0505)'
|
error_symbol = '[](bold fg:#6d0505)'
|
||||||
|
|
||||||
[status]
|
[status]
|
||||||
@@ -34,15 +35,15 @@ format = '([](bold fg:#000000 bg:#f4862c)[$all_status$ahead_behind]($style)[
|
|||||||
|
|
||||||
[python]
|
[python]
|
||||||
style = 'bold bg:#fcf52a fg:black'
|
style = 'bold bg:#fcf52a fg:black'
|
||||||
symbol = ''
|
symbol = ''
|
||||||
format = '[](bold fg:#000000 bg:#fcf52a)[$symbol( $virtualenv)]($style)[](bold bg:#000000 fg:#fcf52a)'
|
format = '([](bold fg:#000000 bg:#fcf52a)[$virtualenv]($style)[](bold bg:#000000 fg:#fcf52a))'
|
||||||
|
|
||||||
[custom.toolbox]
|
[custom.toolbox]
|
||||||
style = "bold bg:#01568e fg:bright-white"
|
style = "bold bg:#XXXXXX fg:bright-white"
|
||||||
command = "echo -ne 'toolbox '"
|
command = "echo -ne ' toolbox'"
|
||||||
when = '[ -f /run/.toolboxenv ]'
|
when = '[ -f /run/.toolboxenv ]'
|
||||||
|
|
||||||
[custom.localhost]
|
[custom.localhost]
|
||||||
style = "bold bg:#01568e fg:bright-white"
|
style = "bold bg:#XXXXXX fg:bright-white"
|
||||||
command = "echo -ne $HOSTNAME "
|
command = 'echo -ne " $HOSTNAME"'
|
||||||
when = '[ ! -f /run/.toolboxenv ]'
|
when = '[ ! -f /run/.toolboxenv ]'
|
||||||
|
|||||||
1
starship.voyager.color
Normal file
1
starship.voyager.color
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#01568e
|
||||||
Reference in New Issue
Block a user