diff --git a/KleinDwm/source/config.h b/KleinDwm/source/config.h index 4e757ac..6e4a564 100644 --- a/KleinDwm/source/config.h +++ b/KleinDwm/source/config.h @@ -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 */ diff --git a/customstatusbar/statusbars/colorvars.sh b/customstatusbar/colorvars.sh similarity index 100% rename from customstatusbar/statusbars/colorvars.sh rename to customstatusbar/colorvars.sh diff --git a/customstatusbar/install.sh b/customstatusbar/install.sh new file mode 100755 index 0000000..c7bccb8 --- /dev/null +++ b/customstatusbar/install.sh @@ -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." diff --git a/customstatusbar/statusbars/statusbar.service b/customstatusbar/statusbar.service similarity index 81% rename from customstatusbar/statusbars/statusbar.service rename to customstatusbar/statusbar.service index a22a9b8..a0ec29c 100644 --- a/customstatusbar/statusbars/statusbar.service +++ b/customstatusbar/statusbar.service @@ -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 diff --git a/customstatusbar/statusbars/statusbar.sh b/customstatusbar/statusbar.sh similarity index 100% rename from customstatusbar/statusbars/statusbar.sh rename to customstatusbar/statusbar.sh diff --git a/customstatusbar/statusbars/install.sh b/customstatusbar/statusbars/install.sh deleted file mode 100755 index d23e81e..0000000 --- a/customstatusbar/statusbars/install.sh +++ /dev/null @@ -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"