mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-05 18:38:26 +02:00
- Added a more verbose initial startup to kintox11 for easier debugging purposes
This commit is contained in:
@@ -4,7 +4,6 @@ swapcmd="\/bin\/bash\ \/home\/`whoami`\/.config\/kinto\/xactive.sh"
|
|||||||
mkdir -p ~/.config/systemd/user
|
mkdir -p ~/.config/systemd/user
|
||||||
mkdir -p ~/.config/autostart
|
mkdir -p ~/.config/autostart
|
||||||
cp ./system-config/keyswap.service ~/.config/systemd/user/keyswap.service
|
cp ./system-config/keyswap.service ~/.config/systemd/user/keyswap.service
|
||||||
cp ./system-config/keyswap.sh ~/.config/autostart/keyswap.sh
|
|
||||||
cp ./kintox11/binary/kintox11 ~/.config/kinto/kintox11
|
cp ./kintox11/binary/kintox11 ~/.config/kinto/kintox11
|
||||||
cp ./system-config/xactive.sh ~/.config/kinto/xactive.sh
|
cp ./system-config/xactive.sh ~/.config/kinto/xactive.sh
|
||||||
sed -i "s/{username}/`whoami`/g" ~/.config/systemd/user/keyswap.service
|
sed -i "s/{username}/`whoami`/g" ~/.config/systemd/user/keyswap.service
|
||||||
|
Binary file not shown.
@@ -88,6 +88,39 @@ Window get_focus_window(Display* d){
|
|||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get the top window.
|
||||||
|
// a top window have the following specifications.
|
||||||
|
// * the start window is contained the descendent windows.
|
||||||
|
// * the parent window is the root window.
|
||||||
|
Window get_top_window(Display* d, Window start){
|
||||||
|
Window w = start;
|
||||||
|
Window parent = start;
|
||||||
|
Window root = None;
|
||||||
|
Window *children;
|
||||||
|
unsigned int nchildren;
|
||||||
|
Status s;
|
||||||
|
|
||||||
|
printf("getting top window ... \n");
|
||||||
|
while (parent != root) {
|
||||||
|
w = parent;
|
||||||
|
s = XQueryTree(d, w, &root, &parent, &children, &nchildren); // see man
|
||||||
|
|
||||||
|
if (s)
|
||||||
|
XFree(children);
|
||||||
|
|
||||||
|
if(xerror){
|
||||||
|
printf("fail\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(" get parent (window: %d)\n", (int)w);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("success (window: %d)\n", (int)w);
|
||||||
|
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const char * str_window_class(Display* d, Window w, char *prior_app ){
|
const char * str_window_class(Display* d, Window w, char *prior_app ){
|
||||||
Status s;
|
Status s;
|
||||||
@@ -243,6 +276,7 @@ int main(void){
|
|||||||
|
|
||||||
Display* d;
|
Display* d;
|
||||||
Window w;
|
Window w;
|
||||||
|
char *name;
|
||||||
|
|
||||||
// for XmbTextPropertyToTextList
|
// for XmbTextPropertyToTextList
|
||||||
setlocale(LC_ALL, ""); // see man locale
|
setlocale(LC_ALL, ""); // see man locale
|
||||||
@@ -259,12 +293,19 @@ int main(void){
|
|||||||
|
|
||||||
// get active window
|
// get active window
|
||||||
w = get_focus_window(d);
|
w = get_focus_window(d);
|
||||||
|
w = get_top_window(d, w);
|
||||||
|
|
||||||
|
// XFetchName(d, w, &name);
|
||||||
|
// printf("window:%#x name:%s\n", w, name);
|
||||||
|
printf("First window name: %s \n",str_window_class(d, w,prior_app));
|
||||||
|
|
||||||
int breakouter;
|
int breakouter;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
breakouter = 0;
|
breakouter = 0;
|
||||||
|
// XFetchName(d, w, &name);
|
||||||
|
// printf("window:%#x name:%s\n", w, name);
|
||||||
// printf("%s\n","1");
|
// printf("%s\n","1");
|
||||||
// printf("%s\n",str_window_class(d, w,prior_app));
|
// printf("%s\n",str_window_class(d, w,prior_app));
|
||||||
if(strcmp(str_window_class(d, w,prior_app),prior_app)){
|
if(strcmp(str_window_class(d, w,prior_app),prior_app)){
|
||||||
|
@@ -8,6 +8,7 @@ Type=simple
|
|||||||
#Group={username}
|
#Group={username}
|
||||||
Environment=DISPLAY=:0
|
Environment=DISPLAY=:0
|
||||||
Restart=always
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
WorkingDirectory=/home/{username}/.config/kinto
|
WorkingDirectory=/home/{username}/.config/kinto
|
||||||
ExecStart=
|
ExecStart=
|
||||||
|
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
#/bin/bash
|
|
||||||
|
|
||||||
systemctl --user start keyswap
|
|
Reference in New Issue
Block a user