updated on Fri Jan 13 20:02:10 UTC 2012
[aur-mirror.git] / slim-plus / slim-1.3.0-custom_keys.diff
blobc6debde102fef4a6cbfadbc877aafc91ac049ec5
1 diff -rNaud slim-1.3.0-orig/cfg.cpp slim-1.3.0/cfg.cpp
2 --- slim-1.3.0-orig/cfg.cpp 2007-09-01 23:41:51.000000000 +0200
3 +++ slim-1.3.0/cfg.cpp 2007-09-01 23:42:03.000000000 +0200
4 @@ -41,6 +41,17 @@
5 options.insert(option("sessionstop_cmd",""));
6 options.insert(option("console_cmd","/usr/X11R6/bin/xterm -C -fg white -bg black +sb -g %dx%d+%d+%d -fn %dx%d -T ""Console login"" -e /bin/sh -c ""/bin/cat /etc/issue; exec /bin/login"""));
7 options.insert(option("screenshot_cmd","import -window root /slim.png"));
8 + options.insert(option("f2_cmd",""));
9 + options.insert(option("f3_cmd",""));
10 + options.insert(option("f4_cmd",""));
11 + options.insert(option("f5_cmd",""));
12 + options.insert(option("f6_cmd",""));
13 + options.insert(option("ctrl_f1_cmd",""));
14 + options.insert(option("ctrl_f2_cmd",""));
15 + options.insert(option("ctrl_f3_cmd",""));
16 + options.insert(option("ctrl_f4_cmd",""));
17 + options.insert(option("ctrl_f5_cmd",""));
18 + options.insert(option("ctrl_f6_cmd",""));
19 options.insert(option("welcome_msg","Welcome to %host"));
20 options.insert(option("default_user",""));
21 options.insert(option("current_theme","default"));
22 diff -rNaud slim-1.3.0-orig/panel.cpp slim-1.3.0/panel.cpp
23 --- slim-1.3.0-orig/panel.cpp 2007-09-01 23:41:51.000000000 +0200
24 +++ slim-1.3.0/panel.cpp 2007-09-01 23:42:11.000000000 +0200
25 @@ -345,13 +345,59 @@
26 string formerString = "";
28 XLookupString(&event.xkey, &ascii, 1, &keysym, &compstatus);
31 + // User defined custom keys (Ctrl)
32 + if (reinterpret_cast<XKeyEvent&>(event).state & ControlMask) {
33 + switch(keysym){
34 + case XK_F1:
35 + system(cfg->getOption("ctrl_f1_cmd").c_str());
36 + return true;
37 + case XK_F2:
38 + system(cfg->getOption("ctrl_f2_cmd").c_str());
39 + return true;
40 + case XK_F3:
41 + system(cfg->getOption("ctrl_f3_cmd").c_str());
42 + return true;
43 + case XK_F4:
44 + system(cfg->getOption("ctrl_f4_cmd").c_str());
45 + return true;
46 + case XK_F5:
47 + system(cfg->getOption("ctrl_f5_cmd").c_str());
48 + return true;
49 + case XK_F6:
50 + system(cfg->getOption("ctrl_f6_cmd").c_str());
51 + return true;
52 + }
53 + }
56 switch(keysym){
58 + // Session chooser
59 case XK_F1:
60 SwitchSession();
61 return true;
64 + // User defined custom keys
65 + case XK_F2:
66 + system(cfg->getOption("f2_cmd").c_str());
67 + return true;
68 + case XK_F3:
69 + system(cfg->getOption("f3_cmd").c_str());
70 + return true;
71 + case XK_F4:
72 + system(cfg->getOption("f4_cmd").c_str());
73 + return true;
74 + case XK_F5:
75 + system(cfg->getOption("f5_cmd").c_str());
76 + return true;
77 + case XK_F6:
78 + system(cfg->getOption("f6_cmd").c_str());
79 + return true;
81 + // Take a screenshot
82 case XK_F11:
83 - // Take a screenshot
84 system(cfg->getOption("screenshot_cmd").c_str());
85 return true;
87 --- slim-1.3.1/slim.conf.old 2009-02-23 20:54:06.000000000 +0800
88 +++ slim-1.3.1/slim.conf 2009-02-23 20:57:30.240104118 +0800
89 @@ -60,8 +60,22 @@
90 # Executed when pressing F11 (requires imagemagick)
91 screenshot_cmd import -window root /slim.png
93 +# Custom commands for F2 to F6 and Ctrl-F1 to Ctrl-F6 keys
94 +#f2_cmd some command
95 +#f3_cmd some command
96 +#f4_cmd some command
97 +#f5_cmd some command
98 +#f6_cmd some command
99 +# ctrl_f1_cmd some command
100 +# ctrl_f2_cmd some command
101 +# ctrl_f3_cmd some command
102 +# ctrl_f4_cmd some command
103 +# ctrl_f5_cmd some command
104 +# ctrl_f6_cmd some command
106 # welcome message. Available variables: %host, %domain
107 welcome_msg Welcome to %host
108 +#welcome_msg F1-session F2-locale F3-keyboard F4-suspend F5-reboot F6-halt
110 # Session message. Prepended to the session name when pressing F1
111 # session_msg Session: