Skip to content

Commit

Permalink
Added fish, kitty, starship, waybar config PKGBUILDS
Browse files Browse the repository at this point in the history
  • Loading branch information
zstg committed Dec 23, 2024
1 parent 0cdd9a6 commit 1fa2e66
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 0 deletions.
48 changes: 48 additions & 0 deletions PKGBUILDS/stratos-fish-config/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Maintainer: ZeStig <zestig@duck.com>
pkgname=stratos-fish-config
pkgver=1.0
pkgrel=0
pkgdesc="Fish shell configuration for StratOS"
arch=('x86_64')
url="https://github.com/StratOS-Linux/StratOS-fish-config"
license=('GPL')
depends=('bash' 'fish')

build() {
git clone $url
echo $srcdir
}

package() {
mkdir -p "$pkgdir/etc/skel/.config/fish"

emacs_config_paths=( "$HOME/.config/fish" )

config_exists=false
for config in "${emacs_config_paths[@]}"; do
if [ -e "$config" ]; then
config_exists=true
break
fi
done

if [ "$config_exists" = true ]; then
cp -r "$srcdir/StratOS-fish-config"/* "$pkgdir/etc/skel/.config/fish/"
echo "The configuration files have been installed in /etc/skel/.config/fish."
echo "You may copy the files manually if you wish to overwrite your current fish configuration."
else
read -p "No fish configuration files found. Do you want to install the StratOS fish configuration in .config/fish? (y/n): " user_input
if [[ "$user_input" =~ ^[Yy]$ ]]; then
mkdir -p "$HOME/.config/fish"
cp -r "$srcdir/StratOS-fish-config"/* "$HOME/.config/fish/"
else
cp -r "$srcdir/StratOS-fish-config"/* "$pkgdir/etc/skel/.config/fish/"
echo "The configuration files have been installed in /etc/skel/.config/fish."
echo "You may copy the files manually if you wish to overwrite your current fish configuration."
fi
fi
}

pkgpostrm() {
rm -rf "/etc/skel/.config/fish"
}
48 changes: 48 additions & 0 deletions PKGBUILDS/stratos-kitty-config/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Maintainer: ZeStig <zestig@duck.com>
pkgname=stratos-kitty-config
pkgver=1.0
pkgrel=0
pkgdesc="Kitty terminal emulator configuration for StratOS"
arch=('x86_64')
url="https://github.com/StratOS-Linux/StratOS-kitty-config"
license=('GPL')
depends=('bash' 'kitty')

build() {
git clone $url
echo $srcdir
}

package() {
mkdir -p "$pkgdir/etc/skel/.config/kitty"

emacs_config_paths=( "$HOME/.config/kitty" )

config_exists=false
for config in "${emacs_config_paths[@]}"; do
if [ -e "$config" ]; then
config_exists=true
break
fi
done

if [ "$config_exists" = true ]; then
cp -r "$srcdir/StratOS-kitty-config"/* "$pkgdir/etc/skel/.config/kitty/"
echo "The configuration files have been installed in /etc/skel/.config/kitty."
echo "You may copy the files manually if you wish to overwrite your current kitty configuration."
else
read -p "No fish configuration files found. Do you want to install the StratOS kitty configuration in .config/kitty? (y/n): " user_input
if [[ "$user_input" =~ ^[Yy]$ ]]; then
mkdir -p "$HOME/.config/kitty"
cp -r "$srcdir/StratOS-kitty-config"/* "$HOME/.config/kitty/"
else
cp -r "$srcdir/StratOS-kitty-config"/* "$pkgdir/etc/skel/.config/kitty/"
echo "The configuration files have been installed in /etc/skel/.config/kitty."
echo "You may copy the files manually if you wish to overwrite your current kitty configuration."
fi
fi
}

pkgpostrm() {
rm -rf "/etc/skel/.config/kitty"
}
48 changes: 48 additions & 0 deletions PKGBUILDS/stratos-starship-config/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Maintainer: ZeStig <zestig@duck.com>
pkgname=stratos-starship-config
pkgver=1.0
pkgrel=0
pkgdesc="Starship shell prompt configuration for StratOS"
arch=('x86_64')
url="https://github.com/StratOS-Linux/StratOS-starship-config"
license=('GPL')
depends=('bash' 'fish')

build() {
git clone $url
echo $srcdir
}

package() {
mkdir -p "$pkgdir/etc/skel/.config/fish"

emacs_config_paths=( "$HOME/.config/fish" )

config_exists=false
for config in "${emacs_config_paths[@]}"; do
if [ -e "$config" ]; then
config_exists=true
break
fi
done

if [ "$config_exists" = true ]; then
cp -r "$srcdir/StratOS-fish-config"/* "$pkgdir/etc/skel/.config/fish/"
echo "The configuration files have been installed in /etc/skel/.config/fish."
echo "You may copy the files manually if you wish to overwrite your current fish configuration."
else
read -p "No fish configuration files found. Do you want to install the StratOS fish configuration in .config/fish? (y/n): " user_input
if [[ "$user_input" =~ ^[Yy]$ ]]; then
mkdir -p "$HOME/.config/fish"
cp -r "$srcdir/StratOS-fish-config"/* "$HOME/.config/fish/"
else
cp -r "$srcdir/StratOS-fish-config"/* "$pkgdir/etc/skel/.config/fish/"
echo "The configuration files have been installed in /etc/skel/.config/fish."
echo "You may copy the files manually if you wish to overwrite your current fish configuration."
fi
fi
}

pkgpostrm() {
rm -rf "/etc/skel/.config/fish"
}
56 changes: 56 additions & 0 deletions PKGBUILDS/stratos-waybar-config/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Maintainer: ZeStig <zestig@duck.com>
pkgname=stratos-waybar-config
pkgver=1.0
pkgrel=0
pkgdesc="StratOS Waybar config"
arch=('x86_64')
url="https://github.com/StratOS-Linux/StratOS-waybar-config"
license=('GPL')
depends=('bash')

build() {
# Clone the repo directly into the source directory
git clone "$url" "$srcdir/StratOS-waybar-config"
echo "$srcdir"
}

package() {
# Define the target installation directory
local config_dir="$pkgdir/etc/skel/.config/waybar"

# Create the necessary directories
mkdir -p "$config_dir"

# Define the path of the Waybar config in the user's home
local waybar_config_path="$HOME/.config/waybar"

# Check if a Waybar configuration already exists in the home directory
if [ -e "$waybar_config_path" ]; then
# If the config exists in the home directory, ask if user wants to overwrite it
read -p "Waybar configuration already exists in your home directory. Do you want to overwrite it? (y/n): " user_input
if [[ "$user_input" =~ ^[Yy]$ ]]; then
cp -r "$srcdir/StratOS-waybar-config"/* "$waybar_config_path/"
echo "Your Waybar configuration has been overwritten in $waybar_config_path."
else
echo "The Waybar configuration was not overwritten."
fi
else
# If no Waybar configuration exists in the home directory, copy to the home directory
read -p "No Waybar configuration found in your home directory. Do you want to install the configuration there? (y/n): " user_input
if [[ "$user_input" =~ ^[Yy]$ ]]; then
mkdir -p "$waybar_config_path"
cp -r "$srcdir/StratOS-waybar-config"/* "$waybar_config_path/"
echo "The Waybar configuration has been installed in your home directory."
fi
fi

# Also copy the configuration to /etc/skel/.config/waybar for new users
cp -r "$srcdir/StratOS-waybar-config"/* "$config_dir/"
echo "The configuration files have been installed in /etc/skel/.config/waybar."
echo "New users will get the default Waybar configuration in their home directories."
}

pkgpostrm() {
# Clean up the configuration directory in /etc/skel when the package is removed
rm -rf "/etc/skel/.config/waybar"
}

0 comments on commit 1fa2e66

Please sign in to comment.