system-configuration/modules/home-config/openbox.scm

openbox.scm

1
(define-module (home-config openbox)
2
  #:use-module (home)
3
  #:use-module (home openbox)
4
  #:use-module (gnu packages compton)
5
  #:use-module (gnu packages dunst)
6
  #:use-module (gnu packages game-development)
7
  #:use-module (gnu packages games)
8
  #:use-module (gnu packages geo)
9
  #:use-module (gnu packages gnuzilla)
10
  #:use-module (gnu packages ibus)
11
  #:use-module (gnu packages image-viewers)
12
  #:use-module (gnu packages inkscape)
13
  #:use-module (gnu packages lxde)
14
  #:use-module (gnu packages mail)
15
  #:use-module (gnu packages messaging)
16
  #:use-module (gnu packages password-utils)
17
  #:use-module (gnu packages pulseaudio)
18
  #:use-module (gnu packages sync)
19
  #:use-module (gnu packages xfce)
20
  #:use-module (games packages 7-billion-humans)
21
  #:use-module (games packages baba-is-you)
22
  #:use-module (games packages factorio)
23
  #:use-module (games packages mini-metro)
24
  #:use-module (games packages starsector)
25
  #:use-module (games packages sunless-skies)
26
  #:use-module (guix gexp)
27
  #:export (tyreunom-openbox-configuration
28
            openbox-home))
29
30
(define openbox-environment
31
  (plain-file "environment" "eval $(ssh-agent)"))
32
(define openbox-autostart
33
  (computed-file "autostart"
34
     #~(with-output-to-file #$output
35
         (lambda _
36
           (format #t "HOME=/tmp/pa ~a --start~%" #$(file-append pulseaudio "/bin/pulseaudio"))
37
           (format #t "~a --bg-fill ~a~%" #$(file-append feh "/bin/feh")
38
                   #$(local-file "/data/tyreunom/background.png"))
39
           (format #t "~a -CGb~%" #$(file-append compton "/bin/compton"))
40
           (format #t "~a -conf ~a &~%" #$(file-append dunst "/bin/dunst")
41
                   #$(plain-file "dunstrc" ""))
42
           (format #t "export GTK_IM_MODULE=ibus
43
export XMODIFIERS=@im=ibus
44
export QT_IM_MODULE=ibus
45
export GUIX_GTK2_IM_MODULE_FILE=~~/.guix-profile/lib/gtk-2.0/2.10.0/immodules-gtk2.cache
46
export GUIX_GTK3_IM_MODULE_FILE=~~/.guix-profile/lib/gtk-3.0/3.0.0/immodules-gtk3.cache
47
~a -drx~%" #$(file-append ibus "/bin/ibus-daemon"))))))
48
(define openbox-rc (local-file "files/openbox/rc.xml"))
49
50
(define tyreunom-openbox-configuration
51
  (openbox-configuration
52
    (autostart openbox-autostart)
53
    (environ openbox-environment)
54
    (rc openbox-rc)
55
    (menus
56
      (list
57
        (openbox-menu
58
          (id "apps-game-menu")
59
          (label "Jeux")
60
          (elements
61
            (list
62
              (openbox-element-execute
63
                (label "MineTest")
64
                (command (file-append minetest "/bin/minetest")))
65
              (openbox-element-execute
66
                (label "Starsector")
67
                (command (file-append starsector "/bin/starsector")))
68
              (openbox-element-execute
69
                (label "Factorio")
70
                (command (file-append factorio "/bin/factorio")))
71
              (openbox-element-execute
72
                (label "7 Billion Humans")
73
                (command (file-append gog-7-billion-humans "/bin/7-billion-humans")))
74
              (openbox-element-execute
75
                (label "Sunless Skies")
76
                (command (file-append gog-sunless-skies "/bin/sunless-skies")))
77
              (openbox-element-execute
78
                (label "Baba is You")
79
                (command (file-append baba-is-you "/bin/baba-is-you")))
80
              (openbox-element-execute
81
                (label "Mini Metro")
82
                (command (file-append mini-metro "/bin/mini-metro")))
83
              (openbox-element-execute
84
                (label "0ad")
85
                (command (file-append 0ad "/bin/0ad")))
86
              (openbox-element-execute
87
                (label "godot")
88
                (command (file-append godot "/bin/godot"))))))
89
        (openbox-menu
90
          (id "apps-other-menu")
91
          (label "Autres")
92
          (elements
93
            (list
94
              (openbox-element-execute
95
                (label "Pavucontrol")
96
                (command (file-append pavucontrol "/bin/pavucontrol")))
97
              (openbox-element-execute
98
                (label "Owncloud")
99
                (command (file-append owncloud-client "/bin/owncloud")))
100
              (openbox-element-execute
101
                (label "Keepass")
102
                (command (file-append keepassxc "/bin/keepassxc")))
103
              (openbox-element-execute
104
                (label "Claws-mail")
105
                (command (file-append claws-mail "/bin/claws-mail --alternate-config-dir /data/tyreunom/.config/claws-mail")))
106
              (openbox-element-execute
107
                (label "Hexchat")
108
                (command (file-append hexchat "/bin/hexchat")))
109
              (openbox-element-execute
110
                (label "JOSM")
111
                (command (file-append josm "/bin/josm")))
112
              (openbox-element-execute
113
                (label "Inkscape")
114
                (command (file-append inkscape "/bin/inkscape"))))))))
115
    (root-elements
116
      (list
117
        (openbox-element-menu (id "apps-game-menu"))
118
        (openbox-element-menu (id "apps-other-menu"))
119
        (openbox-element-execute
120
          (label "Terminal")
121
          (command (file-append xfce4-terminal "/bin/xfce4-terminal")))
122
        (openbox-element-execute
123
          (label "Navigateur")
124
          (command (file-append icecat "/bin/icecat -P --no-remote")))
125
        (openbox-element-execute
126
          (label "Gestionnaire de fichiers")
127
          (command (file-append pcmanfm "/bin/pcmanfm")))))))
128
129
130
(define openbox-home
131
  (user-home openbox-home-type
132
             tyreunom-openbox-configuration))
133