0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gnome-fileでディレクトリごと個別のソート順情報を初期化したい

Last updated at Posted at 2019-02-21

基本

gnome等GUIのセッションで誰もログインしていない状態でsshなり仮想コンソールなりを用いてCUIでログインし「gio set」などのコマンドを用いて下記の作業を行う。

セッションが起動中(※後述)に下記の作業で値を初期化したりメタデータの保存ファイルを削除しても勝手に値が復活してしまう。

現在の設定を確認

$ gio info $TARGETDIR
metadata::nautilus-list-view-sort-column: date_accessed
metadata::nautilus-list-view-sort-reversed: true

nemoの場合はキー名がnemo-list-view-sort-columnなどになる。
gvfs-infoでも同様のことは出来るがdeprecated。

設定を初期化する

$ gio set $TARGETDIR metadata::nautilus-list-view-sort-column -t unset
$ gio set $TARGETDIR metadata::nautilus-list-view-sort-reversed -t unset

設定の初期化は「-t unset」になるのがポイント。自分で「date_modified」やら「-t boolean true」やらを設定することも可能。
gvfs-set-attributeでも同様のことは出来るがdeprecated。

その他gioの使い方は
https://developer.gnome.org/gio/stable/gio.html
を参照。

全てのディレクトリの設定を初期化

~/.local/share/gvfs-metadata
を削除で可能。ただしnautilus関連だけでなくnemo等その他のgvfs-metadataを用いている情報が全て初期化される。

※ログイン状態に関する補足

GUIでログインせずCUIで、と記述したが実際は恐らくユーザー権限で動いているgvfs関連のサービスが起動していない状態であれば問題ない。が、実際にどのサービスを落とせばいいのかまでは調べていない。多分サービスの名前からして「gvfs-metadata.service」なのかなぁとは思うのだけれど。

余談

自分の場合メインのPCにnomachine( https://www.nomachine.com/ )をインストールしていて、このサービスが裏でセッションをひとつ立ち上げてしまう仕様だったことから、CUIでのコマンド入力やファイル削除もかなり早い段階で試していたにもかかわらず何故か設定が巻き戻ってしまい大いに悩んだ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?