1

I know how to make certain processes open up at start up but I'd really like to get gedit to open a number of files by default every time as well. It sometimes takes me a couple of minutes to find/remember all of them and this would make it a lot faster. Is this possible?

2

Just add this to your startup applications:

gedit "~/file 1" "~/Documents/file 2" "~/Desktop/file 3"

It passes the file paths as arguments to GEdit which causes GEdit to open these files.

  • I actually forgot that we can use commands for the startup applications. This is a good solution, thanks. – LagarLagar Jan 1 '17 at 20:45
0

You don't need a gedit default if all you need is to remember a file list. You can simply save a gedit file1 file2 file3 shortcut on the desktop.

As for your exact request, there's no such special gedit feature. I would just use a wrapper.

sudo mv /usr/bin/gedit /usr/bin/gedit.real
echo '#!/bin/bash' |sudo tee /usr/bin/gedit
echo '[ -d ~/.gedit_default ] && filelist=`ls ~/.gedit_default`' |sudo tee -a /usr/bin/gedit
echo 'gedit.real "$@" $filelist' |sudo tee -a /usr/bin/gedit
sudo chmod +x /usr/bin/gedit
mkdir -p ~/.gedit_default

Then I would add my desired default files to ~/.gedit_default as symlinks:

ln -s /path/to/myfile1 ~/.gedit_default
ln -s /path/to/myfile2 ~/.gedit_default

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.