workspaces
This commit is contained in:
@@ -18,7 +18,7 @@ if [ $PERCENT -le "23" ]; then
|
|||||||
notify-send --urgency=critical "Low battery $PERCENT%"
|
notify-send --urgency=critical "Low battery $PERCENT%"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $PERCENT -le "3" ]; then
|
if [ $PERCENT -le "7" ]; then
|
||||||
echo "powering down..."
|
echo "powering down..."
|
||||||
systemctl suspend
|
systemctl suspend
|
||||||
fi
|
fi
|
||||||
|
|||||||
64
ws3
Executable file
64
ws3
Executable file
@@ -0,0 +1,64 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [ "$1" == "-h" ] ; then
|
||||||
|
echo "
|
||||||
|
ws - quickly setup workspace environment by invoking some terminals
|
||||||
|
- intended to be invoked within a window manager environ like i3
|
||||||
|
- can use a default workDir variable preference if ~/.bashrc.local exists
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
#with an existing terminal:
|
||||||
|
ws
|
||||||
|
ws ~/projects
|
||||||
|
|
||||||
|
#with i3wm|sway for example:
|
||||||
|
1. select workspace e.g. <\$mod+2>
|
||||||
|
2. open dbus quick menu <\$mod+d> and type ws
|
||||||
|
"
|
||||||
|
echo "$(tput setaf 6)$workDir $(tput setaf 7)was previous working directory"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
myLocalConfig="$HOME/.bashrc.local"
|
||||||
|
# myTerm=${TERM:-urxvt}
|
||||||
|
myTerm=${TERM:-alacritty}
|
||||||
|
|
||||||
|
if [[ -e $myLocalConfig ]]; then
|
||||||
|
source $myLocalConfig
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 ]]; then
|
||||||
|
workingDirectory=$1
|
||||||
|
else
|
||||||
|
workingDirectory=${workDir:-~/projects} #e.g. if workDir is defined in .bashrc.local
|
||||||
|
fi
|
||||||
|
|
||||||
|
# echo $workDir
|
||||||
|
# echo $workingDirectory
|
||||||
|
|
||||||
|
if [[ $myTerm == urxvt ]]; then
|
||||||
|
urxvt -cd $workingDirectory -title "$(basename $workingDirectory) woola" -e bash -ic "$HOME/bin/woola" &
|
||||||
|
urxvt -cd $workingDirectory -title "$(basename $workingDirectory) ranger" -e bash -ic "ranger" &
|
||||||
|
urxvt -cd $workingDirectory &
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $myTerm == alacritty ]]; then
|
||||||
|
alacritty --working-directory $workingDirectory --title "$(basename $workingDirectory) woola" -e bash -c "$HOME/bin/woola" &
|
||||||
|
alacritty --working-directory $workingDirectory --title "$(basename $workingDirectory) journal" -e bash -c "nvim $(ls $workingDirectory/*journal.md | tail -1) && exec bash" &
|
||||||
|
# gvim $(ls $workingDirectory/*journal.md | tail -1)
|
||||||
|
qutebrowser &
|
||||||
|
|
||||||
|
sleep 0.3
|
||||||
|
|
||||||
|
python $HOME/projects/dev/arch/ws-splithv3-67.py qutebrowser woola journal '3'
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "edit script for compatibility with terminal"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -e $myLocalConfig ]]; then
|
||||||
|
sed -i -E "s|(export workDir=).+|\1$workingDirectory|" "$myLocalConfig"
|
||||||
|
export workDir=$workingDirectory
|
||||||
|
fi
|
||||||
|
|
||||||
63
ws9
Executable file
63
ws9
Executable file
@@ -0,0 +1,63 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [ "$1" == "-h" ] ; then
|
||||||
|
echo "
|
||||||
|
ws - quickly setup workspace environment by invoking some terminals
|
||||||
|
- intended to be invoked within a window manager environ like i3
|
||||||
|
- can use a default workDir variable preference if ~/.bashrc.local exists
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
#with an existing terminal:
|
||||||
|
ws
|
||||||
|
ws ~/projects
|
||||||
|
|
||||||
|
#with i3wm|sway for example:
|
||||||
|
1. select workspace e.g. <\$mod+2>
|
||||||
|
2. open dbus quick menu <\$mod+d> and type ws
|
||||||
|
"
|
||||||
|
echo "$(tput setaf 6)$workDir $(tput setaf 7)was previous working directory"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
myLocalConfig="$HOME/.bashrc.local"
|
||||||
|
# myTerm=${TERM:-urxvt}
|
||||||
|
myTerm=${TERM:-alacritty}
|
||||||
|
|
||||||
|
if [[ -e $myLocalConfig ]]; then
|
||||||
|
source $myLocalConfig
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $1 ]]; then
|
||||||
|
workingDirectory=$1
|
||||||
|
else
|
||||||
|
workingDirectory=${workDir:-~/projects} #e.g. if workDir is defined in .bashrc.local
|
||||||
|
fi
|
||||||
|
|
||||||
|
# echo $workDir
|
||||||
|
# echo $workingDirectory
|
||||||
|
|
||||||
|
if [[ $myTerm == urxvt ]]; then
|
||||||
|
urxvt -cd $workingDirectory -title "$(basename $workingDirectory) woola" -e bash -ic "$HOME/bin/woola" &
|
||||||
|
urxvt -cd $workingDirectory -title "$(basename $workingDirectory) ranger" -e bash -ic "ranger" &
|
||||||
|
urxvt -cd $workingDirectory &
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $myTerm == alacritty ]]; then
|
||||||
|
alacritty --working-directory $workingDirectory --title "$(basename $workingDirectory) task" -e bash -c 'date "+%F %H:%M"; cal -mvn 3; task list due.by:eod or +ACTIVE && exec bash' &
|
||||||
|
alacritty --working-directory $workingDirectory --title "$(basename $workingDirectory) journal" -e bash -c "nvim $(ls $workingDirectory/*journal.md | tail -1) && exec bash" &
|
||||||
|
alacritty --working-directory $workingDirectory --title "$(basename $workingDirectory) schedule" -e bash -c "nvim $(ls $workingDirectory/*weekly-schedule.md | tail -1) && exec bash" &
|
||||||
|
|
||||||
|
sleep 0.3
|
||||||
|
|
||||||
|
python $HOME/projects/dev/arch/ws-splithv3-50.py journal task schedule '9'
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "edit script for compatibility with terminal"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -e $myLocalConfig ]]; then
|
||||||
|
sed -i -E "s|(export workDir=).+|\1$workingDirectory|" "$myLocalConfig"
|
||||||
|
export workDir=$workingDirectory
|
||||||
|
fi
|
||||||
|
|
||||||
Reference in New Issue
Block a user