Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
X
xmonad
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Déploiement
Releases
Registre de conteneur
Registre de modèles
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Ce projet est archivé. Le dépôt et les autres ressources du projet sont en lecture seule.
Afficher davantage de fils d'Ariane
Kubat
xmonad
Validations
b3fa836c
Vérifiée
Valider
b3fa836c
rédigé
4 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Adding xmonadctl
parent
5a52f13e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
.gitignore
+1
-0
1 ajout, 0 suppression
.gitignore
xmonadctl.hs
+59
-0
59 ajouts, 0 suppression
xmonadctl.hs
avec
60 ajouts
et
0 suppression
.gitignore
+
1
−
0
Voir le fichier @
b3fa836c
...
...
@@ -9,3 +9,4 @@ wallpaper
xmonad
xmonad-*
*.hi
xmonadctl
Ce diff est replié.
Cliquez pour l'agrandir.
xmonadctl.hs
0 → 100644
+
59
−
0
Voir le fichier @
b3fa836c
import
Graphics.X11.Xlib
import
Graphics.X11.Xlib.Extras
import
System.Environment
import
System.IO
import
Data.Char
main
::
IO
()
main
=
parse
True
"XMONAD_COMMAND"
=<<
getArgs
parse
::
Bool
->
String
->
[
String
]
->
IO
()
parse
input
addr
args
=
case
args
of
[
"--"
]
|
input
->
repl
addr
|
otherwise
->
return
()
(
"--"
:
xs
)
->
sendAll
addr
xs
(
"-a"
:
a
:
xs
)
->
parse
input
a
xs
(
"-h"
:
_
)
->
showHelp
(
"--help"
:
_
)
->
showHelp
(
"-?"
:
_
)
->
showHelp
(
a
@
(
'-'
:
_
)
:
_
)
->
hPutStrLn
stderr
(
"Unknown option "
++
a
)
(
x
:
xs
)
->
sendCommand
addr
x
>>
parse
False
addr
xs
[]
|
input
->
repl
addr
|
otherwise
->
return
()
repl
::
String
->
IO
()
repl
addr
=
do
e
<-
isEOF
case
e
of
True
->
return
()
False
->
do
l
<-
getLine
sendCommand
addr
l
repl
addr
sendAll
::
String
->
[
String
]
->
IO
()
sendAll
addr
ss
=
foldr
(
\
a
b
->
sendCommand
addr
a
>>
b
)
(
return
()
)
ss
sendCommand
::
String
->
String
->
IO
()
sendCommand
addr
s
=
do
d
<-
openDisplay
""
rw
<-
rootWindow
d
$
defaultScreen
d
a
<-
internAtom
d
addr
False
m
<-
internAtom
d
s
False
allocaXEvent
$
\
e
->
do
setEventType
e
clientMessage
setClientMessageEvent
e
rw
a
32
m
currentTime
sendEvent
d
rw
False
structureNotifyMask
e
sync
d
False
showHelp
::
IO
()
showHelp
=
do
pn
<-
getProgName
putStrLn
(
"Send commands to a running instance of xmonad. xmonad.hs must be configured with XMonad.Hooks.ServerMode to work.
\n
"
++
"-a atomname can be used at any point in the command line arguments to change which atom it is sending on.
\n
"
++
"If sent with no arguments or only -a atom arguments, it will read commands from stdin.
\n
"
++
"Ex:
\n
"
++
pn
++
" cmd1 cmd2
\n
"
++
pn
++
" -a XMONAD_COMMAND cmd1 cmd2 cmd3 -a XMONAD_PRINT hello world
\n
"
++
pn
++
" -a XMONAD_PRINT # will read data from stdin."
++
"
\n
The atom defaults to XMONAD_COMMAND."
)
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter