

Add the command: python3 /path/to/get_latestgedit.pyĪnd add script to a shortcut key: Choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". If all works fine, add script to your startup applications: Dash > Startup Applications > Add.

The most recent gedit files should show up, as shown in the image. Now test-run script with the command (from another terminal) with the command: python3 /path/to/get_geditlist.py While the script runs, open a few existing gedit files, leave them open for at least 5-10 seconds (the loop break time). Open a terminal window, test-drive script with the command: python3 /path/to/get_latestgedit.py To_open = subprocess.check_output().decode("utf-8").split("|") New = įor w in :Ĭopy the script below into an empty file, save it as get_geditlist.py: #!/usr/bin/env python3Ĭmd = 'zenity -list -title="Choose"'+ \ Matches = for l in gedit_w.splitlines() if all( Gedit_w =subprocess.check_output().decode("utf-8") Pid = subprocess.check_output().decode("utf-8").strip()

The setup needs wmctrl to be installed: sudo apt-get wmctrlĬopy the script below ( ) into an empty file, save it as get_latestgedit.py #!/usr/bin/env python3į = os.environ+"/.latest_gedit.txt" Simply run script in the background, put script under a shortcut key or add it as a shortcut to the gedit launcher's quicklist. a script to call a list of the most recently used files.a (very light) background script, keeping track of possibly opened gedit files.It gives you the information, exactly as it appears on your gedit window's title bar, of the last ten used files. If the path information of recently used gedit files is important to you, the soluution can be used as a replacement of gedit's own "recently used" overview. Since that seems out of reach, the solution below is a workaround.
Gedit command list code#
The cleanest solution would be of course to edit the code of gedit.
