#!/bin/sh
#
#    Copyright (C) 2018-2022 Ruben Rodriguez <ruben@trisquel.info>
#    Copyright (C) 2018 Pablo Correa Gómez <p.correag@member.fsf.org>
#    Copyright (C) 2019 Mason Hock <mason@masonhock.com>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#

VERSION=5

. ./config

cat << EOF > debian/redshift.conf
; Global settings
[redshift]
temp-day=5700
temp-night=3500
transition=1
gamma=1:1:1

; WARNING: Changing provider to geoclue2 will set lat and lon
; automatically, but it will trigger background internet connections
location-provider=manual
; location-provider=geoclue2
adjustment-method=randr

; The location provider and adjustment method settings
; are in their own sections.
[manual]
lat=0.0
lon=0.0

; Numbering starts from 0, and refers to screen number,
; so this is actually the first screen.
[vidmode]
screen=0
 
EOF
echo "debian/redshift.conf /etc" >> debian/redshift.install

# Fix apparmor profile
sed 's/+37,7/+37,8/; /redshift-shared/a+\  /etc/redshift.conf r,' -i debian/patches/Fix-AppArmor-profile-for-Wayland.patch

# Remove geoclue daemon dependency
sed -i '/geoclue-2.0/d' debian/control

changelog "Added default manual configuration"

package
