LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-23-2018, 10:02 AM   #1
system001
Member
 
Registered: Nov 2018
Location: Portland Oregon Canada
Distribution: Kubuntu 19.04 - Manjaro 18.0
Posts: 199

Rep: Reputation: 15
Trying To Get Nemo File Manager To Remember And Open Saved Tabs


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 "
 
Old 12-25-2018, 03:03 PM   #2
system001
Member
 
Registered: Nov 2018
Location: Portland Oregon Canada
Distribution: Kubuntu 19.04 - Manjaro 18.0
Posts: 199

Original Poster
Rep: Reputation: 15
who in their right mind would pull post that were helpful? there was an answer to this telling me i misunderstood the post and i needed to create the script and run it, and a responce from me asking if i had everything else right and just needed to run nemo-tab.py and be good to go. whoever removed the post can restore them.
 
Old 12-25-2018, 07:01 PM   #3
system001
Member
 
Registered: Nov 2018
Location: Portland Oregon Canada
Distribution: Kubuntu 19.04 - Manjaro 18.0
Posts: 199

Original Poster
Rep: Reputation: 15
for the second time put back the two deleted post. i was using one to help me fix the issue i asked about. there was no legitimate reason for removing either post.
 
Old 12-26-2018, 02:52 PM   #4
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,602

Rep: Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084Reputation: 4084
To verify: no posts were removed from this thread.

--jeremy
 
Old 12-26-2018, 03:00 PM   #5
system001
Member
 
Registered: Nov 2018
Location: Portland Oregon Canada
Distribution: Kubuntu 19.04 - Manjaro 18.0
Posts: 199

Original Poster
Rep: Reputation: 15
To verify: yes post were removed from this thread.

system001
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can Firefox 5 remember open tabs in case of an accidental shutdown? LAPIII General 1 08-19-2011 03:19 PM
LXer: Nemo Review: A New File Manager for Linux LXer Syndicated Linux News 0 04-24-2008 05:30 PM
Can't open saved web pages just saved by web browser... JeanBrownHarrel General 2 04-06-2008 11:52 AM
LXer: Nemo file manager organizes around a calendar LXer Syndicated Linux News 0 12-10-2007 11:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration