2023-06-02 15:20:36 +00:00
# suckless_dictpopup
2023-05-09 10:42:03 +00:00
2023-06-02 20:41:24 +00:00
This is a very lightweight program to show a popup with the dictionary entry of the selected text. It uses [sdcv ](https://github.com/Dushistov/sdcv ) for the dictionary lookup and optionally, a slightly modified version of [herbe ](https://github.com/dudik/herbe ) to display the popup.
2023-05-09 10:42:03 +00:00
2023-07-04 23:56:17 +00:00
![image ](https://github.com/KonstantinDjairo/suckless_dictpopup/assets/53496273/e681f789-eac7-482b-b503-e66f8d73bb37 )
2023-05-09 10:54:46 +00:00
2023-05-09 10:51:38 +00:00
## Dependencies
2023-06-02 20:41:24 +00:00
notice that most of them might be already installed, they are:
2023-05-30 02:40:01 +00:00
2023-06-06 03:28:17 +00:00
`sselp , sdcv, perl`
By using Perl one-liners, we are able to replace the usage of awk, grep, and sed with Perl equivalents, making the code more consistent and eliminating the need for external tools.
2023-05-30 02:40:01 +00:00
2023-06-02 20:41:24 +00:00
### Currently tested on:
2023-06-02 22:45:54 +00:00
- GNU/Linux
2023-06-02 20:41:24 +00:00
- FreeBSD
2023-05-30 02:28:24 +00:00
2023-05-09 10:42:03 +00:00
2023-05-09 10:51:38 +00:00
## Setup
2023-05-09 11:42:55 +00:00
First setup [sdcv ](https://github.com/Dushistov/sdcv ) according to their github page.
2023-05-28 11:15:50 +00:00
Then install with `sudo make install` . \
Uninstall with `sudo make uninstall`
2023-05-09 10:42:03 +00:00
2023-06-02 20:41:24 +00:00
If you would like to automatically lookup a word on every selection (recommended) , then take a look at the following script: < br > https://github.com/KonstantinDjairo/suckless_dictpopup/blob/main/daemon-popup < br >
< br >
This is not meant to be running all the time, since it looks up everything that goes into the clipboard.\
Disable when using mpvacious for example.
2023-05-28 11:43:20 +00:00
2023-06-02 20:42:39 +00:00
## Usage <br>
Bind to a shortcut < br > \
2023-06-02 20:41:24 +00:00
To add a keyboard shortcut, you can use options of your WM or DE. You can also use sxhkd. \
The popup can be dismissed by clicking on it.
2023-06-02 20:47:33 +00:00
Here is a snippet from someone's ~/.config/i3/config showing how to bind `dictpopup` to a keyboard shortcut.
2023-06-02 20:41:24 +00:00
```console
# Run dictpopup
bindsym $mod+c exec --no-startup-id dictpopup
```
2023-05-28 11:15:50 +00:00
The styling can be changed in `config.h` and then recompile to apply.
2023-05-09 10:57:06 +00:00
There is also a xresources patch from [herbe ](https://github.com/dudik/herbe )
2023-05-28 11:15:50 +00:00
that you could try to apply if you like.
2023-05-09 11:42:55 +00:00
2023-05-28 11:15:50 +00:00
`popup` can also be used as a standalone program to show the contents of stdin.
2023-06-02 15:13:38 +00:00
2023-06-22 22:42:56 +00:00
## Recommended fonts
For low-resolution monitors i recommend that font:
< p >
< img src = "https://github.com/KonstantinDjairo/suckless_dictpopup/assets/53496273/a34a8a20-9e17-4915-aad4-343e76b75de8" alt >
< br > < em > < a href = "https://github.com/KonstantinDjairo/source-han-code-jp" > source-han-code-jp< a > < / em > < / br >
in this picture the font is set at 10px
< / p >
2023-06-02 15:13:38 +00:00
## TODO
2023-06-02 15:47:44 +00:00
- [x] Completed
- [ ] Work in Progress
< br > < br / >
2023-06-02 15:23:19 +00:00
- [ ] Switch between words in a given sentence by using the arrow keys or any user-defined key;
Sudachi can be used to accomplish that.