fix: Launch script from the directory in which it's contained

This commit is contained in:
Liam 2024-08-14 23:13:56 -07:00
parent 1d5b1e6676
commit d4489648b4
No known key found for this signature in database
23 changed files with 28 additions and 25 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
. ./common-script.sh
. ../common-script.sh
setupAlacritty() {
echo "Install Alacritty if not already installed..."

View File

@ -1,5 +1,5 @@
#!/bin/sh -e
. ./common-script.sh
. ../common-script.sh
makeDWM(){
cd $HOME && git clone https://github.com/ChrisTitusTech/dwm-titus.git # CD to Home directory to install dwm-titus
@ -24,4 +24,4 @@ setupDWM() {
checkEnv
setupDWM
makeDWM
makeDWM

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
. ./common-script.sh
. ../common-script.sh
setupKitty() {
echo "Install Kitty if not already installed..."

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
. ./common-script.sh
. ../common-script.sh
setupRofi() {
echo "Install Rofi if not already installed..."

View File

@ -1,6 +1,6 @@
#!/bin/sh
. ./common-script.sh
. ../common-script.sh
# Function to install zsh
install_zsh() {
@ -48,4 +48,4 @@ EOL
checkEnv
setup_zsh_config
install_zsh
install_zsh

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
. ./common-script.sh
. ../common-script.sh
installPkg() {
echo "Install UFW if not already installed..."

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
. ./common-script.sh
. ../common-script.sh
# Check if the home directory and linuxtoolbox folder exist, create them if they don't
LINUXTOOLBOXDIR="$HOME/linuxtoolbox"

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
. ./common-script.sh
. ../common-script.sh
installDepend() {
## Check for dependencies.

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
. ./common-script.sh
. ../common-script.sh
# Check if the home directory and linuxtoolbox folder exist, create them if they don't
LINUXTOOLBOXDIR="$HOME/linuxtoolbox"

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
. ./common-script.sh
. ../common-script.sh
removeSnaps() {
case $PACKAGER in

View File

@ -1,6 +1,6 @@
#!/bin/sh -e
. ./common-script.sh
. ../common-script.sh
fastUpdate() {
case ${PACKAGER} in

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
# Function to auto-detect displays and set common resolution
auto_detect_displays() {

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
# Function to change monitor orientation
change_orientation() {

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
RESET='\033[0m'
BOLD='\033[1m'

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
# Function to duplicate displays
duplicate_displays() {

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
RESET='\033[0m'
BOLD='\033[1m'

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
# Function to extend displays
extend_displays() {

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
# Function to manage monitor arrangement
manage_arrangement() {

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
# Function to reset scaling back to 1 (native resolution) for all monitors
reset_scaling() {

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
# Function to scale smaller monitors to the highest resolution of a bigger monitor
scale_monitors() {

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
# Function to set a monitor as primary
set_primary_monitor() {

View File

@ -1,5 +1,5 @@
#!/bin/bash
source ./utils/monitor-control/utility_functions.sh
source ./utility_functions.sh
RESET='\033[0m'
BOLD='\033[1m'

View File

@ -137,7 +137,10 @@ impl RunningCommand {
cmd.arg(prompt);
}
Command::LocalFile(file) => {
cmd.arg(file);
cmd.arg(&file);
if let Some(parent) = file.parent() {
cmd.cwd(parent);
}
}
Command::None => panic!("Command::None was treated as a command"),
}