노틸러스 창의 현재 디렉토리를 얻는 방법이 있습니까?

노틸러스 창의 현재 디렉토리를 얻는 방법이 있습니까?

Bash 스크립트에서 노틸러스 창을 엽니다.nautilus --new-window .

현재 열려 있는 디렉토리를 계속 읽으려면 어떻게 해야 합니까(어딘가를 탐색한 후에도)?

답변1

노틸러스 창의 탭에서 현재 폴더를 변경할 때 이를 사용하여 dbus-monitor관련 이벤트를 모니터링 할 수 있습니다.

dbus-monitor "
  type='signal',
  interface='org.freedesktop.DBus.Properties',
  path='/org/freedesktop/FileManager1',
  member='PropertiesChanged'" |
  awk -F '"' '
    $2 ~ "^/org/gnome/Nautilus/window/[[:digit:]]+$" {
      window = $2
      sub(".*/", "", window)
      tab = 0
      next
    }
    window && /string / {
      print window"."++tab": "$2
      next
    }
    tab {window = 0}'

다음과 같이 인쇄하세요:

2.1: file:///export/home/stephane/Desktop/untitled%20folder
2.2: file:///export/home/stephane/Downloads
1.1: trash:///

(예: 두 번째 , 첫 번째2.1 탭을 의미 ) 노틸러스 창의 탭에서 폴더를 변경할 때마다.

관련 정보