-
Notifications
You must be signed in to change notification settings - Fork 1
/
nautilus
executable file
·83 lines (62 loc) · 2.93 KB
/
nautilus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
# Copyright (C) 2021 Rodrigo Silva (MestreLion) <[email protected]>
# License: GPLv3 or later. See <http://www.gnu.org/licenses/gpl.html>
# -----------------------------------------------------------------------------
DESCRIPTION='Nautilus preferences'
ARGS=
setuplib=${SETUP_LIB_PATH:-"$(dirname "$(readlink -f "$0")")"/../setuplib}
# shellcheck source=../setuplib
if [[ -r "$setuplib" ]]; then source "$setuplib"; else
echo "Setup library not found: $setuplib" >&2; exit 1;
fi
include gsettings
# -----------------------------------------------------------------------------
include=("${SETUP_NAUTILUS_INCLUDE[@]}"); debugvar include
remove=( "${SETUP_NAUTILUS_REMOVE[@]}"); debugvar remove
# -----------------------------------------------------------------------------
#/org/gnome/nautilus/list-view/use-tree-view
# true
#/org/gnome/nautilus/preferences/show-create-link
# true
#/org/gnome/nautilus/preferences/date-time-format
# 'detailed'
#/org/gnome/nautilus/preferences/default-folder-viewer
# 'list-view'
#/org/gnome/nautilus/list-view/default-column-order
# ['name', 'size', 'type', 'owner', 'group', 'permissions', 'date_modified', 'date_accessed', 'date_created', 'recency', 'detailed_type']
#/org/gnome/nautilus/list-view/default-visible-columns
# ['name', 'size', 'type', 'owner', 'group', 'permissions', 'date_modified', 'detailed_type']
try nautilus -q
gsrootpath=org.gnome.nautilus
# Change settings
gsettings set "$gsrootpath".preferences default-folder-viewer 'list-view'
gsettings set "$gsrootpath".window-state maximized true
gsettings array insert "$gsrootpath".list-view default-column-order s mime_type after type
gsettings array include "$gsrootpath".list-view default-visible-columns s "${include[@]}"
gsettings array remove "$gsrootpath".list-view default-visible-columns s "${remove[@]}"
# Nautilus automatically sort default-visible-columns based on default-column-order
# when Preferences dialog is opened, so we don't have to worry about doing it now
# Reference:
# default-visible-columns=['name', 'size', 'date_modified', 'starred']
# default-column-order=[
# 'name',
# 'size',
# 'type', # General, broad variant of mine_type
# 'owner',
# 'group',
# 'permissions',
# 'mime_type',
# 'where', # (Original) Location, only shows in 'Trash'
# 'date_modified', # Only shows time if < 1 day
# 'date_modified_with_time',
# 'date_accessed',
# 'recency', # Only shows in 'Recent Files'
# 'starred' # Added on Ubuntu 20.04 (3.36.3)
# ]
if version_lesser "$(nautilus --version | awk '{print $NF}')" 3.4.2; then
# Only up to Ubuntu 12.04, as many features were removed in 3.5 and 3.6.
# https://askubuntu.com/questions/286430
# https://askubuntu.com/questions/149890
gsettings set "$gsrootpath".preferences date-format 'iso'
gsettings set "$gsrootpath".window-state start-with-status-bar true
fi