From 126815f9aad4c841ada3c5b4c8db11200b52a8fe Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 20 Dec 2023 20:20:20 +0100 Subject: loop --- c_init.go | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) (limited to 'c_init.go') diff --git a/c_init.go b/c_init.go index 5454928..5f49455 100644 --- a/c_init.go +++ b/c_init.go @@ -39,7 +39,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/c_init.go - * Fri, 15 Dec 2023 17:27:13 +0100 + * Wed Dec 20 10:47:33 2023 * Joe * * init functions @@ -48,37 +48,13 @@ package main import ( - "fmt" "os" "path/filepath" ) -// this function will go get the data folder and try to create it if it does -// not exist -// the first path being checked is $XDG_DATA_HOME then $HOME/.local/share -// it returns the full data directory path -func c_get_data_dir() string { - var ptr *string - var home string - if home = os.Getenv("HOME"); len(home) == 0 { - c_die("env variable HOME not defined", nil) - } - xdg_home := os.Getenv("XDG_DATA_HOME") - - if len(xdg_home) > 0 { - ptr = &xdg_home - } else { - ptr = &home - *ptr += "/.local/share" - } - *ptr += "/hardflip" - if _, err := os.Stat(*ptr); os.IsNotExist(err) { - if err := os.MkdirAll(*ptr, os.ModePerm); err != nil { - c_die("could not create path " + *ptr, err) - } - fmt.Println("created folder path " + *ptr) - } - return *ptr +type Opts struct { + icon bool + loop bool } // this function recurses into the specified root directory in order to load -- cgit v1.2.3