Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7681055a23 | ||
|
|
15c9029935 | ||
|
|
f67f1a9950 | ||
|
|
2c63e256ba | ||
|
|
92095d5b97 | ||
|
|
a6977d9444 | ||
|
|
378aa33cf3 | ||
|
|
9d6d572f72 | ||
|
|
8fdb174643 |
@@ -21,10 +21,12 @@ and `nwggrid`.
|
|||||||
|
|
||||||
[](https://repology.org/project/nwg-drawer/versions)
|
[](https://repology.org/project/nwg-drawer/versions)
|
||||||
|
|
||||||
|
To close the window w/o running a program, you may use `Esc` key, or right-click the window next to the icons.
|
||||||
|
|
||||||
## v0.2.x note
|
## v0.2.x note
|
||||||
|
|
||||||
1. Placing config files in the nwg-panel config directory was a mistake, sorry. The 0.2.0 version migrates them to `~/.config/nwg-drawer`.
|
1. Placing config files in the nwg-panel config directory was a mistake, sorry. The 0.2.0 version migrates them to `~/.config/nwg-drawer`.
|
||||||
2. From now on you may run the program residently, which should speed it up. See "Running" below.
|
2. From now on you may run the program residently, which should speed it up (but also occupy some resources!). See "Running" below.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -38,7 +40,7 @@ and `nwggrid`.
|
|||||||
Optional (recommended):
|
Optional (recommended):
|
||||||
|
|
||||||
- thunar
|
- thunar
|
||||||
- alacritty
|
- foot
|
||||||
|
|
||||||
You may use another file manager and terminal emulator (see command line arguments), but mentioned above have been
|
You may use another file manager and terminal emulator (see command line arguments), but mentioned above have been
|
||||||
confirmed to work well with the program. Also see **Files** below.
|
confirmed to work well with the program. Also see **Files** below.
|
||||||
|
|||||||
BIN
bin/nwg-drawer
BIN
bin/nwg-drawer
Binary file not shown.
22
main.go
22
main.go
@@ -21,7 +21,7 @@ import (
|
|||||||
"github.com/gotk3/gotk3/gtk"
|
"github.com/gotk3/gotk3/gtk"
|
||||||
)
|
)
|
||||||
|
|
||||||
const version = "0.2.3"
|
const version = "0.2.5"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
appDirs []string
|
appDirs []string
|
||||||
@@ -251,6 +251,7 @@ func main() {
|
|||||||
pinned, err = loadTextFile(pinnedFile)
|
pinned, err = loadTextFile(pinnedFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pinned = nil
|
pinned = nil
|
||||||
|
savePinned()
|
||||||
}
|
}
|
||||||
log.Info(fmt.Sprintf("Found %v pinned items", len(pinned)))
|
log.Info(fmt.Sprintf("Found %v pinned items", len(pinned)))
|
||||||
|
|
||||||
@@ -351,8 +352,7 @@ func main() {
|
|||||||
|
|
||||||
win.Connect("key-release-event", func(window *gtk.Window, event *gdk.Event) bool {
|
win.Connect("key-release-event", func(window *gtk.Window, event *gdk.Event) bool {
|
||||||
key := &gdk.EventKey{Event: event}
|
key := &gdk.EventKey{Event: event}
|
||||||
switch key.KeyVal() {
|
if key.KeyVal() == gdk.KEY_Escape {
|
||||||
case gdk.KEY_Escape:
|
|
||||||
s, _ := searchEntry.GetText()
|
s, _ := searchEntry.GetText()
|
||||||
if s != "" {
|
if s != "" {
|
||||||
searchEntry.GrabFocus()
|
searchEntry.GrabFocus()
|
||||||
@@ -365,15 +365,22 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
|
||||||
|
win.Connect("key-press-event", func(window *gtk.Window, event *gdk.Event) bool {
|
||||||
|
key := &gdk.EventKey{Event: event}
|
||||||
|
switch key.KeyVal() {
|
||||||
case gdk.KEY_downarrow, gdk.KEY_Up, gdk.KEY_Down, gdk.KEY_Left, gdk.KEY_Right, gdk.KEY_Tab,
|
case gdk.KEY_downarrow, gdk.KEY_Up, gdk.KEY_Down, gdk.KEY_Left, gdk.KEY_Right, gdk.KEY_Tab,
|
||||||
gdk.KEY_Return, gdk.KEY_Page_Up, gdk.KEY_Page_Down, gdk.KEY_Home, gdk.KEY_End:
|
gdk.KEY_Return, gdk.KEY_Page_Up, gdk.KEY_Page_Down, gdk.KEY_Home, gdk.KEY_End:
|
||||||
return true
|
return false
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if !searchEntry.IsFocus() {
|
if !searchEntry.IsFocus() {
|
||||||
searchEntry.GrabFocusWithoutSelecting()
|
searchEntry.GrabFocusWithoutSelecting()
|
||||||
}
|
}
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -419,7 +426,7 @@ func main() {
|
|||||||
|
|
||||||
resultWindow.Connect("button-release-event", func(sw *gtk.ScrolledWindow, e *gdk.Event) bool {
|
resultWindow.Connect("button-release-event", func(sw *gtk.ScrolledWindow, e *gdk.Event) bool {
|
||||||
btnEvent := gdk.EventButtonNewFromEvent(e)
|
btnEvent := gdk.EventButtonNewFromEvent(e)
|
||||||
if btnEvent.Button() == 1 || btnEvent.Button() == 3 {
|
if btnEvent.Button() == 3 {
|
||||||
if !*resident {
|
if !*resident {
|
||||||
gtk.MainQuit()
|
gtk.MainQuit()
|
||||||
} else {
|
} else {
|
||||||
@@ -488,6 +495,9 @@ func main() {
|
|||||||
glib.TimeoutAdd(uint(1), func() bool {
|
glib.TimeoutAdd(uint(1), func() bool {
|
||||||
if showWindowTrigger && win != nil && !win.IsVisible() {
|
if showWindowTrigger && win != nil && !win.IsVisible() {
|
||||||
win.ShowAll()
|
win.ShowAll()
|
||||||
|
if fileSearchResultWrapper != nil {
|
||||||
|
fileSearchResultWrapper.Hide()
|
||||||
|
}
|
||||||
// focus 1st element
|
// focus 1st element
|
||||||
b := appFlowBox.GetChildAtIndex(0)
|
b := appFlowBox.GetChildAtIndex(0)
|
||||||
if b != nil {
|
if b != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user