-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrc.lua.new
executable file
·280 lines (277 loc) · 9.88 KB
/
rc.lua.new
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
-------------------------------------------------
-- author: David Cobac
-- twitter: @david_cobac
-- github: https://github.com/cobacdavid
-- date: 2020
-- copyright: CC-BY-NC-SA
-------------------------------------------------
-------------------------------------------------
-- some parts from awesome wm
-- distribution
-- copyright ??
-------------------------------------------------
--
-- GDM3 screen configuration:
-- 1. start with gnome
-- 2. configure screens with the gnome tool
-- 3. copy ~/.config/monitors.xml to /var/lib/gdm/.config/monitors.xml
-- from http://forums.debian.net/viewtopic.php?f=6&t=122320
--
-- awesomeWM session screen configuration
-- 1. install and run arandr
-- 2. create ~/.screenlayout/xrandr_config.sh
-- 3. execute this script from ~/.profile
--
-- if you want to insert a xrandr command in rc.lua, it will
-- possibly results in bad screen geometry variables so that you
-- got to awesome.restart awesomeWM to retrieve proper values
--
--
-- Standard awesome library
os = require("os")
awful = require("awful")
--
config = awful.util.getdir("config")
os.setlocale(os.getenv("LANG"))
myhome = os.getenv("HOME") .. "/"
--
-- IMPORTANT VARIABLES
-- also see variableDefinitions.lua
socket = require("socket")
-- asus is my laptop's hostname
local hname = socket.dns.gethostname()
if hname == "asus" or hname == "basus" then
-- sur laptop asus
-- eDP1 1920x1080
ordinateur = "laptop"
montouchpadactif = true
elseif hname == "master" then
-- sur master NSI
-- eDP-1 1366x768
ordinateur = "masterNSI"
elseif hname == "david-coolermaster" then
ordinateur = "desktop"
-- configuration1
-- VGA-0 1920x1080
-- DVI-0 1920x1080
-- xrandr --output DVI-0 --mode 1920x1080 --output VGA-0 --above DVI-0 --mode 1920x1080
ecrans = "configuration1"
elseif hname == "coolermaster" then
ordinateur = "desktop"
-- configuration1
-- VGA-0 1920x1080
-- DVI-0 1920x1080
-- xrandr --output DVI-0 --mode 1920x1080 --output VGA-0 --above DVI-0 --mode 1920x1080
ecrans = "configuration1"
else
ordinateur = "inconnu"
end
--
largeurPremier = screen[1].geometry.width
hauteurPremier = screen[1].geometry.height
if screen:count() >= 2 then
largeurSecond = screen[2].geometry.width
hauteurSecond = screen[2].geometry.height
end
--
-- other variables
dofile (config .. "/variableDefinitions.lua")
dofile (config .. "/creeLogo.lua")
--
--
gears = require("gears")
-- Theme handling library
beautiful = require("beautiful")
beautiful.init(config .. "/themes/david/theme.lua")
--
wibox = require("wibox")
naughty = require("naughty")
menubar = require("menubar")
-- hotkeys_popup = require("awful.hotkeys_popup").widget
-- require("awful.hotkeys_popup.keys")
require("awful.autofocus")
has_fdo, freedesktop = pcall(require, "freedesktop")
--
fu = require("fonctionsUtiles")
-- generic widget
flower_pbar = require("widgets.flower_pbar.flower_pbar")
-- widgets
separateur = require("widgets.separateur.separateur")
heure = require("widgets.heure.heure")
madate = require("widgets.date.date")
bigC = require("widgets.bigClock.bigClock")
volumemaster = require("widgets.volumeMaster.volumeMaster")
luminosite = require("widgets.luminosite.luminosite")
luminositeClavier = require("widgets.luminositeClavier.luminositeClavier")
luminositeEcran = require("widgets.luminositeEcran.luminositeEcran")
calendrier = require("widgets.calendrier.calendrier")
calendrierMois = require("widgets.calendrier.calendrierMois")
infos = require("widgets.infos.infos")
chrono = require("widgets.chrono.chrono")
lastfm = require("widgets.lastfm-scrobbles.lastfm-scrobbles")
--btg = require("widgets.batterieGraph.batterieGraph")
--meteo = require("widgets.meteo.meteo")
--covid = require("widgets.covid.covid")
covidv2 = require("widgets.covid.covidv2")
matrice = require("widgets.matrice.matrice")
fichiers = require("widgets.fichiers.fichiers")
polar = require("widgets.polar.polar")
dtv2 = require("widgets.dtv2.dtv2")
wmatrice = require("widgets.widgetMatrice.widgetMatrice")
--
ppeintTag = require("widgets.ppeintTag.ppeintTag")
ppeintNasa = require("widgets.ppeintNasa.ppeintNasa")
ppeintId = require("widgets.ppeintId.ppeintId")
--
mpdCom = require("mpdCommande")
ecranFlou = require("widgets.ecranFlou.ecranFlou")
-- widgets titlebar fenêtres
killneuf = require("widgets.killneuf.killneuf")
blocageopacite = require("widgets.opacite.blocageopacite")
opacite = require("widgets.opacite.opacite")
screenshot = require("widgets.screenshot.screenshot")
dimFenetre = require("widgets.dimFenetre.dimFenetre")
tempsPasse = require("widgets.tempsPasse.tempsPasse")
titreClient = require("widgets.titreClient.titreClient")
secretFenetre = require("widgets.secretFenetre.secretFenetre")
-- widgets externes
github_contributions_widget = require("awesome-wm-widgets.github-contributions-widget.github-contributions-widget")
if ordinateur ~= "masterNSI" then
naughty.notify({text=ordinateur})
idMeteo = require("widgets.meteo.private_openweather_api_key")
weather_widget = require("awesome-wm-widgets.weather-widget.weather")
end
--
semi_analog_clock = require("widgets.semi_analog_clock.semi_analog_clock")
almost_analog_clock = require("widgets.almost_analog_clock.almost_analog_clock")
--
--
listeRcFiles = {--
"errorhandling45.lua",
-- "logicielsIndispensables.lua",
-- "myPRIVATEvariables.lua",
"stats.lua",
"menu.lua",
"tagWibar.lua",
"sourisEtClavier.lua",
"rules45.lua",
"signaux.lua"
}
--
for i, f in ipairs(listeRcFiles) do
dofile (config .. "/" .. f)
end
--
-- appsDemarrage in variableDefinitions
for _, app in ipairs(appsDemarrage) do
fu.executeUneFois(app)
end
--
ecranFlou.isActivated = false
ppeintTag.imagesFonds({
strip_color = couleurTheme
})
-- ppeintDesc = ppeintNasa()
--
-- ppeintTag on first tag of first screen at startup
screen[1].selected_tag:emit_signal("property::selected")
--
-- papier peint pytchi
COMMANDE_PYTCHI = [[ bash -c "python3 /home/david/.config/awesome/ppeint_pytchi.py \"%s\"" ]]
-- screen.connect_signal("request::wallpaper",
-- function(s)
-- awful.spawn.easy_async(string.format(COMMAND, "fields of the nephilim"),
-- function()
-- awful.wallpaper {
-- screen = screen[2],
-- widget = {
-- resize = false,
-- vertical_fit_policy = "fit",
-- halign = "center",
-- image = gears.surface.load_uncached("/home/david/ppeint.png"),
-- widget = wibox.widget.imagebox
-- }
-- }
-- end
-- )
-- end
-- )
-- gears.timer({
-- timeout = 60,
-- autostart = true,
-- callback = function()
-- screen[2]:emit_signal("request::wallpaper")
-- end
-- })
--
-- monppeint = function()
-- awful.wallpaper({
-- })
-- end
-- ppeint_pytchi_theme = "the cure"
-- fond_annexe = wibox({
-- screen = screen[2],
-- x = 0,
-- y = 0,
-- bg = "#000",
-- opacity = 1,
-- visible = true,
-- below = true,
-- widget = wibox.widget({
-- {
-- id = "monimage",
-- image = "/home/david/ppeint.jpg",
-- resize = false,
-- halign = "center",
-- valign = "center",
-- widget = wibox.widget.imagebox,
-- },
-- {
-- id = "montexte",
-- markup = "<tt><b>" .. ppeint_pytchi_theme .. "</b></tt>",
-- valign = "bottom",
-- align = "left",
-- widget = wibox.widget.textbox
-- },
-- widget = wibox.layout.stack
-- })
-- })
-- fond_annexe:buttons({
-- awful.button({}, 3, function()
-- fond_annexe.widget.monimage.resize = true
-- -- fond_annexe.widget.montexte.markup = fond_annexe.widget.montexte.markup .. " <tt><b> clic ! </b></tt>"
-- end),
-- awful.button({}, 1, function()
-- fond_annexe.widget.monimage.resize = false
-- -- fond_annexe.widget.montexte.markup = fond_annexe.widget.montexte.markup .. " <tt><b> clic ! </b></tt>"
-- end)
-- })
-- gears.timer({
-- timeout = 60,
-- autostart = true,
-- callback = function()
-- awful.spawn.easy_async(string.format(COMMANDE_PYTCHI, ppeint_pytchi_theme),
-- function(stdout)
-- fond_annexe.widget.monimage.image = gears.surface.load_uncached("/home/david/ppeint.jpg")
-- local titre = stdout:match("(.*)\n") or stdout
-- fond_annexe.widget.montexte.markup = "<tt><b>" .. titre .. "</b></tt>"
-- end
-- )
-- end
-- })
-- awful.placement.maximize(fond_annexe)
--
gears.timer({
timeout = 600,
autostart = true,
callback = function()
awful.spawn.easy_async([[ bash -c "python3 /home/david/travail/david/production/lycee/informatique/modules_perso/pytchi/pytchibot/gestion_requetes.py" ]],
function(stdout)
end
)
end
})
--
fu.commande_execute(clavierCmd .. " " .. configAwesome)
--
fu.montre("Démarrage terminé")