aboutsummaryrefslogtreecommitdiffstats
path: root/c_init.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2023-12-20 20:20:20 +0100
committerJoe <rbo@gmx.us>2023-12-20 20:20:20 +0100
commit126815f9aad4c841ada3c5b4c8db11200b52a8fe (patch)
treea79f53de45aaef34f4cbb644c3c415556c4cff74 /c_init.go
parentup (diff)
downloadhardflip-126815f9aad4c841ada3c5b4c8db11200b52a8fe.tar.gz
hardflip-126815f9aad4c841ada3c5b4c8db11200b52a8fe.tar.bz2
hardflip-126815f9aad4c841ada3c5b4c8db11200b52a8fe.tar.xz
hardflip-126815f9aad4c841ada3c5b4c8db11200b52a8fe.tar.zst
hardflip-126815f9aad4c841ada3c5b4c8db11200b52a8fe.zip
loop
Diffstat (limited to 'c_init.go')
-rw-r--r--c_init.go32
1 files changed, 4 insertions, 28 deletions
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