9 Commits

Author SHA1 Message Date
piotr
c0eb0965a8 update README.md 2024-10-26 00:58:25 +02:00
piotr
c940139fd9 add default styling for #math-result label #134 2024-10-26 00:43:34 +02:00
piotr
10b1b2a1e6 Merge remote-tracking branch 'origin/main' 2024-10-26 00:38:44 +02:00
piotr
b4b7d3486a add CSS ID to math result label #134 2024-10-26 00:38:20 +02:00
Piotr Miller
61a5595d84 Merge pull request #132 from msmafra/main
Update README.md
2024-10-15 11:27:46 +02:00
Marcelo dos Santos Mafra
cb44c7215f Update README.md
nwg-drawer seems to look in its own folder ~/.config/nwg-drawer for preferred-apps.json and excluded-dirs and not nwg-panel's folder
2024-10-11 17:59:30 -03:00
piotr
e7fafebf55 bump to 0.5.2 2024-10-09 02:12:19 +02:00
piotr
702cbb1c5c update golang.org/x/sys 2024-10-09 02:07:51 +02:00
piotr
7de2854041 set gtk-layer-shell namespace 2024-10-09 02:06:30 +02:00
6 changed files with 26 additions and 6 deletions

View File

@@ -172,7 +172,7 @@ Edit `~/.config/nwg-drawer/drawer.css` to your taste.
When the search phrase is at least 3 characters long, your XDG user directories are being searched. When the search phrase is at least 3 characters long, your XDG user directories are being searched.
Use the **left mouse button** to open a file with the `xdg-open` command. As configuring file associations for it is Use the **left mouse button** to open a file with the `xdg-open` command. As configuring file associations for it is
PITA, you may override them, by creating the `~/.config/nwg-panel/preferred-apps.json` file with your own definitions. PITA, you may override them, by creating the `~/.config/nwg-drawer/preferred-apps.json` file with your own definitions.
### Sample `preferred-apps.json` file content ### Sample `preferred-apps.json` file content
@@ -199,7 +199,7 @@ I've noy yet tried other file managers.
### File search exclusions ### File search exclusions
You may want to exclude some paths inside your XDG user directories from searching. If so, define exclusions in the You may want to exclude some paths inside your XDG user directories from searching. If so, define exclusions in the
`~/.config/nwg-panel/excluded-dirs` file, e.g. like this: `~/.config/nwg-drawer/excluded-dirs` file, e.g. like this:
```text ```text
# exclude all paths containing 'node_modules' # exclude all paths containing 'node_modules'
@@ -212,6 +212,16 @@ If the search box is not empty, and you press Enter, the search box content will
If the result is not an error, it will be displayed in a small window, and copied to the clipboard with wl-copy. If the result is not an error, it will be displayed in a small window, and copied to the clipboard with wl-copy.
Press any key to close the window. Press any key to close the window.
You may change the result label styling e.g. like this:
```css
/* math operation result label */
#math-label {
font-weight: bold;
font-size: 16px
}
```
## Credits ## Credits
This program uses some great libraries: This program uses some great libraries:

View File

@@ -32,3 +32,9 @@ button:hover {
border: 1px dotted gray; border: 1px dotted gray;
border-radius: 15px border-radius: 15px
} }
/* math operation result label */
#math-label {
font-weight: bold;
font-size: 16px
}

2
go.mod
View File

@@ -16,5 +16,5 @@ require (
github.com/joshuarubin/lifecycle v1.1.4 // indirect github.com/joshuarubin/lifecycle v1.1.4 // indirect
go.uber.org/multierr v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect
golang.org/x/sync v0.8.0 // indirect golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect golang.org/x/sys v0.26.0 // indirect
) )

2
go.sum
View File

@@ -39,6 +39,8 @@ golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

View File

@@ -22,7 +22,7 @@ import (
"github.com/gotk3/gotk3/gtk" "github.com/gotk3/gotk3/gtk"
) )
const version = "0.5.1" const version = "0.5.2"
var ( var (
appDirs []string appDirs []string
@@ -433,6 +433,7 @@ func main() {
if wayland() { if wayland() {
layershell.InitForWindow(win) layershell.InitForWindow(win)
layershell.SetNamespace(win, "nwg-drawer")
var output2mon map[string]*gdk.Monitor var output2mon map[string]*gdk.Monitor
if *targetOutput != "" { if *targetOutput != "" {

View File

@@ -617,10 +617,11 @@ func setUpOperationResultWindow(operation string, result string) {
vBox, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 5) vBox, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 5)
outerVBox.PackStart(vBox, true, true, 6) outerVBox.PackStart(vBox, true, true, 6)
lbl, _ := gtk.LabelNew(fmt.Sprintf("%s = %s", operation, result)) lbl, _ := gtk.LabelNew(fmt.Sprintf("%s = %s", operation, result))
lbl.SetProperty("name", "math-label")
vBox.PackStart(lbl, true, true, 12) vBox.PackStart(lbl, true, true, 12)
mRefProvider, _ := gtk.CssProviderNew() mRefProvider, _ := gtk.CssProviderNew()
css := "window { background-color: rgba (0, 0, 0, 255); color: #fff; font-weight: bold; border: solid 1px grey; border-radius: 5px}" css := "window { background-color: rgba (0, 0, 0, 255); color: #fff; border: solid 1px grey; border-radius: 5px}"
err = mRefProvider.LoadFromData(css) err = mRefProvider.LoadFromData(css)
if err != nil { if err != nil {
log.Warn(err) log.Warn(err)