tlp, add shortcuts for monitoring and switching wireless modules.
This commit is contained in:
@@ -134,3 +134,41 @@
|
|||||||
- "ln -sf {{ runit_script_dir }}/{{ tlp_service }} {{ runit_service_dir }}/{{ tlp_service }}"
|
- "ln -sf {{ runit_script_dir }}/{{ tlp_service }} {{ runit_service_dir }}/{{ tlp_service }}"
|
||||||
#- "sv start {{ tlp_service }}" # Not necessary and sometimes gives a false negative.
|
#- "sv start {{ tlp_service }}" # Not necessary and sometimes gives a false negative.
|
||||||
when: ansible_service_mgr == "runit"
|
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user