-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Bash script for creating windows on i3 startup
There's still an issue with starting screen in detached mode (with `screen -d -m`) and starting xterms that immediately attach (like the script does) on my system: backspace and ^H misbehave and erase all characters before the cursor in those xterms.
- Loading branch information
Showing
2 changed files
with
25 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
i3-msg 'append_layout ~/.config/i3/scratchpad.json; move scratchpad' | ||
i3-msg 'append_layout ~/.config/i3/workspace-2.json; move workspace 2' | ||
|
||
if ! screen -ls; then | ||
# There's no screen session; create one. | ||
screen -d -m | ||
while ! screen -ls; do sleep .1; done | ||
# Create some new windows inside the screen session. | ||
screen -X screen && screen -X screen && screen -X 'select' 0 | ||
fi | ||
|
||
# Disable XON/XOFF flow control before attaching. I need to do this when the screen | ||
# session was started in detached mode and I'm starting a new xterm that immediately | ||
# attaches. I don't understand why. | ||
# Note: using `screen -r` for one xterm if we just created a detached session doesn't | ||
# always work because either xterm may attach first (`screen -r` won't attach to a session | ||
# that is already attached somewhere else). Contrary to what the screen(1) man page says, | ||
# `screen -x` still works when the screen session is detached. | ||
xterm -e 'stty -ixon && screen -x' & | ||
xterm -e 'stty -ixon && screen -x' & | ||
|
||
# vim: tw=90 sts=-1 sw=3 et |