This repository contains usefull shell scripts for daily use.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.4 KiB

#!/bin/sh
#################################################################
# Wrapper for cmd line programs in the context of window #
# managers like i3wm (e.g. bash scripts). #
# #
# Author: Maximilian Stiefel #
# Last modified: 29. April 2017 #
# CLI usage: Put in autostart script (e.g. ~/.i3/config) #
# ./i3wm_cmd_wrapper.sh window_name #
# path_to_script #
# Required PKGs: xterm #
# #
#################################################################
#################################################################
# Vars #
#################################################################
# Exctracting username@server.com
SCRIPT="$2"
# Extracting window name
WDW_NAME="$1"
# Command to execute
MYCMD1="xterm -T $WDW_NAME -e \"$SCRIPT\""
# Expected number of params
NU_PARAMS=2;
#################################################################
# Action #
#################################################################
# Check if the expected number of parameters is given.
if [ $# != $NU_PARAMS ]
then
echo "Error: Illegal number of parameters."
echo "Correct usage is:"
echo "./i3wm_cmd_wrapper.sh window_name path_to_script"
exit 1;
fi
echo "$MYCMD1"
xterm -T $WDW_NAME -e "$SCRIPT"