Automated update

This commit is contained in:
klein panic
2024-09-27 12:26:54 -04:00
parent 130b21b83d
commit b166c1ec42
6 changed files with 57 additions and 45 deletions

View File

@@ -3,7 +3,6 @@
#include "colors/space.h"
#include "keys.h"
#define TERMINAL "st" // default terminal appearance */
#define ICONSIZE 20 /* icon size */
#define ICONSPACING 5 /* space between icon and title */
static const unsigned int borderpx = 2; /* border pixel of windows */

55
customstatusbar/install.sh Executable file
View File

@@ -0,0 +1,55 @@
#!/usr/bin/env bash
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# DWM dependency check (uncomment if necessary)
# if ! pgrep -x "dwm" > /dev/null; then
# echo "DWM is not running. Please ensure that DWM is installed and is your window manager."
# exit 1
# fi
# Check for the status2D dependency
if command_exists dwm; then
echo "DWM is installed. Make sure you have the status2D patch applied for proper rendering."
fi
# Required packages list
required_packages=("grep" "gawk" "procps" "coreutils" "lm-sensors" "network-manager" "x11-xserver-utils")
# Install required packages
for pkg in "${required_packages[@]}"; do
if ! dpkg -s "$pkg" >/dev/null 2>&1; then
echo "Package $pkg is not installed. Installing..."
sudo apt update
sudo apt install -y "$pkg"
if [ $? -ne 0 ]; then
echo "Failed to install $pkg. Please install it manually, or its equivalent, and edit the source code."
exit 1
fi
else
echo "Package $pkg is already installed."
fi
done
# Copy statusbar.sh to /usr/local/bin and make it executable
sudo cp statusbar.sh /usr/local/bin/statusbar
sudo chmod +x /usr/local/bin/statusbar
# Create the directory and copy colorvars.sh
PREFIX="$HOME/.local/share/statusbar"
mkdir -p "$PREFIX"
cp colorvars.sh "$PREFIX"
# Setup the systemd service
SERVICE_DIR="$HOME/.config/systemd/user"
mkdir -p "$SERVICE_DIR"
cp statusbar.service "$SERVICE_DIR"
# Enable and restart the service
systemctl --user enable statusbar.service
systemctl --user restart statusbar.service
echo "Installation completed successfully. The statusbar is installed and the service has been enabled and restarted."

View File

@@ -1,6 +1,6 @@
[Unit]
Description=SystemBar for DWM from suckless
After=graphical.target
After=default.target
[Service]
Type=simple
@@ -11,4 +11,4 @@ Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/klein/.Xauthority
[Install]
WantedBy=graphical.target
WantedBy=default.target

View File

@@ -1,42 +0,0 @@
#!/usr/bin/env bash
#Check if command exits
command_exists() {
command -v "$1" >/dev/null 2>&1
}
#DWM dependency is running
#if ! pgrep -x "dwm" > /dev/null; then
# echo "DWM is not running. Please ensure that you got that shit installed and its your window manager."
# exit 1
#fi
#status2d dependency (update later if you find out how)
if command_exists dwm; then
echo "DWM is installed. Make sure you got status2D patch applied for properrendering."
fi
#Package dependcies
requires_packages=("grep" "gawk" "procps" "coreutils" "lm-sensors" "network-manager" "x11-xserver-utils")
for pkg in "${requires_packages[@]}"; do
if ! dpkg -s "$pkg" >/dev/null 2>&1; then
echo "Package $pkg is not installed. Installing..."
sudo apt update
sudo apt install -y "$pkg"
if [ $? -ne 0 ]; then
echo "Failed to install $pkg. Install it manually, or its equivalent and edit source code"
exit 1
fi
else
echo "Package $pkg is installed already. YAY"
fi
done
# sudo chmod +x statusbar.sh
sudo cp statusbar.sh /usr/local/bin/statusbar
PREFIX="$HOME/.local/share/statusbar"
mkdir -p "$PREFIX"
cp colorvars.sh "$PREFIX"
echo "Installation done. Run statusbar in shell. Installed to local bin"