tlp, add shortcuts for monitoring and switching wireless modules.

This commit is contained in:
me
2026-08-15 17:01:26 -07:00
parent 8db5389c6d
commit 4a21321318
+38
View File
@@ -134,3 +134,41 @@
- "ln -sf {{ runit_script_dir }}/{{ tlp_service }} {{ runit_service_dir }}/{{ tlp_service }}"
#- "sv start {{ tlp_service }}" # Not necessary and sometimes gives a false negative.
when: ansible_service_mgr == "runit"
- name: Workstation | Linux | Software | TLP | runit | Functions & Aliases
blockinfile:
path: "{{ item }}"
block: |
function tlp-devices {
if [[ ! -z "$@" ]]; then
tlp-devices
echo -e "\nApplying '$@'...\n"
fi
wifi $@
bluetooth $@
nfc $@
wwan $@
}
alias devices="tlp-devices "
function all-off {
tlp-devices off
mullvad disconnect
}
alias off="all-off "
function all-on {
tlp-devices on
mullvad connect
mullvad reconnect
}
alias on="all-on "
marker: '# {mark} MANAGED BY ANSIBLE | tlp'
state: present
create: yes
backup: no
loop:
- "{{ user_user.home }}/.bashrc"
- "{{ user_user.home }}/.zshrc"
- "{{ user_root.home }}/.bashrc"
- "{{ user_root.home }}/.zshrc"