From b5f1713c3e9fc2a78fa1048bd5e573150d138573 Mon Sep 17 00:00:00 2001 From: Piotr Miller Date: Wed, 31 Jan 2024 10:50:44 +0100 Subject: [PATCH 1/9] add power icons --- img/exit.svg | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ img/poweroff.svg | 52 +++++++++++++++++++++++++++++++++++++ img/reboot.svg | 59 ++++++++++++++++++++++++++++++++++++++++++ img/sleep.svg | 52 +++++++++++++++++++++++++++++++++++++ 4 files changed, 230 insertions(+) create mode 100644 img/exit.svg create mode 100644 img/poweroff.svg create mode 100644 img/reboot.svg create mode 100644 img/sleep.svg diff --git a/img/exit.svg b/img/exit.svg new file mode 100644 index 0000000..f6db074 --- /dev/null +++ b/img/exit.svg @@ -0,0 +1,67 @@ + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/img/poweroff.svg b/img/poweroff.svg new file mode 100644 index 0000000..14cef92 --- /dev/null +++ b/img/poweroff.svg @@ -0,0 +1,52 @@ + + + + + + + + image/svg+xml + + + + + + diff --git a/img/reboot.svg b/img/reboot.svg new file mode 100644 index 0000000..265a119 --- /dev/null +++ b/img/reboot.svg @@ -0,0 +1,59 @@ + + + + + + + + image/svg+xml + + + + + + + + diff --git a/img/sleep.svg b/img/sleep.svg new file mode 100644 index 0000000..2110cb5 --- /dev/null +++ b/img/sleep.svg @@ -0,0 +1,52 @@ + + + + + + + + image/svg+xml + + + + + + From ffc256ba8709a36639567664c4ae38da69904702 Mon Sep 17 00:00:00 2001 From: piotr Date: Thu, 1 Feb 2024 01:09:13 +0100 Subject: [PATCH 2/9] fix Makefile; modify icons --- Makefile | 5 ++-- img/exit.svg | 41 +++++++++++++++----------------- img/lock.svg | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 24 deletions(-) create mode 100644 img/lock.svg diff --git a/Makefile b/Makefile index 14ae57e..3f72f2e 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,12 @@ install: sleep 1 mkdir -p /usr/share/nwg-drawer cp -r desktop-directories /usr/share/nwg-drawer + cp -r img /usr/share/nwg-drawer cp drawer.css /usr/share/nwg-drawer cp bin/nwg-drawer /usr/bin - cp LICENSE /usr/share/licenses/nwg-shell-drawer/LICENSE - cp README.md /usr/share/doc/nwg-shell-drawer/README.md + install -Dm 644 -t "/usr/share/licenses/nwg-drawer" LICENSE + install -Dm 644 -t "/usr/share/doc/nwg-drawer" README.md uninstall: rm -r /usr/share/nwg-drawer diff --git a/img/exit.svg b/img/exit.svg index f6db074..7a36f22 100644 --- a/img/exit.svg +++ b/img/exit.svg @@ -5,7 +5,7 @@ viewBox="0 0 48 48" height="48" width="48" - sodipodi:docname="exit.svg" + sodipodi:docname="exit1.svg" inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" @@ -23,16 +23,23 @@ inkscape:pageopacity="0.0" inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" - inkscape:zoom="11.039097" - inkscape:cx="24.005586" - inkscape:cy="27.085548" - inkscape:window-width="1912" - inkscape:window-height="1012" + inkscape:zoom="9.4201949" + inkscape:cx="17.197096" + inkscape:cy="24.256398" + inkscape:window-width="2552" + inkscape:window-height="1372" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="svg8" - showgrid="false" /> + showgrid="false" + showguides="true"> + + - - - - + d="M 24 4 C 12.954338 4 4 12.954338 4 24 C 4 35.045662 12.954338 44 24 44 C 31.79942 44 38.549265 39.531179 41.845703 33.017578 L 40.427734 33.017578 C 37.240509 38.816001 31.084255 42.75 24 42.75 C 13.644691 42.75 5.25 34.355309 5.25 24 C 5.25 13.644691 13.644691 5.25 24 5.25 C 31.084255 5.25 37.240509 9.1839991 40.427734 14.982422 L 41.845703 14.982422 C 38.549265 8.4688214 31.79942 4 24 4 z " /> + diff --git a/img/lock.svg b/img/lock.svg new file mode 100644 index 0000000..372c46a --- /dev/null +++ b/img/lock.svg @@ -0,0 +1,66 @@ + + + + + + + + image/svg+xml + + + + + + + + + From db265ccf6a10277df85239da9c176d17aa8c53ee Mon Sep 17 00:00:00 2001 From: piotr Date: Thu, 1 Feb 2024 01:09:57 +0100 Subject: [PATCH 3/9] update dependencies --- go.mod | 4 ++-- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 7e9d8b3..777d174 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,6 @@ require ( require ( github.com/joshuarubin/lifecycle v1.1.4 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.16.0 // indirect ) diff --git a/go.sum b/go.sum index bc2aaf4..cc896ad 100644 --- a/go.sum +++ b/go.sum @@ -36,12 +36,16 @@ golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From 01c26ba092cf7c9b34240a749e76ffb2a548fd6d Mon Sep 17 00:00:00 2001 From: piotr Date: Thu, 1 Feb 2024 03:52:56 +0100 Subject: [PATCH 4/9] add powerButton function --- main.go | 33 +++++++++++++++++++++++++++++++++ uicomponents.go | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/main.go b/main.go index 31fd0e7..56e445f 100644 --- a/main.go +++ b/main.go @@ -171,6 +171,11 @@ var nameLimit = flag.Int("fslen", 80, "File Search name LENgth Limit") var noCats = flag.Bool("nocats", false, "Disable filtering by category") var noFS = flag.Bool("nofs", false, "Disable file search") var resident = flag.Bool("r", false, "Leave the program resident in memory") +var cmdExit = flag.String("cmdexit", "", "command for the Exit power bar icon") +var cmdLock = flag.String("cmdlock", "", "command for the Lock power bar icon") +var cmdPoweroff = flag.String("cmdpoweroff", "", "command for the Poweroff power bar icon") +var cmdReboot = flag.String("cmdreboot", "", "command for the Reboot power bar icon") +var cmdSleep = flag.String("cmdsleep", "", "command for the sleep power bar icon") var debug = flag.Bool("d", false, "Turn on Debug messages") func main() { @@ -559,6 +564,34 @@ func main() { resultsWrapper.PackEnd(wrapper, false, false, 10) } + // Power Button Bar + if *cmdExit != "" || *cmdLock != "" || *cmdPoweroff != "" || *cmdReboot != "" || *cmdSleep != "" { + powerBarWrapper, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0) + outerVBox.PackStart(powerBarWrapper, false, false, 0) + powerButtonsWrapper, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0) + powerBarWrapper.PackStart(powerButtonsWrapper, true, false, 6) + if *cmdLock != "" { + btn := powerButton("/usr/share/nwg-drawer/img/lock.svg", *cmdLock) + powerButtonsWrapper.PackStart(btn, true, false, 0) + } + if *cmdExit != "" { + btn := powerButton("/usr/share/nwg-drawer/img/exit.svg", *cmdExit) + powerButtonsWrapper.PackStart(btn, true, false, 0) + } + if *cmdReboot != "" { + btn := powerButton("/usr/share/nwg-drawer/img/reboot.svg", *cmdReboot) + powerButtonsWrapper.PackStart(btn, true, false, 0) + } + if *cmdSleep != "" { + btn := powerButton("/usr/share/nwg-drawer/img/sleep.svg", *cmdSleep) + powerButtonsWrapper.PackStart(btn, true, false, 0) + } + if *cmdPoweroff != "" { + btn := powerButton("/usr/share/nwg-drawer/img/poweroff.svg", *cmdPoweroff) + powerButtonsWrapper.PackStart(btn, true, false, 0) + } + } + statusLineWrapper, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0) statusLineWrapper.SetProperty("name", "status-line-wrapper") outerVBox.PackStart(statusLineWrapper, false, false, 10) diff --git a/uicomponents.go b/uicomponents.go index 9000c38..4b3b55b 100644 --- a/uicomponents.go +++ b/uicomponents.go @@ -287,6 +287,43 @@ func flowBoxButton(entry desktopEntry) *gtk.Button { return button } +func powerButton(iconPath, command string) *gtk.Button { + button, _ := gtk.ButtonNew() + button.SetAlwaysShowImage(true) + + var pixbuf *gdk.Pixbuf + var img *gtk.Image + var err error + //pixbuf, err = createPixbuf(iconPath, *iconSize) + pixbuf, err = gdk.PixbufNewFromFileAtSize(iconPath, *iconSize, *iconSize) + if err != nil { + pixbuf, _ = createPixbuf("unknown", *iconSize) + log.Warnf("Couldn't find icon %s", iconPath) + } + img, _ = gtk.ImageNewFromPixbuf(pixbuf) + button.SetImage(img) + button.SetImagePosition(gtk.POS_TOP) + + button.Connect("button-release-event", func(btn *gtk.Button, e *gdk.Event) bool { + btnEvent := gdk.EventButtonNewFromEvent(e) + if btnEvent.Button() == 1 { + launch(command, false) + return true + } + return false + }) + button.Connect("activate", func() { + launch(command, false) + }) + button.Connect("enter-notify-event", func() { + statusLabel.SetText(command) + }) + button.Connect("focus-in-event", func() { + statusLabel.SetText(command) + }) + return button +} + func setUpFileSearchResultContainer() *gtk.FlowBox { if fileSearchResultFlowBox != nil { fileSearchResultFlowBox.Destroy() From 6da67872723777b77a7f8c1bd9607b5e87c4875e Mon Sep 17 00:00:00 2001 From: piotr Date: Thu, 1 Feb 2024 04:09:31 +0100 Subject: [PATCH 5/9] add powerButton size argument --- main.go | 35 ++++++++++++++++++----------------- uicomponents.go | 4 ++-- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/main.go b/main.go index 56e445f..1e76117 100644 --- a/main.go +++ b/main.go @@ -171,11 +171,12 @@ var nameLimit = flag.Int("fslen", 80, "File Search name LENgth Limit") var noCats = flag.Bool("nocats", false, "Disable filtering by category") var noFS = flag.Bool("nofs", false, "Disable file search") var resident = flag.Bool("r", false, "Leave the program resident in memory") -var cmdExit = flag.String("cmdexit", "", "command for the Exit power bar icon") -var cmdLock = flag.String("cmdlock", "", "command for the Lock power bar icon") -var cmdPoweroff = flag.String("cmdpoweroff", "", "command for the Poweroff power bar icon") -var cmdReboot = flag.String("cmdreboot", "", "command for the Reboot power bar icon") -var cmdSleep = flag.String("cmdsleep", "", "command for the sleep power bar icon") +var pbExit = flag.String("pbexit", "", "command for the Exit power bar icon") +var pbLock = flag.String("pblock", "", "command for the Lock power bar icon") +var pbPoweroff = flag.String("pbpoweroff", "", "command for the Poweroff power bar icon") +var pbReboot = flag.String("pbreboot", "", "command for the Reboot power bar icon") +var pbSleep = flag.String("pbsleep", "", "command for the sleep power bar icon") +var pbSize = flag.Int("pbsize", 64, "power bar icon size") var debug = flag.Bool("d", false, "Turn on Debug messages") func main() { @@ -565,29 +566,29 @@ func main() { } // Power Button Bar - if *cmdExit != "" || *cmdLock != "" || *cmdPoweroff != "" || *cmdReboot != "" || *cmdSleep != "" { + if *pbExit != "" || *pbLock != "" || *pbPoweroff != "" || *pbReboot != "" || *pbSleep != "" { powerBarWrapper, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0) outerVBox.PackStart(powerBarWrapper, false, false, 0) powerButtonsWrapper, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0) - powerBarWrapper.PackStart(powerButtonsWrapper, true, false, 6) - if *cmdLock != "" { - btn := powerButton("/usr/share/nwg-drawer/img/lock.svg", *cmdLock) + powerBarWrapper.PackStart(powerButtonsWrapper, true, false, 12) + if *pbLock != "" { + btn := powerButton("/usr/share/nwg-drawer/img/lock.svg", *pbLock) powerButtonsWrapper.PackStart(btn, true, false, 0) } - if *cmdExit != "" { - btn := powerButton("/usr/share/nwg-drawer/img/exit.svg", *cmdExit) + if *pbExit != "" { + btn := powerButton("/usr/share/nwg-drawer/img/exit.svg", *pbExit) powerButtonsWrapper.PackStart(btn, true, false, 0) } - if *cmdReboot != "" { - btn := powerButton("/usr/share/nwg-drawer/img/reboot.svg", *cmdReboot) + if *pbReboot != "" { + btn := powerButton("/usr/share/nwg-drawer/img/reboot.svg", *pbReboot) powerButtonsWrapper.PackStart(btn, true, false, 0) } - if *cmdSleep != "" { - btn := powerButton("/usr/share/nwg-drawer/img/sleep.svg", *cmdSleep) + if *pbSleep != "" { + btn := powerButton("/usr/share/nwg-drawer/img/sleep.svg", *pbSleep) powerButtonsWrapper.PackStart(btn, true, false, 0) } - if *cmdPoweroff != "" { - btn := powerButton("/usr/share/nwg-drawer/img/poweroff.svg", *cmdPoweroff) + if *pbPoweroff != "" { + btn := powerButton("/usr/share/nwg-drawer/img/poweroff.svg", *pbPoweroff) powerButtonsWrapper.PackStart(btn, true, false, 0) } } diff --git a/uicomponents.go b/uicomponents.go index 4b3b55b..7856137 100644 --- a/uicomponents.go +++ b/uicomponents.go @@ -295,9 +295,9 @@ func powerButton(iconPath, command string) *gtk.Button { var img *gtk.Image var err error //pixbuf, err = createPixbuf(iconPath, *iconSize) - pixbuf, err = gdk.PixbufNewFromFileAtSize(iconPath, *iconSize, *iconSize) + pixbuf, err = gdk.PixbufNewFromFileAtSize(iconPath, *pbSize, *pbSize) if err != nil { - pixbuf, _ = createPixbuf("unknown", *iconSize) + pixbuf, _ = createPixbuf("unknown", *pbSize) log.Warnf("Couldn't find icon %s", iconPath) } img, _ = gtk.ImageNewFromPixbuf(pixbuf) From b0dc1404e7f96ddb1505cb44ee40c367c63cf019 Mon Sep 17 00:00:00 2001 From: piotr Date: Thu, 1 Feb 2024 04:14:42 +0100 Subject: [PATCH 6/9] formatting --- main.go | 1 + uicomponents.go | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 1e76117..6c2fa55 100644 --- a/main.go +++ b/main.go @@ -571,6 +571,7 @@ func main() { outerVBox.PackStart(powerBarWrapper, false, false, 0) powerButtonsWrapper, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0) powerBarWrapper.PackStart(powerButtonsWrapper, true, false, 12) + if *pbLock != "" { btn := powerButton("/usr/share/nwg-drawer/img/lock.svg", *pbLock) powerButtonsWrapper.PackStart(btn, true, false, 0) diff --git a/uicomponents.go b/uicomponents.go index 7856137..65e2d6b 100644 --- a/uicomponents.go +++ b/uicomponents.go @@ -294,7 +294,6 @@ func powerButton(iconPath, command string) *gtk.Button { var pixbuf *gdk.Pixbuf var img *gtk.Image var err error - //pixbuf, err = createPixbuf(iconPath, *iconSize) pixbuf, err = gdk.PixbufNewFromFileAtSize(iconPath, *pbSize, *pbSize) if err != nil { pixbuf, _ = createPixbuf("unknown", *pbSize) From 7b2ed76fac9d50c8660124f7fda023c31f74977f Mon Sep 17 00:00:00 2001 From: Piotr Miller Date: Thu, 1 Feb 2024 09:48:06 +0100 Subject: [PATCH 7/9] update lock icon --- img/lock.svg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/img/lock.svg b/img/lock.svg index 372c46a..47b5caf 100644 --- a/img/lock.svg +++ b/img/lock.svg @@ -24,10 +24,10 @@ inkscape:pagecheckerboard="0" inkscape:deskcolor="#d1d1d1" inkscape:zoom="16.208306" - inkscape:cx="23.876647" - inkscape:cy="20.76096" - inkscape:window-width="2552" - inkscape:window-height="1372" + inkscape:cx="18.447332" + inkscape:cy="19.43448" + inkscape:window-width="1912" + inkscape:window-height="1012" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" @@ -55,12 +55,12 @@ id="path2" style="color:#000000;opacity:1;fill:#f2f2f2;fill-opacity:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:2;-inkscape-stroke:none" d="M 4.28125 20.666016 C 4.0995845 21.748484 4 22.858366 4 23.992188 C 4 35.02783 12.958497 43.986328 23.994141 43.986328 C 35.029785 43.986328 43.988281 35.02783 43.988281 23.992188 C 43.988281 22.858366 43.888701 21.748484 43.707031 20.666016 L 43.542969 20.666016 L 42.566406 20.666016 L 5.421875 20.666016 L 4.5546875 20.666016 L 4.28125 20.666016 z M 5.2597656 21.791016 L 42.728516 21.791016 C 42.813924 22.51349 42.863281 23.246468 42.863281 23.992188 C 42.863281 34.419838 34.421791 42.861328 23.994141 42.861328 C 13.566489 42.861328 5.125 34.419838 5.125 23.992188 C 5.125 23.246468 5.1743575 22.51349 5.2597656 21.791016 z " /> - + From 8e02b59f83384d8634fac0e6e37bd2371c5fb879 Mon Sep 17 00:00:00 2001 From: piotr Date: Thu, 1 Feb 2024 18:24:14 +0100 Subject: [PATCH 8/9] clear status label on button exit --- uicomponents.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/uicomponents.go b/uicomponents.go index 65e2d6b..6997570 100644 --- a/uicomponents.go +++ b/uicomponents.go @@ -281,6 +281,9 @@ func flowBoxButton(entry desktopEntry) *gtk.Button { button.Connect("enter-notify-event", func() { statusLabel.SetText(desc) }) + button.Connect("leave-notify-event", func() { + statusLabel.SetText("") + }) button.Connect("focus-in-event", func() { statusLabel.SetText(desc) }) @@ -317,6 +320,9 @@ func powerButton(iconPath, command string) *gtk.Button { button.Connect("enter-notify-event", func() { statusLabel.SetText(command) }) + button.Connect("leave-notify-event", func() { + statusLabel.SetText("") + }) button.Connect("focus-in-event", func() { statusLabel.SetText(command) }) From ff34cf8194e567f14c36bd1ae5e683a50bf3a882 Mon Sep 17 00:00:00 2001 From: piotr Date: Fri, 2 Feb 2024 01:39:58 +0100 Subject: [PATCH 9/9] fix finding userDirsFile --- tools.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools.go b/tools.go index 4d0e16c..98c71b7 100644 --- a/tools.go +++ b/tools.go @@ -78,7 +78,7 @@ func mapXdgUserDirs() map[string]string { result["pictures"] = filepath.Join(home, "Pictures") result["videos"] = filepath.Join(home, "Videos") - userDirsFile := filepath.Join(filepath.Join(os.Getenv("XDG_CONFIG_HOME"), "user-dirs.dirs")) + userDirsFile := filepath.Join(filepath.Join(configHome(), "user-dirs.dirs")) if pathExists(userDirsFile) { log.Debugf("userDirsFile found: %s", userDirsFile) log.Info(fmt.Sprintf("Using XDG user dirs from %s", userDirsFile)) @@ -166,6 +166,13 @@ func configDir() string { return dir } +func configHome() string { + if os.Getenv("XDG_CONFIG_HOME") != "" { + return os.Getenv("XDG_CONFIG_HOME") + } + return path.Join(os.Getenv("HOME"), ".config") +} + func dataDir() string { var dir string if xdgData := os.Getenv("XDG_DATA_HOME"); xdgData != "" {