about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--packages/dwmbar/default.nix19
-rw-r--r--patches/dwmbar.patch84
2 files changed, 12 insertions, 91 deletions
diff --git a/packages/dwmbar/default.nix b/packages/dwmbar/default.nix
index 340daf1..1704b9d 100644
--- a/packages/dwmbar/default.nix
+++ b/packages/dwmbar/default.nix
@@ -1,21 +1,26 @@
-{ stdenv, lib, fetchFromGitHub, bash }:
+{ stdenv
+, lib
+, fetchFromGitHub
+}:
+
 stdenv.mkDerivation {
   pname = "dwmbar";
   version = "1.0";
+  
   src = fetchFromGitHub {
     owner = "thytom";
     repo = "dwmbar";
     rev = "574f5703c558a56bc9c354471543511255423dc7";
     sha256 = "sha256-IrelZpgsxq2dnsjMdh7VC5eKffEGRbDkZmZBD+tROPs=";
   };
-  patches = [ ../../patches/dwmbar.patch ];
-  buildInputs = [ bash ];
+  
   installPhase = ''
     mkdir -p $out/bin
-    mkdir -p $out/bin/_dwmbar/modules
-    cp -r modules $out/bin/_dwmbar/
-    install config $out/bin/_dwmbar/config
-    install bar.sh $out/bin/_dwmbar/bar.sh
+    mkdir -p $out/config
+    cp -r modules/ $out/config/
+    install config $out/config/config
+    install bar.sh $out/config/bar.sh
+    substituteInPlace dwmbar --replace 'DEFAULT_CONFIG_DIR="/usr/share/dwmbar"' "DEFAULT_CONFIG_DIR=\"$out/config\""
     install dwmbar $out/bin/dwmbar
   '';
 }
diff --git a/patches/dwmbar.patch b/patches/dwmbar.patch
deleted file mode 100644
index f118c1d..0000000
--- a/patches/dwmbar.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-diff --git a/dwmbar b/dwmbar
-index ba0de22..f896e0d 100755
---- a/dwmbar
-+++ b/dwmbar
-@@ -15,7 +15,7 @@
- 
- VERSION="1.0"
- 
--DEFAULT_CONFIG_DIR="/usr/share/dwmbar"
-+DEFAULT_CONFIG_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/_dwmbar"
- export DEFAULT_CONFIG_DIR
- DEFAULT_MODULES_DIR="$DEFAULT_CONFIG_DIR/modules/"
- export DEFAULT_MODULES_DIR
-@@ -51,7 +51,8 @@ print_help(){
- 
- copy_usr_to_home(){
- 	mkdir -p "$CUSTOM_DIR"
--	cp -r "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR"
-+	#cp -r "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR"
-+        install "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR" -m 744
- }
- 
- check_files(){
-@@ -98,6 +99,11 @@ check_internet() {
- 		fi
- }
- 
-+if [[ ! -d "$CONFIG_DIR" ]]; then
-+        echo "INSTALLING COZ CONFIG DONT EXISTS"
-+        copy_usr_to_home
-+fi
-+
- check_files
- 
- while :; do
-diff --git a/install.sh b/install.sh
-index c409bd2..26159ba 100755
---- a/install.sh
-+++ b/install.sh
-@@ -15,12 +15,8 @@
- #     You should have received a copy of the GNU General Public License
- #     along with this program.  If not, see <https://www.gnu.org/licenses/>.
- 
--DWMBAR="/usr/bin/dwmbar"
--
--if [ "$EUID" -ne 0 ]
--  then echo "Please run as root" > /dev/stderr
--  exit 1
--fi
-+INSTALL_LOCATION="$1/share"
-+BIN_LOCATION="$1/bin"
- 
- if [[ ! -f "dwmbar" ]]; then
- 	echo "dwmbar executable not found." > /dev/stderr
-@@ -30,17 +26,17 @@ fi
- # Create /usr/share/dwmbar
- # Containing example bar.sh and modules
- 
--mkdir --parents "/usr/share/dwmbar/"
-+mkdir --parents "$INSTALL_LOCATION/dwmbar/"
- 
--echo "./modules --> /usr/share/dwmbar/modules"
--cp -r "./modules" "/usr/share/dwmbar/modules"
-+echo "./modules --> $INSTALL_LOCATION/dwmbar/modules"
-+cp -r "./modules" "$INSTALL_LOCATION/dwmbar/modules"
- 
--echo "./bar.sh --> /usr/share/dwmbar/bar.sh"
--cp "./bar.sh" "/usr/share/dwmbar/bar.sh"
-+echo "./bar.sh --> $INSTALL_LOCATION/dwmbar/bar.sh"
-+cp "./bar.sh" "$INSTALL_LOCATION/dwmbar/bar.sh"
- 
--echo "./config --> /usr/share/dwmbar/config"
--cp -r "./config" "/usr/share/dwmbar/config"
-+echo "./config --> $INSTALL_LOCATION/dwmbar/config"
-+cp -r "./config" "$INSTALL_LOCATION/dwmbar/config"
- 
--echo "./dwmbar --> /usr/bin/dwmbar"
--cp "./dwmbar" "/usr/bin/dwmbar"
-+echo "./dwmbar --> $BIN_LOCATION/dwmbar"
-+cp "./dwmbar" "$BIN_LOCATION/dwmbar"
- [[ $? -eq 0 ]] && echo "Installation completed successfully"
-diff --git a/modules/internet b/modules/internet
-index 22cbd6a..0b17df1 100755
-Binary files a/modules/internet and b/modules/internet differ