Commit Graph

54 Commits

Author SHA1 Message Date
Adrian Chadd
229d2b2c4d [amiwm] Fix NULL scr issue
If the clock timer fires when global scr is NULL then we end up calling
redrawmenubar() with a NULL global scr, but a valid local scr.

So just pass in the scr used when doing "stuff" into redrawmenubar(),
making the 'scr' in redrawmenubar() also local scope.
2022-09-05 16:03:55 -07:00
Adrian Chadd
21423a0c10 Merge pull request #6 from erikarn/20220511_fix_keyboard_docs
[amiwm] Fix keyboard documentation entry
2022-05-21 16:06:33 -07:00
Adrian Chadd
f116f9c335 Merge pull request #5 from erikarn/ahc_20220425_menu_widgets
This is the beginning of adding some battery display support into the menu and figuring out how to add arbitrary widgets into the menu bar.

It's going to take a bunch more commits / time to clean this up to be more flexible, but at least now we have an MVP of adding a new "thing", buggy as it is.
2022-05-21 16:05:17 -07:00
Adrian Chadd
2a9bd912a1 [amiwm] Add the basic battery info printing bits
* add a batteryinfo config option to enable whether or not to display
  the current battery info string

* populate that battery info string whenever we receive a battery
  update from the module

* document it all

This is very specific to a battery thing rather than a generic menu
widget thing, but I think I'll go and twiddle with this stuff a bit
more first and then work on a more generic "menu widget" thing later.

It'd be nice to have "menu bar things" like battery and the date/time
field on a linked list of "things".

There's also some bugs - notably, rendering artifacts when the
string length shrinks, and it only updating on the 'current' menu bar
(when you have multiple desktops visible at once.)  Those also
should be fixed for completeness. :-)
2022-05-15 19:36:03 -07:00
Adrian Chadd
fc23b3e054 [battery] Add help on how the battery module works. 2022-05-15 10:50:55 -07:00
Adrian Chadd
915b84e403 [battery] Update to not spit out debugging
Now that this actually seems to work, let's not spit out so much
debugging info.  It's not needed!

Whilst here quieten a debugging output.
2022-05-15 10:49:17 -07:00
Adrian Chadd
030f55fa2e [battery] Tie into the periodic function to update APM info
Tie into the periodic function so we can get the APM info.

For now it's not checking that some time has elapsed, the hope
is that it'll just be driven by md_main_loop() / 5 second select
timeout.
2022-05-14 22:08:55 -07:00
Adrian Chadd
4bd5a665db [libami] Add a 5 second read timeout so the periodic routine can be called
* add a basic select() loop for the read FD to see if it's ready
* optionally block in md_read() even if we timeout - this is used for
  the md_command() side of things
* md_handle_input() however doesn't block and will happily timeout
  so the loop can run and the periodic function can run.

This indeed seems to work.  It's a bit dirty, but it at least stops
the main loop from being fully blocking and that's super useful for
modules that wish to schedule background work.
2022-05-14 22:07:36 -07:00
Adrian Chadd
bfc0313ace [amiwm] Fix keyboard documentation entry
This .. didn't work.  Whoops!
2022-05-11 19:42:14 -07:00
Adrian Chadd
54adc01be4 [libami] document how the module loop works; start thinking about how to make it async
* Yeah it'd be nice to just use libevent here, alas
* Figure out how all the reading/writing works and comment it
* Add a periodic function that'll be called every trip through
  the main loop; will turn it into something more formally periodic
  later.

There's still lots to do here before I can actually schedule
periodic events and the read()s are non-blocking.  Give it time!
2022-05-08 14:04:21 -07:00
Adrian Chadd
18e858ae80 [amiwm] MVP for initial battery stuff
Totally not ready for prod, but at least I'm making progress
figuring out how to add extra bits to this thing.

* add a second widget to the menu bar, next to the title bar
* add a new module command to update the battery information
* add a freebsd specific Battery module, not linked into the
  build right now.
* amiwm will print out whenever we get battery information from the
  module.

Right now I'm trying to figure out how to get some kind of periodic
background event into the module main loop.  Launcher does it
using cx_broker(), but I dunno if I can adapt that pattern here.
2022-04-25 21:28:49 -07:00
Adrian Chadd
e42512c034 [amiwm] Don't use global scr for this iteration
The global scr is a bit of an overused thing.  It's definitely not
needed here.  Don't use it here.
2022-04-25 19:03:50 -07:00
Adrian Chadd
9ac42a9f4a Merge pull request #4 from erikarn/ahc_20220409_gadgets
Ahc 20220409 gadgets
2022-04-19 20:06:13 -07:00
Adrian Chadd
e73f47e1fb [requestchoice] refactor out gadget code
This calls the gadget code that I've refactored into libami/ .
.
2022-04-09 17:35:05 -07:00
Adrian Chadd
48f15595a4 [executecmd] migrate executecmd to use the gadgets in libami
This removes the gadget specific code in executecmd and calls
the routines I've added in libami.
2022-04-09 17:34:43 -07:00
Adrian Chadd
0e5c81f6e3 [libami] add button, textbox and textinput from requestchoice/executecmd
Marcus had written up workbench style widgets inside the two external
helper programs requestchoice and executecmd.  This ports the code over
to libami.

Note that there isn't a generic gadget or collection of gadgets yet -
this is purely a refactor of the code, and the upcoming commit that
migrates requestchoice/executecmd over to use them just handles them
directly via xlib like they have always done.
2022-04-09 17:33:21 -07:00
Adrian Chadd
161a78e648 Merge pull request #3 from erikarn/ahc_20220403_alt_tab
[amiwm] add a new command action to rotate windows
2022-04-06 13:56:17 -07:00
Adrian Chadd
e0c13213c5 [amiwm] add a new command action to rotate windows
This adds a command to iterate over the set of windows.  It's not
like alt-tab in ye olde windows world where you'd alt tab once to
switch between two windows, and then keep alt-tab'ing with alt down
to go through the window list.  For now it just literally iterates
through those windows.

This makes it a lot easier to work with a large number of open
windows without having to constantly use the mouse.
2022-04-03 08:27:14 -07:00
Adrian Chadd
72742103b5 Merge pull request #2 from erikarn/ahc_20220328_remove_global_front
[amiwm] remove the global 'front' variable
2022-04-03 08:24:23 -07:00
Adrian Chadd
d00be9ffa8 [amiwm] remove the global 'front' variable
This is a pretty straight forward change to remove the global front
variable and instead use a couple of accessor functions.

This hopefully will make it easier to keep track and debug when
the front screen changes.
2022-04-03 08:20:39 -07:00
Adrian Chadd
84caa252d1 Merge pull request #1 from erikarn/main
[amiwm] Update documentation to point to this new repository.
2022-03-24 09:18:52 -07:00
Adrian Chadd
743a7a666b [amiwm] Update documentation to point to this new repository. 2022-03-24 09:18:18 -07:00
Adrian Chadd
6bd141dec1 [amiwm] add some initial comments of structure members.
Still have a long way to go.
2022-03-18 20:56:16 -07:00
Adrian Chadd
64d540a026 [amiwm] Fix window size / position issues when asked to do something insane
* ensure newly created windows are placed somewhere visible - ie, not
  off the screen.
* ensure newly created window sizes aren't insanely large, which end up
  being unable to be moved or resized in amiwm.

This has shown up with gtk apps (kicad, firefox) with their load/save
dialog.  For some reason they want to be almost 2x my desktop size,
making them super hard to use.
2022-03-17 20:38:40 -07:00
Adrian Chadd
26cecc8487 [amiwm] Use XAllocSizeHints() for the sizehints in struct Client
Although it likely doesn't matter /that/ much, the x11 xlib manual
does say to use it rather than expecting the struct to stay the same
size.

Yeah yeah it's 2022 and we really do build things from source,
ICCCM is likely not going to change that much nowdays, etc, etc.
2022-03-12 21:04:24 -08:00
Adrian Chadd
4162377f10 [libami] more compile warning fixes
* fix 32/64 bit int size printing stuff
* more if braces
2022-02-26 11:31:37 -08:00
Adrian Chadd
2a05c6f3e4 [background] Don't use GNU sed extensions
This makes it work on freebsd!
2022-02-22 22:00:47 -08:00
Adrian Chadd
31b98f3ef0 [libami] Another if / else clause warning to clean up 2022-02-18 21:52:15 -08:00
Adrian Chadd
32cfb5ab21 amiwm: since options were removed, make the Screens menu work again 2022-02-18 19:31:55 -08:00
Adrian Chadd
9825ecbe6b [launcher] launcher install fixes.
* install it!
* install the other .info icons too!
* add some basic documentation.
2022-02-13 20:21:44 -08:00
Adrian Chadd
1ce0d7c975 [amiwm] delete files that aren't actually used; they're auto-generated. 2022-02-13 19:59:50 -08:00
Adrian Chadd
294256771a [amiwm] Fix logic for the window size when maximized.
This is from Marcus' bzr repository (rev 126).
2022-02-13 18:56:38 -08:00
Adrian Chadd
77239205d7 [launcher] Add launcher into the build 2022-02-13 18:55:40 -08:00
Adrian Chadd
b0830232ff [launcher] fix compile warning 2022-02-13 18:55:18 -08:00
Adrian Chadd
54cb67609e [filesystem] install/document the filesystem module 2022-02-10 12:50:44 -08:00
Adrian Chadd
5365f97cbe [amiwm] Do another pass to clean up build warnings
This is mostly a "dangling if" cleanup, but I did add some other
comments here and there!
2022-02-10 12:37:38 -08:00
Adrian Chadd
59eae9c029 [libami] Make 'clean' a libami target
To make it easier / cleaner to build libami by itself, make a clean
target and call into it from the top level makefile as needed.
2020-11-10 11:55:10 -08:00
Adrian Chadd
31b2a069ea [libami] Fix compile warnings in module.c 2020-11-10 11:54:56 -08:00
reddsik
8e0948ca98 ghggewrpguregew 2017-08-03 23:30:51 +02:00
reddsik
f90e57437d no one reads this anywyas 2017-08-03 23:24:17 +02:00
reddsik
8bbae1ef0b more fixes 2017-08-03 23:07:55 +02:00
reddsik
fc0ecd5ecb amiwm apparently needs xorg-dev, thx to @WPMasterofficial for reporting the issue 2017-08-03 22:33:48 +02:00
reddsik
6bde9903d9 fixed makefile 2017-08-03 22:30:57 +02:00
reddsik
b6d25b8f9b Added Background_resize again because i forgot to do it in a6cbde4 2017-07-16 00:24:07 +02:00
reddsik
910c15cece Added modules to the makefile so they will install properly 2017-07-16 00:17:29 +02:00
reddsik
a6cbde4cd7 Added two new modules for displaying backdrops, fixed lib path(again), moved modules to subdirectory, and updated MODULES.md with useful info! ^^ 2017-07-15 23:07:12 +02:00
reddsik
a6b29a59ba Revert amiwm.1 as i've copied the wrong one 2017-07-14 18:03:22 +02:00
reddsik
5e6ed1191b Added something that will be a config util later, removed some unusable options from menus(you'll be later able to re-enable them), changed module dir to /lib/amiwm 2017-07-14 13:06:22 +02:00
reddsik
03aaf742af erm, removed too many files and it didn't compile.. fixed it again.. 2017-03-26 23:20:16 +02:00
reddsik
d35ad096fc removed a few not needed files 2017-03-26 18:03:50 +02:00