Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Update .bin/emoji
Update .bin/updates
Update .bin/upload
Update .zprofile
Update .zshrc
Update .config/hypr/exec.conf
Update .config/kitty/kitty.conf
  • Loading branch information
AndreasBackx committed Oct 6, 2023
1 parent fd5a8b2 commit fbcbee5
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 24 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Dotfiles

This repository contains most if not all of the changes made to my machines that run Arch Linux, Fedora, Ubuntu, or CentOS, but primarily Arch Linux as it's what I use on my personal computers. The desktop environment setup is Hyprland.
This repository contains most if not all of the changes made to my machines that run Arch Linux, Fedora, Ubuntu, or CentOS, but primarily Arch Linux as it's what I use on my personal computers. It should support both sway and i3.

## Example `~/.config/chezmoi/chezmoi.toml`

Expand Down Expand Up @@ -85,6 +85,10 @@ sudo chmod a+rw /dev/i2c-*
# Or after quick logout
sudo chgrp i2c /dev/i2c-*

# oh-my-tmux
git clone [email protected]:gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf

# delta
## Arch Linux
paru -S git-delta
Expand Down
25 changes: 15 additions & 10 deletions dot_bin/executable_emoji
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

source ~/.bin/utils.zsh


# Where to save the emojis file.
EMOJI_FILE="$HOME/.cache/emojis.txt"

Expand All @@ -42,41 +43,44 @@ URLS=(
'https://emojipedia.org/flags/'
)


function notify() {
if [ "$(command -v notify-send)" ]; then
notify-send "$1" "$2"
fi
}


function download() {
notify $(basename "$0") 'Downloading all emoji for your pleasure'
notify `basename "$0"` 'Downloading all emoji for your pleasure'

echo "" >"$EMOJI_FILE"
echo "" > "$EMOJI_FILE"

for url in "${URLS[@]}"; do
echo "Downloading: $url"

# Download the list of emoji and remove all the junk around it
emojis=$(curl -s "$url" |
xmllint --html \
--xpath '//ul[@class="emoji-list css_test1"]' - 2>/dev/null)
emojis=$(curl -s "$url" | \
xmllint --html \
--xpath '//ul[@class="emoji-list css_test1"]' - 2>/dev/null)

# Get rid of starting/closing ul tags
emojis=$(echo "$emojis" | head -n -1 | tail -n +1)

# Extract the emoji and its description
emojis=$(echo "$emojis" |
sed -rn 's/.*<span class="emoji">(.*)<\/span> (.*)<\/a><\/li>/\1 \2/p')
emojis=$(echo "$emojis" | \
sed -rn 's/.*<span class="emoji">(.*)<\/span> (.*)<\/a><\/li>/\1 \2/p')

echo "$emojis" >>"$EMOJI_FILE"
echo "$emojis" >> "$EMOJI_FILE"
done

notify $(basename "$0") "We're all set!"
notify `basename "$0"` "We're all set!"
}


function display() {
emoji=$(cat "$EMOJI_FILE" | grep -v '#' | grep -v '^[[:space:]]*$')
line=$(echo "$emoji" | rofi -dmenu -i -p emoji $@)
line=$(echo "$emoji" | rofi -dmenu -i -p emoji -kb-custom-1 Ctrl+c $@)
exit_code=$?

line=($line)
Expand All @@ -94,6 +98,7 @@ function display() {

}


# Some simple argparsing
if [[ "$1" =~ -D|--download ]]; then
download
Expand Down
49 changes: 42 additions & 7 deletions dot_bin/executable_updates
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ function check_live() {
fi
}

function update_package_manager() {
if is_fedora; then
sudo dnf upgrade --refresh --assumeyes
else
paru -Syu --noconfirm
fi
}

function update_flatpak() {
flatpak remove --unused --assumeyes && flatpak update --assumeyes
}

function update_snap() {
sudo snap refresh
}

case "$1" in
check)
check_cache
Expand All @@ -50,13 +66,32 @@ case "$1" in
done
;;
update)
if is_fedora; then
sudo dnf upgrade --refresh --assumeyes
else
paru -Syu --noconfirm
fi
flatpak remove --unused --assumeyes && flatpak update --assumeyes
sudo snap refresh
case "$2" in
--kitty)
kitty @ goto-layout vertical
kitty @ launch --title "Flatpak update" --no-response --dont-take-focus --type window -- updates update --flatpak
kitty @ launch --title "Snap update" --no-response --dont-take-focus --type window -- updates update --snap
kitty @ launch --title "Package manager update" --no-response --dont-take-focus --type window -- updates update --package-manager
;;
--package-manager)
update_package_manager
;;
--flatpak)
update_flatpak
;;
--snap)
update_snap
;;
*)
# If desktop environment is running.
if [[ -n "$DESKTOP_SESSION" ]]; then
kitty @ launch --title "Starting update" --no-response --dont-take-focus --type os-window -- updates update --kitty
else
update_package_manager
update_flatpak
update_snap
fi
esac
;;
*)
echo "Usage: $0 {check|monitor|update}"
Expand Down
4 changes: 2 additions & 2 deletions dot_bin/executable_upload
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source ~/.bin/utils.zsh

if is_wayland; then
clipboard_type=$(wl-paste -l)
clipboard_type=`wl-paste -l`
else

fi
Expand All @@ -14,7 +14,7 @@ if [ "$clipboard_type" != "image/png" ]; then
fi

if is_wayland; then
wl-paste | imgur.sh | head -c -1/ | wl-copy
wl-paste | imgur.sh | wl-copy
else
fi

Expand Down
2 changes: 1 addition & 1 deletion dot_zprofile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export LANG=en_GB.UTF-8
export PROMPT_EOL_MARK=""

# autoupdate
zstyle ':omz:update' mode auto
export UPDATE_ZSH_DAYS=30

## Linux / MacOS ##
machine=$(uname -s)
Expand Down
5 changes: 3 additions & 2 deletions dot_zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ source ~/.bin/hg_commit.zsh
## OH MY ZSH ##
plugins=(
fzf
autoupdate
zsh-autosuggestions
zsh-syntax-highlighting
)
Expand Down Expand Up @@ -51,6 +52,6 @@ SPACESHIP_RPROMPT_ORDER+=(
source $HOME/.oh-my-zsh/oh-my-zsh.sh
compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION

if type "eza" >/dev/null; then
alias ls="eza"
if type "exa" >/dev/null; then
alias ls="exa"
fi
2 changes: 1 addition & 1 deletion private_dot_config/hypr/exec.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRE
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

# Tray
exec = pgrep -x "gammastep-indicator" >/dev/null || gammastep-indicator
exec = pgrep -x "redshift-gtk" >/dev/null || redshift-gtk
exec-once = nm-applet --indicator
exec-once = blueman-applet

Expand Down
1 change: 1 addition & 0 deletions private_dot_config/kitty/kitty.conf
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ strip_trailing_spaces smart
allow_remote_control yes
enable_audio_bell no
confirm_os_window_close 0
enabled_layouts all

0 comments on commit fbcbee5

Please sign in to comment.