echo "mem" > /sys/power/state
is what the bloated (e)logind does in the end anyway.
The same, badly adapted from a tutorial, in C
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main() {
#define word "mem"
// creating file pointer to work with files
FILE *fptr;
setuid(0);
// opening file in writing mode
fptr = fopen("/sys/power/state", "w");
// exiting program
if (fptr == NULL) {
printf("Error!");
exit(1);
}
fprintf(fptr, "%s", word);
fclose(fptr);
return 0;
}
Compile it, set it SUID, and then either set up a keyboard shortcut to it in UKUI, or if you are lucky you might be able to replace the program/call to suspend in the UKUI menu? With LXQT it's as simple as editing a .desktop file.