Merge remote-tracking branch 'pnp/master'
This commit is contained in:
commit
e90e346a86
@ -37,11 +37,10 @@ let
|
|||||||
|
|
||||||
fetchWallpaperScript = pkgs.writeScript "fetchWallpaper" ''
|
fetchWallpaperScript = pkgs.writeScript "fetchWallpaper" ''
|
||||||
#! ${pkgs.bash}/bin/bash
|
#! ${pkgs.bash}/bin/bash
|
||||||
${if (cfg.predicate == null) then "" else ''
|
${optionalString (cfg.predicate != null) ''
|
||||||
${cfg.predicate}
|
if ! ${cfg.predicate}; then
|
||||||
if [ $? -ne 0 ]; then
|
echo "predicate failed - will not fetch from remote"
|
||||||
echo "predicate failed"
|
exit 0
|
||||||
exit 23
|
|
||||||
fi
|
fi
|
||||||
''}
|
''}
|
||||||
mkdir -p ${shell.escape cfg.stateDir}
|
mkdir -p ${shell.escape cfg.stateDir}
|
||||||
|
24
makefu/2configs/fetchWallpaper.nix
Normal file
24
makefu/2configs/fetchWallpaper.nix
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
# check if laptop runs on umts
|
||||||
|
weaksauce-internet = with pkgs;writeScript "weaksauce-internet" ''
|
||||||
|
#! /bin/sh
|
||||||
|
if ${iproute}/bin/ip addr show dev ppp0 2>/dev/null \
|
||||||
|
| ${gnugrep}/bin/grep -q inet;then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
in {
|
||||||
|
krebs.fetchWallpaper = {
|
||||||
|
enable = true;
|
||||||
|
display = ":0";
|
||||||
|
predicate = weaksauce-internet;
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "*:0/30";
|
||||||
|
};
|
||||||
|
url = "http://echelon/wallpaper.png";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,10 @@
|
|||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
imports = [ ./base-gui.nix ];
|
imports = [
|
||||||
|
./base-gui.nix
|
||||||
|
./fetchWallpaper.nix
|
||||||
|
];
|
||||||
environment.systemPackages = with pkgs;[
|
environment.systemPackages = with pkgs;[
|
||||||
vlc
|
vlc
|
||||||
firefox
|
firefox
|
||||||
|
@ -12,6 +12,8 @@ local beautiful = require("beautiful")
|
|||||||
local naughty = require("naughty")
|
local naughty = require("naughty")
|
||||||
local menubar = require("menubar")
|
local menubar = require("menubar")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- {{{ Error handling
|
-- {{{ Error handling
|
||||||
-- Check if awesome encountered an error during startup and fell back to
|
-- Check if awesome encountered an error during startup and fell back to
|
||||||
-- another config (This code will only ever execute for the fallback config)
|
-- another config (This code will only ever execute for the fallback config)
|
||||||
@ -90,6 +92,20 @@ vicious.register(batwidget, vicious.widgets.bat, "$2%", 61, "BAT0")
|
|||||||
--
|
--
|
||||||
-- beautiful.init("/nix/store/qbx8r72yzaxpz41zq00902zwajl31b5h-awesome-3.5.6/share/awesome/themes/default/theme.lua")
|
-- beautiful.init("/nix/store/qbx8r72yzaxpz41zq00902zwajl31b5h-awesome-3.5.6/share/awesome/themes/default/theme.lua")
|
||||||
|
|
||||||
|
function find_default_theme()
|
||||||
|
-- find the default lua theme in the package path
|
||||||
|
for path in package.path:gmatch('([^;]+);') do
|
||||||
|
if path:match('awesome.*share') then
|
||||||
|
theme_path = path:match('^([^?]*)') .. '../themes/default/theme.lua'
|
||||||
|
if awful.util.file_readable(theme_path) then return theme_path end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
beautiful.init(find_default_theme())
|
||||||
|
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||||
|
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||||
|
|
||||||
-- This is used later as the default terminal and editor to run.
|
-- This is used later as the default terminal and editor to run.
|
||||||
terminal = "urxvt"
|
terminal = "urxvt"
|
||||||
editor = os.getenv("EDITOR") or "vim"
|
editor = os.getenv("EDITOR") or "vim"
|
||||||
@ -494,21 +510,9 @@ local os = {
|
|||||||
date = os.date,
|
date = os.date,
|
||||||
time = os.time
|
time = os.time
|
||||||
}
|
}
|
||||||
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function find_default_theme()
|
|
||||||
-- find the default lua theme in the package path
|
|
||||||
for path in package.path:gmatch('([^;]+);') do
|
|
||||||
if path:match('awesome.*share') then
|
|
||||||
theme_path = path:match('^([^?]*)') .. '../themes/default/theme.lua'
|
|
||||||
if awful.util.file_readable(theme_path) then return theme_path end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
beautiful.init(find_default_theme())
|
|
||||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
|
||||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
|
||||||
-- }}}
|
-- }}}
|
||||||
|
Loading…
Reference in New Issue
Block a user