Comments (4)
b spawn a shell in the current directory
Why not spawn a shell and run a command?
from sfm.
b spawn a shell in the current directory
Why not spawn a shell and run a command?
I have to type in the shell the name of the file. I thought the file manager was needed for this: in order not to type anything again.
from sfm.
diff --git a/config.def.h b/config.def.h
index 7e7c200..41880ee 100644
--- a/config.def.h
+++ b/config.def.h
@@ -54,12 +54,14 @@ static const char *mupdf[] = { "mupdf", "-I" };
static const char *libreoffice[] = { "libreoffice" };
static const char *gimp[] = { "gimp" };
static const char *r2[] = { "r2", "-c", "vv" };
+static const char *sh_cmd[] = { "sh" };
/* extensions*/
static const char *images[] = { "bmp", "jpg", "jpeg", "png", "gif", "webp", "xpm" };
static const char *pdf[] = { "epub", "pdf" };
static const char *arts[] = { "xcf" };
static const char *obj[] = { "o", "a", "so" };
+static const char *shell_ext[] = { "sh" };
static const char *videos[] = { "avi", "flv", "wav", "webm", "wma", "wmv",
"m2v", "m4a", "m4v", "mkv", "mov", "mp3",
"mp4", "mpeg", "mpg" };
@@ -73,6 +75,7 @@ static Rule rules[] = {
{documents, LEN(documents), libreoffice, LEN(libreoffice) },
{arts, LEN(arts), gimp, LEN(gimp) },
{obj, LEN(obj), r2, LEN(r2) },
+ {shell_ext, LEN(shell_ext), sh_cmd, LEN(sh_cmd) },
};
/* normal keys */
from sfm.
diff --git a/config.def.h b/config.def.h index 7aae364..d74de02 100644 --- a/config.def.h +++ b/config.def.h @@ -59,12 +59,14 @@ static const char *mupdf[] = { "mupdf" }; static const char *libreoffice[] = { "libreoffice" }; static const char *gimp[] = { "gimp" }; static const char *r2[] = { "r2", "-c", "vv" }; +static const char *sh[] = { "sh" }; /* extensions*/ static const char *images[] = { "bmp", "jpg", "jpeg", "png", "gif", "webp", "xpm" }; static const char *pdf[] = { "epub", "pdf" }; static const char *arts[] = { "xcf" }; static const char *obj[] = { "o", "a", "so" }; +static const char *shell_ext[] = { "sh" }; static const char *videos[] = { "avi", "flv", "wav", "webm", "wma", "wmv", "m2v", "m4a", "m4v", "mkv", "mov", "mp3", "mp4", "mpeg", "mpg" }; @@ -78,6 +80,7 @@ static Rule rules[] = { {documents, LEN(documents), libreoffice, LEN(libreoffice) }, {arts, LEN(arts), gimp, LEN(gimp) }, {obj, LEN(obj), r2, LEN(r2) }, + {shell_ext, LEN(shell_ext), sh, LEN(sh) }, }; /* normal keys */
[sfm-0.4]$ make
sfm build options:
CFLAGS = -std=c99 -pedantic -Wextra -Wall -Wno-unused-parameter -Os -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DVERSION="0.4"
LDFLAGS = -pthread -s
CC = cc
cc -c -std=c99 -pedantic -Wextra -Wall -Wno-unused-parameter -Os -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DVERSION=\"0.4\" sfm.c
In file included from sfm.c:227:
config.h:57:20: error: conflicting types for 'sh'; have 'const char *[]'
57 | static const char *sh[] = { "sh"};
| ^~
sfm.c:200:13: note: previous definition of 'sh' with type 'char[8]'
200 | static char sh[] = "/bin/sh";
| ^~
sfm.c: In function 'get_shell':
sfm.c:1875:26: warning: assignment to 'char *' from incompatible pointer type 'const char **' [-Wincompatible-pointer-types]
1875 | shell[0] = sh;
| ^
sfm.c: At top level:
sfm.c:200:13: warning: 'sh' defined but not used [-Wunused-variable]
200 | static char sh[] = "/bin/sh";
| ^~
make: *** [Makefile:18: sfm.o] Error 1
from sfm.
Related Issues (20)
- Scrolling doesn't work properly HOT 2
- **replace strncmp**
- Breakage HOT 26
- No correct selection line re-drawing in fullscreen HOT 3
- sfm terminated by signal SIGABRT HOT 4
- Can't open sfm in DWM HOT 11
- Buffer overflow on symlinks HOT 3
- Shell access from the file manager
- Issue with opening sfm from a script/dmenu HOT 2
- Custom colors HOT 3
- Renaming of files HOT 1
- Aborted (core dumped)
- Non-latin file names are truncated HOT 5
- how to open no extension file with vim HOT 1
- control c killing just mpv and not sfm HOT 1
- can use this as mi main file manager ? HOT 1
- 2 panes HOT 2
- [Feature request] - Add file type specific icons HOT 2
- have other pane to preview directory/files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sfm.