Skip to content

Commit

Permalink
Try to fix empty preferences, monitor sleep disabled only when SM
Browse files Browse the repository at this point in the history
running
  • Loading branch information
Mika Viinamäki committed Oct 8, 2017
1 parent 91cd5fa commit ac75943
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 42 deletions.
7 changes: 6 additions & 1 deletion roles/stepmania/files/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ while [ -z "$(pidof pulseaudio)" ]; do
sleep 0.5
done

trap 'pkill unclutter; xset +dpms; xset s on' EXIT

# disable sleeps
xset -dpms
xset s off

# hide mouse cursor if not moved
trap 'pkill unclutter' EXIT
unclutter -idle 1 -root &

pasuspender /stepmania/stepmania
Expand Down
31 changes: 16 additions & 15 deletions roles/stepmania/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@

- name: Add empty Preferences.ini if does not exist
copy:
content: |
[Options]
[Game-dance]
content: "[Options]\r\n\r\n[Game-dance]\r\n\r\n"
dest: /home/stepmania/.stepmania-5.0/Save/Preferences.ini
force: no
owner: stepmania
Expand All @@ -73,34 +71,38 @@
- name: Set basic preferences
lineinfile:
path: /home/stepmania/.stepmania-5.0/Save/Preferences.ini
line: '{{ item.key }}={{ item.value }}'
line: "{{ item.key }}={{ item.value }}\r"
insertafter: '\[Options\]'
regexp: '^{{ item.key }}'
with_items:
- key: Windowed
value: 0
value: '0'
- key: SoundDrivers
value: alsa-sw
- key: SoundDevice
value: hw:CARD=Audio,DEV=0
- key: LightsDriver
value: PIUIO_Leds
- key: Theme
value: Simply-Love-SM5
value: 'Simply-Love-SM5'
- key: DisplayWidth
value: 1920
value: '1920'
- key: DisplayHeight
value: 1080
value: '1080'
- key: DisplayAspectRatio
value: '1.777778'
- key: ArcadeOptionsNavigation
value: 1
value: '1'
- key: OnlyDedicatedMenuButtons
value: 1
value: '1'
- key: BGBrightness
value: '0.200000'
- key: ShowNativeLanguage
value: 0
value: '0'
- key: MusicWheelSwitchSpeed
value: '100'
- key: DefaultModifiers
value: 'FailOff, Overhead, Cel'

- name: Replace all instances of theme
replace:
Expand All @@ -110,8 +112,7 @@

- name: Add empty ThemePrefs.ini if does not exist
copy:
content: |
[Simply Love]
content: "[Simply Love]\r\n\r\n"
dest: /home/stepmania/.stepmania-5.0/Save/ThemePrefs.ini
force: no
owner: stepmania
Expand All @@ -120,7 +121,7 @@
- name: Set some theme preferences
lineinfile:
path: /home/stepmania/.stepmania-5.0/Save/ThemePrefs.ini
line: '{{ item.key }}={{ item.value }}'
line: "{{ item.key }}={{ item.value }}\r"
insertafter: '\[Simply Love\]'
regexp: '^{{ item.key }}'
with_items:
Expand All @@ -131,7 +132,7 @@
- key: TimingWindowAdd
value: '0.0015'
- key: AllowScreenSelectProfile
value: true
value: 'true'

- name: Make sure noteskins directory exists
file:
Expand Down
6 changes: 0 additions & 6 deletions roles/utils/files/disable-sleep-on-monitor.desktop

This file was deleted.

4 changes: 0 additions & 4 deletions roles/utils/files/disable-sleep-on-monitor.sh

This file was deleted.

17 changes: 1 addition & 16 deletions roles/utils/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,13 @@
enabled: no
state: stopped

- name: Autostart script for disabling sleep
copy:
src: files/disable-sleep-on-monitor.sh
dest: /home/stepmania/disable-sleep-on-monitor.sh
owner: stepmania
group: stepmania
mode: 0755

- name: Make sure .config folder exists
- name: Make sure .config/autostart folder exists
file:
path: /home/stepmania/.config/autostart
state: directory
owner: stepmania
group: stepmania

- name: Add disabling sleep to autostart
copy:
src: files/disable-sleep-on-monitor.desktop
dest: /home/stepmania/.config/autostart/disable-sleep-on-monitor.desktop
owner: stepmania
group: stepmania

- name: Remove light-locker from autostart
copy:
src: files/disabled-autostart.desktop
Expand Down

0 comments on commit ac75943

Please sign in to comment.