Skip to content

Instantly share code, notes, and snippets.

@Goddard
Forked from nlevchuk/terminal-session
Created November 1, 2015 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Goddard/ab5858147651fec56088 to your computer and use it in GitHub Desktop.
Save Goddard/ab5858147651fec56088 to your computer and use it in GitHub Desktop.
It's bash script for saving and loading gnome-terminal session. Special for Ubuntu.
#!/bin/bash
##
## This is bash script for saving and loading gnome-terminal session. Special for Ubuntu.
##
## Usage: ./terminal-session -s <name_profile> - for save session
## ./terminal-session -l <name_profile> - for load existing session
## ./terminal-session --profiles - for show existing session files
##
## Instructions:
## - Run gnome-terminal;
## - $ touch terminal-session;
## - $ chmod +x terminal-session;
## - Copy whole this code in the file;
##
## For convenience you can move this file in /usr/bin/
session_path=$HOME/.terminal-session
if [ ! -d "$session_path" ]; then
mkdir $session_path
fi
if [[ $1 == "-s" ]]; then
if [[ $2 ]]; then gnome-terminal --save-config=$session_path/$2; fi
elif [[ $1 == "-l" ]]; then
if [[ $2 ]]; then gnome-terminal --load-config=$session_path/$2 2> /dev/null; fi
elif [[ $1 == "--profiles" ]]; then
ls $session_path
fi
@Goddard
Copy link
Author

Goddard commented Mar 10, 2016

This no longer works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment