Debian Codegraph @

fvwm/components/functions/Exec-Accelerator

raw
1 # In this file you can find some functions used in FVWM-Crystal to launch
2 # applications. They are provided here for easier global change (you don't
3 # need to edit, for example, every entry in ApplicationDatabase to change
4 # a terminal type). You can use those commands in FvwmConsole window (by
5 # default in the bottom-left corner of the screen, accesible by pressing
6 # Alt+;).
7 # Near the functions you can find commented out entries, from which you can
8 # choosed a preffered command.
9
10 # Functions:
11
12 # A
13 # Launches a terminal with optional program as an argument. Terminal settings
14 # should be set using ~/.Xresources file or (in Eterm) theme file.
15
16 # AA
17 # A special version of the 'A' function. It just opens a terminal without
18 # additional application launched in it. It exists because certain terminal
19 # emulators (xterm, Eterm, something else?) won't run with '-e' argument being
20 # null.
21
22 # AT
23 # As 'A' function, but give a Title to the window terminal.
24
25 # C
26 # Launches a the fvwm console terminal with optional program as an argument.
27 # Terminal settings should be set using ~/.Xresources file or (in Eterm) theme file.
28
29 # X
30 # Launches a command in the background. Typically this function is used to
31 # launch some X application without additional terminal window.
32
33 # S
34 # Launch a command using 'sudo'. You need to have provileges in /etc/sudoers
35 # file to execute choosen command - consult your administrator or man sudo,
36 # man sudoers, man visudo. Usually 'sudo' asks for a password, so it's a good
37 # choice to launch it in a terminal window (otherwise you should use
38 # a specialized program for password verification).
39
40 # SX
41 # It does the same thing as 'S', but instead of opening a terminal with sudo
42 # it uses graphical client called 'gksudo' to execute a command. Unfortunately
43 # this variant is only usable with graphical applications.
44
45 SetEnv DefaultTerminal NO_DEFAULT_TERMINAL_FOUND
46 #FindCommand DefaultTerminal urxvt aterm xterm
47 CheckPreferences DefaultTerminal "SavePreferences DefaultTerminal 'FindCommand DefaultTerminal urxvt aterm xterm x-terminal-emulator'"
48 # start urxvtd if def term is urxvtc
49 DestroyFunc StartUrxvtd
50 AddToFunc StartUrxvtd
51 + I LoadPreferences DefaultTerminal
52 + I SetEnv DefaultTerminal $[infostore.DefaultTerminal]
53 + I Test (EnvMatch DefaultTerminal urxvtc) Exec pidof urxvtd || exec urxvtd -f -o $[infostore.SILENT]
54 + I UnsetEnv DefaultTerminal
55 StartUrxvtd
56
57 # Usage: A [command] [command options]
58 DestroyFunc A
59 AddToFunc A
60 + I SetEnv DefaultTerminal $[infostore.DefaultTerminal]
61 + I Window-SetPlacementPolicy
62 + I Test (!EnvMatch DefaultTerminal gnome-terminal, !EnvMatch DefaultTerminal multi-gnome-terminal, !EnvMatch DefaultTerminal terminator, !EnvMatch DefaultTerminal x-terminal-emulator, !EnvMatch DefaultTerminal xfce4-terminal) Exec exec $[infostore.DefaultTerminal] -e $* $[infostore.SILENT]
63 + I TestRc (NoMatch) Exec exec $[infostore.DefaultTerminal] -e "$*" $[infostore.SILENT]
64 + I UnsetEnv DefaultTerminal
65
66 DestroyFunc AA
67 AddToFunc AA
68 + I Window-SetPlacementPolicy
69 + I Exec exec $[infostore.DefaultTerminal] $[infostore.SILENT]
70
71 # Usage: AT [title] [command] (Use quotes if you want command options or title with spaces)
72 # !: doesn't work anymore with gnome-terminal due to a bug in gnome-terminal (doesn't honor anymore it's own --title option (and --name and --class too)).
73 DestroyFunc AT
74 AddToFunc AT
75 + I SetEnv DefaultTerminal $[infostore.DefaultTerminal]
76 + I Window-SetPlacementPolicy
77 + I Test (!EnvMatch DefaultTerminal gnome-terminal, !EnvMatch DefaultTerminal multi-gnome-terminal, !EnvMatch DefaultTerminal terminator, !EnvMatch DefaultTerminal x-terminal-emulator, !EnvMatch DefaultTerminal xfce4-terminal) Exec exec $[infostore.DefaultTerminal] -title "$0" -e $1 $[infostore.SILENT]
78 + I TestRc (NoMatch) Exec exec $[infostore.DefaultTerminal] --title "$0" -e "$1" $[infostore.SILENT]
79 + I UnsetEnv DefaultTerminal
80
81 # Usage: C [command] [command options]
82 DestroyFunc C
83 AddToFunc C
84 + I Window-SetPlacementPolicy
85 + I Exec exec $[infostore.FvwmConsoleTerminal] -e $* $[infostore.SILENT]
86
87 # Usage: X [command] [command options]
88 DestroyFunc X
89 AddToFunc X
90 + I Window-SetPlacementPolicy
91 + I Exec exec $* $[infostore.SILENT]
92
93 # Usage: S [command] [command options]
94 DestroyFunc S
95 AddToFunc S
96 + I C sudo $* $[infostore.SILENT]
97
98 # Usage: SX [command]
99 DestroyFunc SX
100 AddToFunc SX
101 + I X gksudo $* $[infostore.SILENT]
102
103 # Dummy function created to avoid the error messages.
104 # If the real function is used, this does nothing.
105 AddToFunc Window-SetPlacementPolicy I Nop
106
107 # vim:ft=fvwm