diff options
Diffstat (limited to 'c_init.go')
-rw-r--r-- | c_init.go | 32 |
1 files changed, 4 insertions, 28 deletions
@@ -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 |