Arun Prakash Jana
4eaf071fc2
Document NOICE_FALLBAK_OPENER.
8 years ago
Arun Prakash Jana
95ca9c3a95
Support NOICE_FALLBAK_OPENER.
8 years ago
Arun Prakash Jana
8b12ac4b5c
Support NOICE_OPENER env variable.
8 years ago
Arun Prakash Jana
2958ecd040
Remove libmagic, use file command.
The magic.mgc file gets created in the local directory, opening
the global file throws unwanted messages. So we are using the o/p
of the file command to determine if the file is a plain text file.
8 years ago
Arun Prakash Jana
8cb25227b3
Fix compilation issues with -O3 optimization.
8 years ago
Arun Prakash Jana
bc731cd9c0
Modify file type handling.
Use mpv, fmedia, zathura.
Invoke libmagic to identify text files and open with vim.
Use xdg-open for unhandled mimes.
8 years ago
sin
3ccbaef87b
Fix initscr() crash on NetBSD
NetBSD has its own curses implementation and initscr() does not
terminate with an error if TERM is not set properly.
Instead check the return value and exit if an initialization
error occurs.
8 years ago
sin
829bcdd7d4
Add command to cd back to HOME
Original patch written by Richard Hyde and taken from
https://github.com/RichardHyde/noice
9 years ago
sin
e1c26079b1
Add command to toggle hide .dot files
Patch written by Richard Hyde and taken from
https://github.com/RichardHyde/noice
9 years ago
sin
de1e3394a6
Style fix
9 years ago
sin
81ec260516
Fix strlcpy() size argument
It should be the size of the destination buffer, not the source.
In this case, both src and dest have the same size.
9 years ago
sin
afc0652067
Move mkpath() higher up so we don't need to declare it
9 years ago
sin
5629b49113
Move path[], oldpath[] and fltr[] inside browse()
9 years ago
sin
5456b8a36a
Minor style fix
9 years ago
sin
872a0f4620
Rename global `n` to `ndents`
This is more descriptive for a global variable which
can easily be shadowed.
9 years ago
sin
414ea845bb
Use dents name directly like we do in other places
9 years ago
sin
78461b8a06
Minor style fix
9 years ago
sin
c27f605a62
Nuke some newlines
9 years ago
sin
9af81fdc65
Remove some const bullshit
9 years ago
sin
35ca388e9d
Remove some more useless memory allocations
9 years ago
sin
9f6d1cfb33
Remove filter as you type mode
Nobody uses it and adds additional complexity.
9 years ago
sin
d909de605c
No need for cast in qsort callback
9 years ago
sin
65fae61bea
noice: No need to perform so many memory allocations
The code was quite fragile. As a first pass, use buffers of size
PATH_MAX and LINE_MAX accordingly until we simplify the overall logic.
9 years ago
sin
6d4166f0d6
Fix memory leak
9 years ago
sin
5fb5e9f82f
Avoid another allocation
9 years ago
sin
fa6b45a96d
Avoid unneeded memory allocation in xdirname()
9 years ago
sin
e27af6f1db
sizeof(char) is always 1, no need to be explicit
9 years ago
sin
a715201255
Print the resolved path for cwd
Avoids weird things like /etc/.. when displaying cwd.
Also no need for cwd to be on the heap.
9 years ago
sin
71ece08aad
Add usage
9 years ago
sin
013bcdee35
Don't use printerr() before curses has been initialized
9 years ago
sin
4abc9f0b46
Don't name vars in prototypes
9 years ago
sin
29701b4878
Rename makepath() to mkpath()
9 years ago
sin
16109053f5
Only use the environment variable when it is not empty
9 years ago
sin
7ceda4f7d2
Declare var at top of block
9 years ago
Martin Kühl
d1ed0cff11
Support commands specified by environment variables
Specifying commands by name in config.h means that
every time one switches ones editor (for example),
one has to modify every config.h file referencing that editor
and then recompile every corresponding program.
This change adds a string `env` for specifying an environment
variable to `struct key` and uses it to optionally specify the
command to run on SEL_{RUN,RUNARG}.
The `run` string is used as a fallback when the environment variable
has not been specified or is not set.
It also updates `config.def.h` to demonstrate this new capability.
9 years ago
sin
d1d086d91e
No need for strlen()
Thanks Hiltjo!
9 years ago
sin
8c04bea678
Add license pointer
9 years ago
sin
756b50be27
Restore screensaver mode
Disable timeout when in filter or type mode.
9 years ago
sin
9b47bfd9aa
Use wgetnstr() instead of getnstr() because IRIX lacks the latter
9 years ago
sin
30ca80310a
Properly handle empty filters
9 years ago
sin
ea0cce7b63
Make room for null-terminator
9 years ago
sin
f77b6a3fa6
Simplify readln()
Use getnstr() and be done with it. It will even beep now!
9 years ago
sin
d6e89ef07f
Revert "Run screensaver after a period of idleness"
This reverts commit 1e18b85e56
.
Revert until remaining issues are fixed. The filter search expires
after 1 second of inactivity without the revert.
9 years ago
sin
62736bf43a
Ignore SIGINT to allow returning back to noice when we kill the screensaver
Use 'q' to quit.
9 years ago
lostd
1e18b85e56
Run screensaver after a period of idleness
9 years ago
lostd
108996a802
Recall current item on refresh or sorting mode change
9 years ago
lostd
dcde076371
Add keys to move to the first and last entry
9 years ago
lostd
4db0d0dae0
We don't want to exit the typing mode because of an error
Delay displaying the message until return is pressed.
Also contain all printwarn() calls inside browse().
9 years ago
lostd
1742598256
Escape unreadable dirs we are already into
We care about the directory we are going to, so there is no reason
to get locked inside there if the parent is readable.
9 years ago
lostd
ac36d0b287
Refactor parts of browse() into populate() and redraw()
9 years ago