Cleaned up and refactored

This commit is contained in:
2023-11-16 23:29:43 +01:00
parent cd2c66bc54
commit 3dbdd1dfcb
39 changed files with 24 additions and 31 deletions

View File

@@ -0,0 +1,25 @@
# Ansible Role: caffeine_auto_start
An Ansible Role that installs `caffeine-ng` on Archlinux systems and sets it to start automatically when the user logs in.
## Requirements
- The target system should be Archlinux.
- Ansible 2.4 or higher.
- The [kewlfft.aur.aur](https://galaxy.ansible.com/kewlfft/aur) Ansible Galaxy role for managing AUR packages.
## Role Variables
None.
## License
AGPL 3
## Author
Kevin Veen-Birkenbach - kevin@veen.world - https://www.veen.world/
## Background
The code for this role was created in an interactive conversation with OpenAI's language model. You can view the original conversation [here](https://chat.openai.com/share/fa846dac-6068-4386-b3e7-b75f1248ec82).

View File

@@ -0,0 +1,16 @@
---
dependencies:
- system-aur-helper
galaxy_info:
author: Kevin Veen-Birkenbach
description: Ansible role for installing caffeine-ng and setting it to start at user login.
license: AGPL 3
min_ansible_version: 2.4
platforms:
- name: Archlinux
versions:
- all
galaxy_tags:
- caffeine
- autostart
- archlinux

View File

@@ -0,0 +1,16 @@
---
- name: Install caffeine
kewlfft.aur.aur:
use: yay
name:
- caffeine-ng
- name: Create autostart directory if it doesn't exist
file:
path: "{{auto_start_directory}}"
state: directory
- name: Copy caffeine.desktop file to autostart directory
template:
src: caffeine.desktop.j2
dest: "{{auto_start_directory}}caffeine.desktop"

View File

@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Exec=/usr/bin/caffeine
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=caffeine
Name=caffeine
Comment[en_US]=
Comment=

View File

@@ -0,0 +1 @@
auto_start_directory: "/home/{{client_username}}/.config/autostart/"