Skip to content

Instantly share code, notes, and snippets.

@yuvalif
Created July 27, 2020 08:39
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 yuvalif/494233fa345765a71389f5e26f784f21 to your computer and use it in GitHub Desktop.
Save yuvalif/494233fa345765a71389f5e26f784f21 to your computer and use it in GitHub Desktop.
#!/bin/bash
profiles=$(dconf dump /org/gnome/terminal/legacy/profiles:/ | grep 'visible-name' | tr "'" '"' | awk 'BEGIN{FS="="; ORS=","}{print $2}')
IFS=','
i=0
for p in $profiles
do
out[$i]=$p
((i=i+1))
done
p_idx=$(od -A n -t d -N 1 /dev/urandom)
p_idx=$((p_idx % "$i"))
profile=${out[$p_idx]}
cmd="gnome-terminal --maximize --full-screen --profile=$profile"
eval $cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment