Skip to content

Commit

Permalink
V1.0.1 Release (#19)
Browse files Browse the repository at this point in the history
* update version number to 1.0.1 Beta

* add sunroof

* add spotube

* add cursor themes

* add cursor size & changed how all.yml gets the user

* update changelog

* add stable/Rolling release instructions

* add a backup script for dotfiles

* backup pacman mirrorlist, ad rate-mirrors, and update pacman conf

* rate-mirrors hotfix

* add rate-mirrors, update mirrors, add chaotic_aur

* add update system packages

* update default for chaotic_aur: false

* pacman fixes

* refactor framework workaround to laptop workarounds

* hyprshot added

* keybind for fullscreen

* add libadwaita as a dependencie

* v1.0.1 Release
  • Loading branch information
dianaw353 authored Jul 23, 2024
1 parent 15b4ff2 commit 988486a
Show file tree
Hide file tree
Showing 20 changed files with 338 additions and 49 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
Version 1.0.1
https://github.com/dianaw353/dotfiles/releases/tag/v1.0.1
--------------------------------------------------------
- Script: Add sunroof and spotube as new applications
- Script: Add 4 new flags
- Hyprland: Add autostart template for the following to work
- Icons: Add new icons section
- Add flag for cursor package (AUR ONLY ATM)
- Add flag for cursor theme
- Add flag to change cursor size
- Pacman: Add for chaotic_aur
- Update pacman conf to also have ILoveCandy and VerbosePkgLists
- Script: rate-mirrors added
- Add rate-mirrors package
- Update pacman & chaotic aur mirrors list
- Script: Refactor framework workaround to laptop workarounds
- Update pacman conf to also have ILoveCandy and VerbosePkgLists
- Refactor aur_helper
- Add script to backup dotfiles
- Add Hyprshot
- Add keybindings for hyprshot
- Add keybindings to set active windodw to fullscreen
- Add libadwaita as a dependencie

Version 1.0
https://github.com/dianaw353/dotfiles/releases/tag/v1.0
--------------------------------------------------------
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<h1> Dotfiles V1.0</h1>
<h1> Dotfiles V1.0.1</h1>
</div>

<div align="center">
Expand Down Expand Up @@ -34,7 +34,11 @@

1. Clone this repo
```
git clone https://github.com/dianaw353/dotfiles.git
#Stable Release
git clone https://github.com/dianaw353/dotfiles.git -b main --depth=1
cd dotfiles
#Rolling Release
git clone https://github.com/dianaw353/dotfiles.git -b dev --depth=1
cd dotfiles
```
1. Run the following script
Expand Down
45 changes: 39 additions & 6 deletions dotfiles
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LCYAN='\033[01;36m'
WHITE='\033[01;37m'
OVERWRITE='\e[1A\e[K'

#emoji codes
# emoji codes
CHECK_MARK="${GREEN}\xE2\x9C\x94${NC}"
X_MARK="${RED}\xE2\x9C\x96${NC}"
PIN="${RED}\xF0\x9F\x93\x8C${NC}"
Expand All @@ -33,13 +33,13 @@ HOT="${ORANGE}\xF0\x9F\x94\xA5${NC}"
WARNING="${RED}\xF0\x9F\x9A\xA8${NC}"
RIGHT_ANGLE="${GREEN}\xE2\x88\x9F${NC}"


DOTFILES_LOG="$HOME/.dotfiles.log"

set -e

# Paths
DOTFILES_DIR=$(pwd)

# _header colorize the given argument with spacing
function _task {
# if _task is called while a task was set, complete the previous
Expand All @@ -53,7 +53,7 @@ function _task {

# _cmd performs commands with error checking
function _cmd {
#create log if it doesn't exist
# create log if it doesn't exist
if ! [[ -f $DOTFILES_LOG ]]; then
touch $DOTFILES_LOG
fi
Expand Down Expand Up @@ -120,9 +120,6 @@ update_ansible_galaxy() {
source /etc/os-release
_task "Loading Setup for detected OS: $ID"
case $ID in
ubuntu)
ubuntu_setup
;;
arch)
arch_setup
;;
Expand All @@ -133,3 +130,39 @@ case $ID in
esac

update_ansible_galaxy $ID

# Backup dotfiles
backup_dotfiles() {
local backup_dir="$HOME/dotfiles_backup/$(date +'%Y%m%d_%H%M%S')"
_task "Creating backup directory: $backup_dir"
if mkdir -p "$backup_dir"; then
_task_done
else
printf "${LYELLOW} [-] Failed to create backup directory. Skipping backup.\n"
return 1
fi

_task "Backing up .config directory"
if cp -r "$HOME/.config" "$backup_dir" 2>/dev/null; then
_task_done
else
printf "${LYELLOW} [-] Couldn't find .config to create a back up directory. Skipping.\n"
fi

_task "Backing up .zshrc"
if cp "$HOME/.zshrc" "$backup_dir" 2>/dev/null; then
_task_done
else
printf "${LYELLOW} [-] Couldn't find .zshrc to create a backup. Skipping.\n"
fi

_task "Backing up .bashrc"
if cp "$HOME/.bashrc" "$backup_dir" 2>/dev/null; then
_task_done
else
printf "${LYELLOW} [-] Couldn't find .bashrc to create a backup. Skipping.\n"
fi
}

backup_dotfiles

18 changes: 13 additions & 5 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## replace diana with the user on your computer
user: "{{ host_user }}"
#user: "{{ host_user }}"
user: "{{ ansible_env['USER']}}"

#
# Miscellaneous
Expand All @@ -14,18 +15,23 @@ enable_bluetooth: true
# pipewire or pluseaudio
audio_server: pipewire

# Framework Laptop Intel 13 Inch fix fn keys,brightness,sound buttons
# true or false
framework_laptop_intel_13inch: true

default_shell: zsh # Change to the desired default shell, e.g., zsh or bash

icons:
cursor_icons_package: bibata-cursor-theme-bin # AUR ONLY CURRENTLY
cursor_icons_theme: Bibata-Modern-Ice
# available cursor sizes: 16 20 22 24 28 32 40 48 56 64 72 80 88 96
cursor_icons_size: 24

pacman:
parallel_downloads: 5 # Adjust as needed
enable_multilib: false # Set to false if you don't want to enable multilib
# set aur helper
# supported helpers are here https://github.com/kewlfft/ansible-aur#kewlfftauraur-module
aur_helper: yay
# Option to enable the chaotic-aur: https://aur.chaotic.cx/ or keep it disabled
# true of false
chaotic_aur: false

default_roles:
- system
Expand All @@ -43,4 +49,6 @@ default_roles:
- greetd
- mission-center
- zed
- sunroof #vencord fork discord client
- spotube #spotify open source client

19 changes: 3 additions & 16 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,21 @@
- name: DotFiles Config
hosts: localhost
connection: local
gather_facts: yes

pre_tasks:
- name: Register Current User
ansible.builtin.set_fact:
host_user: "{{ ansible_env['USER']}}"
when: host_user is not defined

- name: Pacman Config
ansible.builtin.import_tasks: pre_tasks/pacman/main.yml

- name: Update default shell
ansible.builtin.import_tasks: pre_tasks/shell/main.yml

- name: Aur Wrapper
ansible.builtin.import_tasks: pre_tasks/aur_wrapper/main.yml

- name: Import GPU drivers tasks
ansible.builtin.import_tasks: pre_tasks/gpu_drivers/gpu_drivers.yml

- name: Load hid_sensor_hub module
command: modprobe -i hid_sensor_hub
when: framework_laptop_intel_13inch
become: true

- name: Unload hid_sensor_hub module
command: modprobe -r hid_sensor_hub
when: not framework_laptop_intel_13inch
become: true
- name: Laptop workarounds
ansible.builtin.import_tasks: pre_tasks/laptop_workarounds/main.yml

tasks:
- name: Set roles
Expand Down
5 changes: 0 additions & 5 deletions pre_tasks/aur_wrapper/Archlinux.yml

This file was deleted.

10 changes: 0 additions & 10 deletions pre_tasks/aur_wrapper/main.yml

This file was deleted.

23 changes: 23 additions & 0 deletions pre_tasks/laptop_workarounds/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# pre_tasks/laptop_workarounds/main.yml
- name: Set board vendor flag with the actual vendor value
set_fact:
board_vendor: "{{ ansible_facts['board_vendor'] }}"

- name: Set CPU brand flag with the first word of the processor
set_fact:
cpu_generation: "{{ ansible_facts['processor'][2].split(' ')[0] }}"

- name: Display board vendor flag
debug:
msg: "Board Vendor Flag: {{ board_vendor }}"

- name: Display CPU brand first word
debug:
msg: "CPU Brand First Word: {{ cpu_generation }}"

- name: Load hid_sensor_hub module
command: modprobe -i hid_sensor_hub
when:
- board_vendor == 'Framework'
- cpu_generation == '12th'
become: true
101 changes: 98 additions & 3 deletions pre_tasks/pacman/Archlinux.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,106 @@
---
- name: Upgrade system
community.general.pacman:
update_cache: yes
upgrade: yes
become: true

- name: Installing {{ pacman.aur_helper }} AUR helper
kewlfft.aur.aur:
name: "{{ pacman.aur_helper }}"

- name: Install rate-mirrors package
kewlfft.aur.aur:
name: rate-mirrors-bin

- name: Backup Arch Linux Mirrors
copy:
src: /etc/pacman.d/mirrorlist
dest: /etc/pacman.d/mirrorlist.bak
owner: root
group: root
mode: 0644
become: true

- name: Backup Chaotic AUR Mirrors
copy:
src: /etc/pacman.d/chaotic-mirrorlist
dest: /etc/pacman.d/chaotic-mirrorlist.bak
owner: root
group: root
mode: 0644
become: true
when: pacman.chaotic_aur

- name: Generate Arch Linux Mirrors List
shell: "rate-mirrors --allow-root --protocol https arch | grep -v '^#' > /tmp/mirrorlist.tmp"
become: true
register: generate_mirrorlist_arch
changed_when: generate_mirrorlist_arch.rc == 0

- name: Generate Chaotic AUR Mirrors List
shell: rate-mirrors --allow-root --protocol https chaotic-aur | grep -v '^#' >> /tmp/chaotic_mirrorlist.tmp
when: pacman.chaotic_aur
become: true
register: generate_mirrorlist_chaotic
changed_when: generate_mirrorlist_chaotic.rc == 0

- name: Update Mirrors List
copy:
src: /tmp/mirrorlist.tmp
dest: /etc/pacman.d/mirrorlist
owner: root
group: root
mode: 0644
become: true

- name: Update Chaotic AUR Mirrors List
copy:
src: /tmp/chaotic_mirrorlist.tmp
dest: /etc/pacman.d/chaotic-mirrorlist
owner: root
group: root
mode: 0644
become: true
when: pacman.chaotic_aur

- name: Remove Pacman Temporary Mirror List File
file:
path: /tmp/mirrorlist.tmp
state: absent
become: true

- name: Remove Chaotic AUR Temporary Mirror List File
file:
path: /tmp/chaotic_mirrorlist.tmp
state: absent
become: true
when: pacman.chaotic_aur

- name: Setup Chaotic AUR Keys and Mirrorlist
block:
- name: Receive Chaotic AUR Key
command: pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
become: true

- name: Sign Chaotic AUR Key
command: pacman-key --lsign-key 3056513887B78AEB
become: true

- name: Install Chaotic Keyring
command: pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
become: true

- name: Install Chaotic Mirrorlist
command: pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
become: true
when: pacman.chaotic_aur

- name: Update pacman configuration file
ansible.builtin.template:
template:
src: pacman.conf.j2
dest: /etc/pacman.conf
backup: no
owner: root
group: root
mode: 0644
become: true

13 changes: 11 additions & 2 deletions pre_tasks/pacman/templates/pacman.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ Architecture = auto

# Misc options
#UseSyslog
Color
#NoProgressBar
#CheckSpace
#VerbosePkgLists
Color
ILoveCandy
VerbosePkgLists
ParallelDownloads = {{ pacman.parallel_downloads }}

# By default, pacman accepts packages signed by keys that its local keyring
Expand Down Expand Up @@ -92,6 +93,14 @@ Include = /etc/pacman.d/mirrorlist
#Include = /etc/pacman.d/mirrorlist
{% endif %}

{% if pacman.chaotic_aur %}
[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist
{% else %}
#[chaotic-aur]
#Include = /etc/pacman.d/chaotic-mirrorlist
{% endif %}

# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
Expand Down
Loading

0 comments on commit 988486a

Please sign in to comment.