diff --git a/.gitignore b/.gitignore index c8c207b..e4f1c5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1 @@ -cf cfiles -build.ninja -CMakeCache.txt -.ninja_deps -.ninja_log -rules.ninja -cmake_install.cmake -CMakeFiles/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 376188d..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -cmake_minimum_required (VERSION 3.10) - -project(cfiles - VERSION 0.0.1 -) - -set(CMAKE_C_STANDARD 11) -set(CMAKE_C_STANDARD_REQUIRED ON) - -set(FLAGS "-ggdb -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls") -set(FLAGS "${FLAGS} -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security") -set(FLAGS "${FLAGS} -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self") -set(FLAGS "${FLAGS} -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type ") -set(FLAGS "${FLAGS} -Wno-switch -Wno-error=unused-parameter") -set(FLAGS "${FLAGS} -Wno-error=missing-field-initializers") - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}") - -#Runs pkg-config --libs --cflags ncurses -include(FindPkgConfig) -pkg_search_module(NCURSES REQUIRED ncurses) - -add_executable(cfiles - cf.c -) -target_include_directories(cfiles PRIVATE - ${NCURSES_INCLUDE_DIRS} -) -target_compile_definitions(cfiles PRIVATE - ${NCURSES_CFLAGS} -) -target_link_libraries(cfiles - ${NCURSES_LIBRARIES} -) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4b08681 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +CC = gcc +CFLAGS = -I. -Wall +LIBS = -lncurses +SRCS = cf.c +OBJS = $(SRCS: .c = .o) +PROG = cfiles +DEST = /usr/local/bin + +all: $(OBJS) + $(CC) $(CFLAGS) $(LIBS) $(OBJS) -o $(PROG) + +.c.o: + $(CC) $(CFLAGS) -c $< + +clean: + rm *.o + rm *~ + +install: + cp -v $(PROG) $(DEST) + +uninstall: + rm -v "$(DEST)/$(PROG)" diff --git a/README.md b/README.md index 0fe7db9..855e453 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,8 @@ minimal. - ncurses - `cp`and `mv` for copying and moving - `fzf` for searching -- `w3mimgdisplay` for image previews +- `w3mimgdisplay` or `Ɯberzug` for image previews - `xdg-open` for opening programs -- `vim` for renaming, bulk renaming and editing clipboard - `mediainfo` for viewing media info and file sizes - `sed` for removing a particular selection - `atool` for archive previews @@ -19,9 +18,13 @@ minimal. ## Compiling and Installation To compile, run - `gcc cf.c -lncurses -o cf` + `make` -To install, simply move the generated executable to a directory that is in your `$PATH` +and then run, + + `sudo make install` + +to install. ## Keybindings | Key | Function | diff --git a/build.sh b/build.sh deleted file mode 100755 index dbff000..0000000 --- a/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -e - -if [ ! -e build.ninja ] ; then - cmake -DCMAKE_BUILD_TYPE=Debug -GNinja CMakeLists.txt . -fi - -ninja $* diff --git a/cf.c b/cf.c index b3a5ec9..f749ef6 100644 --- a/cf.c +++ b/cf.c @@ -603,10 +603,6 @@ void getImgPreview(char *filepath, int maxy, int maxx) execl(DISPLAYIMG,DISPLAYIMG,arg1,arg2,arg3,arg4,filepath,(char *)NULL); exit(1); } - else - { - signal(SIGCHLD, SIG_IGN); - } }