-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using my own patched version of dmenu
Instead of installing the default package I clone and install my own version that already has some additional patches. The main advantage is keeping the installation of dmenu in one place.
- Loading branch information
1 parent
9849b54
commit 19afa39
Showing
2 changed files
with
46 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,40 @@ | ||
#!/bin/env bash | ||
|
||
# File: install.sh | ||
# Author: Marco Plaitano https://github.com/marcoplaitano | ||
# Author: Marco Plaitano | ||
# Github: https://github.com/marcoplaitano/evemenu | ||
# Date: 01 Aug 2022 | ||
# Brief: Download and install dmenu; make the evemenu script executable. | ||
# | ||
# Copyright (c) 2022 Marco Plaitano | ||
# Copyright (c) 2023 Marco Plaitano | ||
|
||
|
||
################################################## | ||
# FUNCTIONS # | ||
################################################## | ||
|
||
|
||
function safe_exit { | ||
[[ $(pwd) == */dmenu-5.0 ]] && popd | ||
[[ -f dmenu.tar.gz ]] && rm dmenu.tar.gz | ||
[[ -d dmenu-5.0/ ]] && rm -r --interactive=never dmenu-5.0/ | ||
exit $1 | ||
} | ||
|
||
|
||
# Show error message and stop the execution of the script. | ||
function raise_error { | ||
_die() { | ||
[[ -n $1 ]] && error_msg="ERROR: $1" || error_msg="Error in 'install.sh'." | ||
echo "$error_msg" | ||
safe_exit 1 | ||
exit 1 | ||
} | ||
|
||
|
||
################################################## | ||
# MAIN BODY # | ||
################################################## | ||
|
||
|
||
echo "########## INSTALLING DEPENDENCIES" | ||
sudo apt install -y tar wget gcc make libx11-dev libxinerama-dev libxft-dev | ||
[[ $? -ne 0 ]] && raise_error "Could not install needed dependencies." | ||
|
||
|
||
echo "########## DOWNLOADING DMENU'S SOURCE CODE" | ||
wget https://dl.suckless.org/tools/dmenu-5.0.tar.gz -O ./dmenu.tar.gz | ||
[[ $? -ne 0 ]] && raise_error "Could not download source code from website." | ||
tar xvfz dmenu.tar.gz > /dev/null | ||
[[ $? -ne 0 ]] && raise_error "Could not extract source code folder." | ||
|
||
echo "########## INSTALLING DMENU" | ||
pushd dmenu-5.0 || raise_error "Could not find folder containing source code." | ||
sudo make install | ||
[[ $? -ne 0 ]] && raise_error "Could not install dmenu." | ||
|
||
echo "########## ADDING evemenu SCRIPT TO /usr/local/bin" | ||
sudo cp ./evemenu /usr/local/bin && sudo chmod +x /usr/local/bin/evemenu | ||
|
||
echo "Installation succeded. Run with the command 'evemenu'." | ||
safe_exit | ||
dmenu_repo="https://github.com/marcoplaitano/dmenu" | ||
dmenu_dir="/tmp/dmenu-dir" | ||
if git clone "$dmenu_repo" "$dmenu_dir" ; then | ||
pushd dmenu &>/dev/null | ||
./install.sh || _die "Could not install dmenu." | ||
popd &>/dev/null | ||
[[ -d "$dmenu_dir" ]] && rm -rf "$dmenu_dir" | ||
else | ||
_die "Could not download dmenu from $dmenu_repo'." | ||
fi | ||
|
||
echo "########## INSTALLING EVEMENU" | ||
chmod +x ./evemenu | ||
mkdir -p "$HOME/.local/bin" | ||
cp ./evemenu "$HOME/.local/bin" | ||
|
||
if [[ ":$PATH:" == *":$HOME/.local/bin:"* ]]; then | ||
echo "evemenu is installed." | ||
else | ||
echo "WARNING: Add \$HOME/.local/bin to \$PATH to execute evemenu." | ||
fi |