Skip to content

Instantly share code, notes, and snippets.

View theScottyJam's full-sized avatar

Scotty Jamison theScottyJam

View GitHub Profile
@theScottyJam
theScottyJam / new.py
Last active September 27, 2021 05:13
This adds a "new file" menu item to the nautilus right-click menu for when you right click on a file. Place this file inside `~/.local/share/nautilus/scripts` and name it `new`. This script is useful for when you are using nautilus in list view, because nautilus currently doesn't show this menu item when right clicking on files.
#!/usr/bin/env python3
# https://superuser.com/a/1251013/57284
# https://gist.github.com/theScottyJam/ae19299c8d71a21c75f2abd96daea9f8
from pathlib import Path
import tkinter as tk
from tkinter import ttk
import os
import shutil