aboutsummaryrefslogtreecommitdiff
path: root/modules/computer/filesystem.c
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2021-02-21 12:06:15 -0800
committerLeandro Pereira <leandro@hardinfo.org>2021-02-21 12:06:15 -0800
commit78b4b74d5716a00a8e3493d39c64b258cd7cf7a3 (patch)
treeaf13efd50f04e046ce844c2d273aaaae87194099 /modules/computer/filesystem.c
parent62e6fb7bf1a9cccd27dd9a555f046db0520dd345 (diff)
Show a padlock emoji next to read-only mount points
Diffstat (limited to 'modules/computer/filesystem.c')
-rw-r--r--modules/computer/filesystem.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/computer/filesystem.c b/modules/computer/filesystem.c
index 397dc636..78faf5fe 100644
--- a/modules/computer/filesystem.c
+++ b/modules/computer/filesystem.c
@@ -71,6 +71,8 @@ scan_filesystems(void)
gchar *strhash;
+ gboolean rw = strstr(tmp[3], "rw") != NULL;
+
strreplacechr(tmp[0], "#", '_');
strhash = g_strdup_printf("[%s]\n"
"%s=%s\n"
@@ -81,7 +83,7 @@ scan_filesystems(void)
"%s=%s\n",
tmp[0], /* path */
_("Filesystem"), tmp[2],
- _("Mounted As"), ( strstr(tmp[3], "rw") != NULL) ? _("Read-Write") : _("Read-Only"),
+ _("Mounted As"), rw ? _("Read-Write") : _("Read-Only"),
_("Mount Point"), tmp[1],
_("Size"), strsize,
_("Used"), strused,
@@ -90,9 +92,10 @@ scan_filesystems(void)
moreinfo_add_with_prefix("COMP", key, strhash);
g_free(key);
- fs_list = h_strdup_cprintf("$FS%d$%s=%.2f %% (%s of %s)|%s\n",
+ fs_list = h_strdup_cprintf("$FS%d$%s%s=%.2f %% (%s of %s)|%s\n",
fs_list,
- count, tmp[0], use_ratio, stravail, strsize, tmp[1]);
+ count, tmp[0], rw ? "" : "🔒",
+ use_ratio, stravail, strsize, tmp[1]);
g_free(strsize);
g_free(stravail);