Commit graph

468 commits

Author SHA1 Message Date
speedie f1b0ecd624 Change worddelimiters 2023-07-03 21:35:21 +02:00
speedie 5305303cd2 Don't indent if hideimage 2023-07-03 19:12:53 +02:00
speedie 4ac7119c5b Add WIP icon support to spmenu 2023-07-03 18:48:38 +02:00
Jacob 3f456f3a37 Feature: Add the ability to take "screenshots" of spmenu.
It doesn't actually capture your screen, but rather saves the Cairo
surface to an image. The path to the image and some other options
can also be configured in the config file.

By default, Print Screen can be pressed in Normal mode with no modifier
to take a screenshot. The default location is the user's home directory,
and the file has a date attached to it. Of course, this can be changed
as well.
2023-06-30 02:44:29 +02:00
speedie 8e257d5f6b Improve FreeBSD compatibility by moving meson.options to
meson_options.txt
Also fix a -Wsometimes-uninitialized
2023-06-26 18:09:03 +02:00
speedie c7632f342e Fix generate.sh
Fix generate.sh, it should now generate properly. Also remove the actual
protocols, the user should generate those, not me.
2023-06-24 21:12:18 +02:00
speedie 2cee004182 Remove more useless Xinerama code 2023-06-24 17:34:03 +02:00
speedie 336bdd5830 Simplify display width/height code
With this commit, display width/height is only grabbed once. This means
we don't need to deal with all that X11 and Xinerama code when we're
simply resizing the window.
2023-06-24 17:13:17 +02:00
speedie bd49d876cd Move to the first item when setting lines
This fixes an issue where you can resize beyond the number of items
2023-06-24 17:01:43 +02:00
speedie dfc4fe038c Remove fullscreen functionality
The fullscreen functionality is kind of cool, but adds a lot of code and
as commit history has shown, plenty of bugs and extra required testing.

I may reimplement this later in a less bad manner. Note that the
fullscreen behavior can be achieved by simply increasing image size to
the max. spmenu will let you do that.

Fixes issue #9
2023-06-24 04:53:44 +02:00
speedie 748db7eed1 simplify full screen 2023-06-24 04:43:05 +02:00
speedie 0a59088313 Fix keybind conflict, replace imageg, imagew and imageh in favor of
using the img struct
2023-06-24 04:20:51 +02:00
speedie aba3541d37 Disable fullscreen when no image 2023-06-24 03:00:00 +02:00
speedie 02c6c4ac5c Remove unnecessary else continue; from X11 and Wayland keybind
handling
2023-06-23 20:28:22 +02:00
speedie 8e0de8f556 Simplify some variables 2023-06-23 17:27:57 +02:00
speedie 152b14330f Xlib must now be included in spmenu.c
Also, we should be checking the length of wl_cbuttons, not cbuttons on
Wayland.
2023-06-23 04:04:02 +02:00
speedie 59983981c2 Rename libdrw functions to simply "draw" 2023-06-23 03:49:23 +02:00
speedie 6328edc5cd Use global structs 2023-06-23 03:38:21 +02:00
speedie ca624e1ca6 Default to the default value of $XDG_CACHE_DIR in case $XDG_CACHE_DIR is
not set.

Both the current behavior and this commit are valid according to the XDG
base directory standard, however realistically no one wants dotfiles in
their home directory, and that's what would happen if $XDG_CACHE_DIR
is unset.

Also fix key inconsistency between X and Wayland.
2023-06-22 00:17:23 +02:00
speedie dfc4ad0fa4 cleanup a bit, fix margin-vertical and fullscreen 2023-06-20 09:40:40 +02:00
speedie 180aa71fef fix clicks when one line is removed 2023-06-20 01:27:46 +02:00
speedie ddb38c8cec fix clicks if !lines, oops 2023-06-19 23:26:23 +02:00
speedie f99cc1d62a significant rewrites to mouse clicks 2023-06-19 23:16:03 +02:00
speedie 62b15fab28 Fix some bugs with clicks and images 2023-06-19 21:28:45 +02:00
speedie ebd625ba1e Add check for GNOME Wayland 2023-06-19 17:18:27 +02:00
speedie 453b0028aa Switch to Ctrl modifier from Alt modifier for navhistory keys 2023-06-19 16:26:03 +02:00
speedie 0409dbff12 Change Ctrl+Shift+h keybind to simply Shift+h in normal mode 2023-06-19 16:16:16 +02:00
speedie 3c59249fbd setlines and setcolumns now work in insert mode as well 2023-06-19 02:36:28 +02:00
speedie ef4400d844 Fix loading from file dynamically on Wayland 2023-06-19 02:23:46 +02:00
speedie 92fb7fff5c fix menumarginh when lines 2023-06-19 02:13:38 +02:00
speedie c1058dfb00 add option to enable/disable setting lines/columns using keybinds 2023-06-19 01:46:05 +02:00
speedie 6083df6736 update documentation 2023-06-19 01:08:15 +02:00
speedie b0c39b6dc3 Remove single line clicks as they're not very useful, and fix clicks
when item powerlines are enabled
2023-06-18 22:56:21 +02:00
speedie 9ba2e0f52f Add powerline for !lines as well 2023-06-18 21:15:32 +02:00
speedie aa62ca8cdd Add powerline for items
Currently does not work with !lines, and as such it has been disabled
for the time being.
2023-06-18 18:05:42 +02:00
speedie b261d62cc9 Allow "xdg" to be entered to force XDG cache directory even if
XDG_CACHE_DIR is not set
2023-06-12 23:44:59 +02:00
speedie 1c6bc9f92d Add -fl argument which can be used to check if a feature is supported
This could be very useful for shell scripts, or debugging.
2023-06-12 17:09:34 +02:00
speedie 88a8212c80 fix !USEIMAGE usage of undeclared functions 2023-06-12 04:24:35 +02:00
speedie 6421126f67 no need for the sl directory 2023-06-12 03:54:40 +02:00
speedie e553da35a9 It's not "hideimage" in the config file, it's "image" 2023-06-12 03:44:27 +02:00
speedie 91178ad8ce Use slightly safer version of strcpy() 2023-06-12 03:39:29 +02:00
speedie 43e2800e9f Rename libdrw to draw, because it's not really libdrw anymore 2023-06-12 02:28:19 +02:00
speedie ce30909e70 Apply last commit to themes as well 2023-06-12 00:31:33 +02:00
speedie fdce53681d Fix typo causing gaps to set the image height in the configuration file 2023-06-12 00:30:53 +02:00
speedie 1c4c68dcc6 Add image resize option 2023-06-12 00:26:35 +02:00
speedie 4d505459b1 significantly clean up the image size functions 2023-06-12 00:15:29 +02:00
speedie 0e5b5b240b forgot we need to remove the top line too 2023-06-11 22:48:22 +02:00
speedie f6df89845e fix fullscreen height issue 2023-06-11 22:11:32 +02:00
speedie 4a55c95973 Don't include Xlib if !USEX 2023-06-11 22:05:25 +02:00
speedie a90c94f69d apply last commit to wayland resizetoimageheight() function as well 2023-06-11 19:34:10 +02:00
speedie c0d8adec85 significant image drawing codebase cleanup 2023-06-11 19:32:02 +02:00
speedie 00966f7547 simplify bh removal in drawmenu_layer() significantly 2023-06-11 17:34:54 +02:00
speedie acdac97d75 fix a weird freeze when larrow and/or rarrow is hidden and an image is
being drawn
2023-06-11 16:49:41 +02:00
speedie d7122af473 cleanup menu height setting 2023-06-11 16:46:36 +02:00
speedie 3bc300d029 Expose caret width, height and add a padding option 2023-06-11 04:22:25 +02:00
speedie 894667faec Forgot to change the keybinds for Wayland 2023-06-10 17:58:40 +02:00
speedie 355c3299c5 Update URLs with the non-php version 2023-06-10 14:36:44 +02:00
speedie e06f2031d9 Remove cursor code, we don't need it.
The cursor code was originally here, because dmenu and dwm share the
same drw.c and drw.h. I do not care about that however, so having
the cursor code here is a waste.
2023-06-09 23:58:31 +02:00
speedie b68666dc6b No longer use deprecated MD5() function to get hash 2023-06-09 21:20:02 +02:00
speedie 965043e5e6 Don't indent items to prompt width by default 2023-06-09 14:00:12 +02:00
speedie b37de0b2e0 Fix keybind conflict causing image to be flipped if columns are changed 2023-06-09 13:55:55 +02:00
speedie d639275487 Move keybinds.h, mouse.h and options.h to libs/ as libconfig
configuration is encouraged.
2023-06-09 10:23:10 +02:00
speedie 263eca5820 remove wayland support section, instead arguments in the list are now
marked with X11 only.
2023-06-09 08:16:00 +02:00
speedie da0faccfa3 Move some configuration stuff around 2023-06-09 02:52:53 +02:00
speedie e6b2c0d9c9 Fix some bugs which had been previous undiscovered with the keysym
handling
2023-06-08 22:42:25 +02:00
speedie 148c219ec5 Fix alpha mask 2023-06-08 20:30:42 +02:00
speedie 5745b52bc9 Add work in progress support for images on Wayland
This commit also adds MASSIVE speed improvements to image drawing, due
to code cleanup. There are still a *few* issues to resolve, one is
X11 related, and one is caused by alpha/blending.
2023-06-08 19:40:30 +02:00
speedie 9eb97d5da0 add rounded variant of the powerline 2023-06-07 21:31:10 +02:00
speedie fd92de24ff allow overriding path to theme file and binds file in the regular config
file, and allow overriding config file path in options.h
2023-06-06 17:59:03 +02:00
speedie a9ee831159 add X11 toggle, so now Xlib, Xinerama and Xrender aren't dependencies if
you only use Wayland
2023-06-05 17:16:26 +02:00
speedie ceb86bed13 move opening display to readstdin(), so .Xresources can be read if
protocol is set to wayland but wayland isn't actually used
2023-06-03 23:10:27 +02:00
speedie 29365cd10e fix some x11 stuff 2023-06-03 19:14:54 +02:00
speedie 9d0b86fc3c fix typo 2023-06-03 16:28:30 +02:00
speedie e6c1af01f9 fix: alpha option for wayland 2023-06-03 00:07:28 +02:00
speedie 17dd06139d fix: argument protocol overriden by config file 2023-06-02 19:00:09 +02:00
speedie 692e3abc68 Add experimental native Wayland support 2023-06-02 18:37:51 +02:00
speedie 7ca66d674f last few commits again 2023-05-24 22:01:35 +02:00
speedie 77864d43bf remove the rest of the x11 specific code from spmenu.c 2023-05-24 07:36:40 +02:00
speedie b97847c207 clean up main function more 2023-05-23 22:40:17 +02:00
speedie 96b82dc223 actually changed my mind for a bit 2023-05-23 22:31:33 +02:00
speedie 01388390aa code cleanup 2023-05-23 22:14:24 +02:00
speedie 95b420944c add a bind file which scripts can use to gain full control over keybinds 2023-05-22 22:47:37 +02:00
speedie f482aea8db remove UTF-8 toggle, it's not necessary now with cairo because cairo can
filter invalid unicode
2023-05-22 20:44:21 +02:00
speedie 0258974bf0 code cleanup, add moveitem function 2023-05-22 16:35:57 +02:00
speedie c1a7afe1f4 debloat 2023-05-22 00:05:09 +02:00
speedie 7af63e4a13 we don't need to include these 2023-05-21 23:57:37 +02:00
speedie a701060f8b some more code cleanup 2023-05-21 23:52:28 +02:00
speedie 7f2ad4b5d6 make the code a bit more readable 2023-05-21 23:44:02 +02:00
speedie eb83b0376d move some stuff around 2023-05-21 23:40:19 +02:00
speedie 29781c8084 rename some headers, because i plan on maybe doing wayland support 2023-05-21 23:23:43 +02:00
speedie 1faa75ad36 some minor code cleanup, and set single paragraph mode 2023-05-21 16:27:14 +02:00
speedie a750da978c replace xft with cairo, remove sample theme because it's redundant,
remove optional pango support as its now required because we're using
cairo
2023-05-21 04:18:41 +02:00
speedie 620cb0ca63 add option to not allow selecting multiple items to spmenu itself 2023-05-19 02:13:13 +02:00
speedie 71eb652853 improve the usage() function, remove unnecessary declaration of usage()
from spmenu.c
2023-05-19 01:44:11 +02:00
speedie 3543f04361 print errors to, well.. stderr not stdout 2023-05-18 20:01:22 +02:00
speedie f534250e7a add separate colorscheme for marked items, SchemeItemSel is used as a fallback 2023-05-18 10:23:45 +02:00
speedie 3e4e36250c some minor changes to spmenu_imageviewer and remove additional line when
there's an image
2023-05-16 22:06:24 +02:00
speedie ea3e7ed458 remove unnecessary match() calls in setlines() and setcolumns() 2023-05-16 21:04:32 +02:00
speedie 5aefbf249a fix some bugs, add multisel for spmenu_run 2023-05-16 20:03:52 +02:00
speedie e7ecfd4114 add hkeys array which allows us to press ctrl+alt+shift+delete to exit
out of spmenu even if we unbind our quit keybind
2023-05-16 19:34:02 +02:00
speedie 12b69656a7 add support for marking items (ie. multi selection) 2023-05-16 18:54:26 +02:00
speedie 8c9d33d01f add LICENSE notice to all code 2023-05-14 00:21:16 +02:00
speedie 15141c230d add the ability to full screen an image + code cleanup
images are drawn quite slowly, something needs to be done about that
soon
2023-05-14 00:10:24 +02:00
speedie 60f588f003 Remove some commented code 2023-05-13 17:37:37 +02:00
speedie 195e4252b7 oops, i forgot i needed to set it to 0 first 2023-05-13 16:19:03 +02:00
speedie 11859ff159 allow rofi like "next" colors 2023-05-13 16:07:29 +02:00
speedie 3da21bc052 allow overriding image cache directory 2023-05-12 23:23:15 +02:00
speedie 9032af968d don't allow drawing images until KeyRelease event 2023-05-11 19:53:23 +02:00
speedie ee7419704d allow UTF-8 support to be toggled 2023-05-11 16:46:32 +02:00
speedie c71743a326 use a img:// prefix rather than IMG:
the old one is still available for compatibility reasons of course
2023-05-10 21:55:59 +02:00
speedie 8da0dba45b convert to ASCII, fixing a markup bug 2023-05-10 19:43:41 +02:00
speedie 6dc84051aa use another char * instead of using const char *text directly 2023-05-10 18:56:56 +02:00
speedie 6c146c87b4 rename some headers 2023-05-10 08:20:29 +02:00
speedie d065aa8ab6 enable highlighting for colored entries 2023-05-10 08:16:22 +02:00
speedie 2e9cb1e408 add option to not allow typing if what is being typed doesn't have any
matches
2023-05-09 19:30:01 +02:00
speedie 671dbffa1b fix bug where the caret may be moved if a different item is selected
this code made sense back when spmenu couldn't define keybinds manually,
as then moving between items and moving the caret was one single case.
2023-05-09 17:55:10 +02:00
speedie 5efe236380 indent lots of code using vim gg=G 2023-05-08 23:00:45 +02:00
speedie fc8d12cd0a clean up warnings when -Ofast is used
it may still segfault, im not sure
2023-05-08 22:44:27 +02:00
speedie eb7a68f7ea variable name change 2023-05-08 18:16:50 +02:00
speedie 04add5df1a some more cleanup 2023-05-08 18:15:20 +02:00
speedie c7e0e5d74b dwm-like colorscheme creation 2023-05-08 17:50:48 +02:00
speedie 5c36c25f99 simplify listfile 2023-05-08 17:33:55 +02:00
speedie a2ab37dbc3 end with \n 2023-05-08 17:31:32 +02:00
speedie 4d969752b7 fix pajeet code 2023-05-08 17:13:53 +02:00
speedie f08a72c5b1 fix typo 2023-05-08 14:08:06 +02:00
speedie e163c1a906 remove spmenu:test 2023-05-08 11:57:39 +02:00
speedie 6c71982b58 its not a fucking float its a string why am i so retarded? 2023-05-07 22:55:09 +02:00
speedie 49973b40e2 fix some issues, add meson.build which i may or may not use later 2023-05-07 22:30:57 +02:00
speedie 8f8f267830 resize client 2023-05-07 18:07:02 +02:00
speedie 6673afc8b7 disable insert mode completely when !type 2023-05-07 15:38:51 +02:00
speedie ffe2af611a calculate number of lines 2023-05-07 15:35:41 +02:00
speedie aad8baef66 save item index 2023-05-07 15:33:09 +02:00
speedie 445351c09a better if a key doesn't have to be pressed 2023-05-07 14:11:57 +02:00
speedie 1e47c98265 some code cleanup 2023-05-07 02:11:16 +02:00
speedie 63e5be2884 add the ability to read from file, been wanting this for a very long
time
2023-05-07 01:41:30 +02:00
speedie 442c40b732 add incremental as well, this should now include most suckless patches people use 2023-05-06 23:39:03 +02:00
speedie 5ff1abc849 add ability to print item number rather than the item itself 2023-05-06 23:29:41 +02:00
speedie c58542c2b9 this is unnecessary 2023-05-06 23:07:16 +02:00
speedie 409fc8db5e add the option to not include support for .Xresources in the build 2023-05-06 22:01:28 +02:00
speedie 05c436022c apply last commit for even more functions 2023-05-06 14:36:50 +02:00
speedie c1d36670fa replace a lot of suckless coding decisions with my own 2023-05-06 14:29:45 +02:00
speedie 104d46640b don't use all lowercase for mouse click names 2023-05-06 14:13:56 +02:00
speedie 1126bf5680 move libdrw stuff 2023-05-04 20:44:43 +02:00
speedie 393c24af3c xft crash workaround, only useful for debian/other distros that run an
ancient libxft version
2023-05-03 21:38:34 +02:00
speedie 7509780d48 this is unnecessary 2023-05-01 19:33:25 +02:00
speedie 594b06fa86 convert all existing themes into .conf themes.
these are meant to eventually replace the older profiles
2023-05-01 18:46:11 +02:00
speedie be13a65ff5 some improvements, dmenu.conf is now theme.conf compatible 2023-05-01 18:01:47 +02:00
speedie 5f54e20a2b some cleanup, add comments to buildconf 2023-05-01 17:48:21 +02:00
speedie 316fcd0a76 add basic theme.conf file support 2023-05-01 17:07:35 +02:00
speedie 776de147ea a minor change to the way indentation is done 2023-05-01 04:30:38 +02:00