Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing shows up #206

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions config/awesome/floppy/configuration/config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
return {
widget = {
email = {
address = '',
app_password = '',
imap_server = 'imap.gmail.com',
port = '993'
},

weather = {
key = '',
city_id = '',
units = 'metric',
update_interval = 1200
},

network = {
wired_interface = 'enp0s0',
wireless_interface = 'wlan0'
},

clock = {
military_mode = false,
},

screen_recorder = {
resolution = '1366x768',
offset = '0,0',
audio = false,
save_directory = '$(xdg-user-dir VIDEOS)/Recordings/',
mic_level = '20',
fps = '30'
}
},

module = {
auto_start = {
debug_mode = false
},

dynamic_wallpaper = {
wall_dir = 'theme/wallpapers/',
wallpaper_morning = 'morning-wallpaper.jpg',
wallpaper_noon = 'noon-wallpaper.jpg',
wallpaper_night = 'night-wallpaper.jpg',
wallpaper_midnight = 'midnight-wallpaper.jpg',
morning_schedule = '06:22:00',
noon_schedule = '12:00:00',
night_schedule = '17:58:00',
midnight_schedule = '24:00:00',
stretch = false
},

lockscreen = {
fallback_password = 'toor',
capture_intruder = true,
face_capture_dir = '$(xdg-user-dir PICTURES)/Intruders/',
blur_background = true,
wall_dir = 'theme/wallpapers/',
default_wall_name = 'morning-wallpaper.jpg',
tmp_wall_dir = '/tmp/awesomewm/' .. os.getenv('USER') .. '/'
}
}
}
45 changes: 0 additions & 45 deletions config/awesome/floppy/configuration/secrets.lua

This file was deleted.

6 changes: 3 additions & 3 deletions config/awesome/floppy/module/auto-start.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
local awful = require('awful')
local naughty = require('naughty')
local apps = require('configuration.apps')

local debugger_mode = false
local config = require('configuration.config')
local debug_mode = config.module.auto_start.debug_mode or false

local run_once = function(cmd)
local findme = cmd
Expand All @@ -17,7 +17,7 @@ local run_once = function(cmd)
string.format('pgrep -u $USER -x %s > /dev/null || (%s)', findme, cmd),
function(stdout, stderr)
-- Debugger
if not stderr or stderr == '' or not debugger_mode then
if not stderr or stderr == '' or not debug_mode then
return
end
naughty.notification({
Expand Down
77 changes: 38 additions & 39 deletions config/awesome/floppy/module/dynamic-wallpaper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,33 @@ local awful = require('awful')
local gears = require('gears')
local beautiful = require('beautiful')
local filesystem = gears.filesystem
local config = require('configuration.config')

-- ========================================
-- Configuration
-- Change your preference here
-- ========================================

-- Wallpaper directory. The default is:
local wall_dir = filesystem.get_configuration_dir() .. 'theme/wallpapers/'
-- local wall_dir = os.getenv('HOME') .. 'Pictures/Wallpapers/'

-- Wallpapers filename and extension
wallpaper_morning = 'morning-wallpaper.jpg'
wallpaper_noon = 'noon-wallpaper.jpg'
wallpaper_night = 'night-wallpaper.jpg'
wallpaper_midnight = 'midnight-wallpaper.jpg'

-- Change the wallpaper on scheduled time
morning_schedule = '06:22:00'
noon_schedule = '12:00:00'
night_schedule = '17:58:00'
midnight_schedule = '24:00:00'

-- Don't stretch wallpaper on multihead setups if true
local dont_stretch_wallpaper = false
local wall_config = {
-- Wallpaper directory. The default is:
-- local wall_config.wall_dir = os.getenv('HOME') .. 'Pictures/Wallpapers/'
wall_dir = filesystem.get_configuration_dir() .. (config.module.dynamic_wallpaper.wall_dir or 'theme/wallpapers/'),

-- Wallpapers filename and extension
wallpaper_morning = config.module.dynamic_wallpaper.wallpaper_morning or 'morning-wallpaper.jpg',
wallpaper_noon = config.module.dynamic_wallpaper.wallpaper_noon or 'noon-wallpaper.jpg',
wallpaper_night = config.module.dynamic_wallpaper.wallpaper_night or 'night-wallpaper.jpg',
wallpaper_midnight = config.module.dynamic_wallpaper.wallpaper_midnight or 'midnight-wallpaper.jpg',

-- Change the wallpaper on scheduled time
morning_schedule = config.module.dynamic_wallpaper.morning_schedule or '06:22:00',
noon_schedule = config.module.dynamic_wallpaper.noon_schedule or '12:00:00',
night_schedule = config.module.dynamic_wallpaper.night_schedule or '17:58:00',
midnight_schedule = config.module.dynamic_wallpaper.midnight_schedule or '24:00:00',

-- Don't stretch wallpaper on multihead setups if true
stretch = config.module.dynamic_wallpaper.stretch or false
}

-- ========================================
-- Processes
Expand Down Expand Up @@ -90,7 +93,7 @@ end

-- Set wallpaper
local set_wallpaper = function(path)
if dont_stretch_wallpaper then
if not wall_config.stretch then
for s in screen do
-- Update wallpaper based on the data in the array
gears.wallpaper.maximized (path, s)
Expand All @@ -101,18 +104,14 @@ local set_wallpaper = function(path)
end
end

-- Update wallpaper (used by the manage_timer function)
-- I think the gears.wallpaper.maximized is too fast or being ran asynchronously
-- So the wallpaper is not being updated on awesome (re)start without this timer
-- We need some delay.
-- Hey it's working, so whatever
-- Update wallpaper
local update_wallpaper = function(wall_name)
local wall_dir = wall_dir .. wall_name
set_wallpaper(wall_dir)
wall_config.wall_dir = wall_config.wall_dir .. wall_name
set_wallpaper(wall_config.wall_dir)

-- Overwrite the default wallpaper
-- This is important in case we add an extra monitor
beautiful.wallpaper = wall_dir
beautiful.wallpaper = wall_config.wall_dir
end

-- Updates variables
Expand All @@ -121,9 +120,9 @@ local manage_timer = function()
local time_now = parse_to_seconds(current_time())

-- Parse the schedules to seconds
local parsed_morning = parse_to_seconds(morning_schedule)
local parsed_noon = parse_to_seconds(noon_schedule)
local parsed_night = parse_to_seconds(night_schedule)
local parsed_morning = parse_to_seconds(wall_config.morning_schedule)
local parsed_noon = parse_to_seconds(wall_config.noon_schedule)
local parsed_night = parse_to_seconds(wall_config.night_schedule)
local parsed_midnight = parse_to_seconds('00:00:00')

-- Note that we will use '00:00:00' instead of '24:00:00' as midnight
Expand All @@ -133,36 +132,36 @@ local manage_timer = function()
-- Midnight time

-- Update Wallpaper
update_wallpaper(wallpaper_midnight)
update_wallpaper(wall_config.wallpaper_midnight)

-- Set the data for the next scheduled time
wall_data = {morning_schedule, wallpaper_morning}
wall_data = {wall_config.morning_schedule, wall_config.wallpaper_morning}

elseif time_now >= parsed_morning and time_now < parsed_noon then
-- Morning time

-- Update Wallpaper
update_wallpaper(wallpaper_morning)
update_wallpaper(wall_config.wallpaper_morning)

-- Set the data for the next scheduled time
wall_data = {noon_schedule, wallpaper_noon}
wall_data = {wall_config.noon_schedule, wall_config.wallpaper_noon}

elseif time_now >= parsed_noon and time_now < parsed_night then
-- Noon time

-- Update Wallpaper
update_wallpaper(wallpaper_noon)
update_wallpaper(wall_config.wallpaper_noon)

-- Set the data for the next scheduled time
wall_data = {night_schedule, wallpaper_night}
wall_data = {wall_config.night_schedule, wall_config.wallpaper_night}
else
-- Night time

-- Update Wallpaper
update_wallpaper(wallpaper_night)
update_wallpaper(wall_config.wallpaper_night)

-- Set the data for the next scheduled time
wall_data = {midnight_schedule, wallpaper_midnight}
wall_data = {wall_config.midnight_schedule, wall_config.wallpaper_midnight}
end

-- Get the time difference to set as timeout for the wall_updater timer below
Expand All @@ -187,7 +186,7 @@ local wall_updater = gears.timer {
awesome.connect_signal(
'module::change_wallpaper',
function()
set_wallpaper(wall_dir .. wall_data[2])
set_wallpaper(wall_config.wall_dir .. wall_data[2])

-- Update values for the next specified schedule
manage_timer()
Expand Down
Loading