浏览代码

Make toggle dot behaviour persistent

Once set, the default filter is updated.  This means that
toggle dot will also work as expected when noice is executed
as root.

Based on discussion with Ypnose.
master
sin 8 年前
父节点
当前提交
dd29e81df5
共有 2 个文件被更改,包括 8 次插入5 次删除
  1. +1
    -0
      config.def.h
  2. +7
    -5
      noice.c

+ 1
- 0
config.def.h 查看文件

@@ -5,6 +5,7 @@

int mtimeorder = 0; /* Set to 1 to sort by time modified */
int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
int showhidden = 0; /* Set to 1 to show hidden files by default */
char *idlecmd = "rain"; /* The screensaver program */

struct assoc assocs[] = {


+ 7
- 5
noice.c 查看文件

@@ -733,10 +733,9 @@ nochange:
DPRINTF_S(path);
goto begin;
case SEL_TOGGLEDOT:
if (strcmp(fltr, ifilter) != 0)
strlcpy(fltr, ifilter, sizeof(fltr));
else
strlcpy(fltr, ".", sizeof(fltr));
showhidden ^= 1;
ifilter = showhidden ? "." : "^[^.]";
strlcpy(fltr, ifilter, sizeof(fltr));
goto begin;
case SEL_MTIME:
mtimeorder = !mtimeorder;
@@ -795,9 +794,12 @@ main(int argc, char *argv[])
}

if (getuid() == 0)
showhidden = 1;

if (showhidden)
ifilter = ".";
else
ifilter = "^[^.]"; /* Hide dotfiles */
ifilter = "^[^.]";

if (argv[1] != NULL) {
ipath = argv[1];


正在加载...
取消
保存