i followed the below tutorial and had no luck getting nemo to remember a group of tabs "opened bin as root, created the nemo-tab.py.,made it executable, installed xdotool and wmctrl, and beyond that i'm at a loss. thought rightclicking on bin, open in terminal, and entering nemo-tab.py "/home/mc2635599/Desktop/Shortcuts" would do the trick, but all it did was open a copy of the tab i already had open. once i did the 4th tab i wanted i exited terminal, closed nemo, relaunched nemo and no multiple tabs." help please.
"Yes this is very much possible. I use a python script for this task for my caja browser. I am reproducing the script here by replacing caja with nemo. Hopefully, it will directly work with nemo without any further changes."
Code:
#!/usr/bin/env python3
import subprocess
import time
import sys
get = lambda cmd: subprocess.check_output(["/bin/bash", "-c", cmd]).decode("utf-8")
def run(cmd):
subprocess.call(["/bin/bash", "-c", cmd])
try:
arg = sys.argv[1]
except:
arg = ""
try:
pid = get("pidof nemo").strip()
except subprocess.CalledProcessError:
run("nemo "+arg)
else:
w = [l.split() for l in get("wmctrl -lp").splitlines() if pid in l][-1]
w_id = w[0]
if len( [l for l in get("xprop -id "+w_id).splitlines() if all(
["_NET_WM_WINDOW_TYPE(ATOM)" in l, "_TYPE_NORMAL" in l])]) != 0:
run("wmctrl -ia "+w[0])
run("xdotool key Control_L+t")
if arg != "":
run("xdotool key Control_L+l")
time.sleep(0.2)
run("xdotool type "+arg)
time.sleep(0.01*len(arg))
run("xdotool key Return")
else:
run("nemo "+arg)
"Save this script as nemo-tab.py in your ~/bin directory or any other directory which you have in your path. Make it executable. Then, when you run this script it will open up a new tab in any current running nemo browser or start a new browser if no instance is running. You run it as following:"
Code:
nemo-tab.py "~/Documents"
"Now, for your case, you can issue the command five times in a bash script to load a nemo instance with 5 initial tabs:"
Code:
#!/bin/bash
nemo-tab.py "~/Documents"
nemo-tab.py "~/Desktop"
nemo-tab.py "~/media/data"
nemo-tab.py "~/Videos"
nemo-tab.py "~/Pictures"
"Note that you will need to install xdotool and wmctrl:"
Code:
sudo apt-get install xdotool wmctrl
"Source of Python script:
https://askubuntu.com/questions/6280...ab-in-nautilus "