Skip to content

Commit

Permalink
Add tstamp and color_codes, gnome tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxattax97 committed Aug 20, 2024
1 parent 91336b6 commit 12aeee8
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 7 deletions.
35 changes: 34 additions & 1 deletion .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,39 @@ zshrc_load_library() {
echo "Buffer-cut: \"$(xclip -out -selection buffer-cut)\""
fi
}
tstamp() {
if date --version 2>&1 | grep -q 'GNU coreutils'; then
cmd='date -u --iso-8601=ns'
else
# *BSD
cmd='date -u +"%Y-%m-%dT%H:%M:%S%:z"'
fi
while IFS= read -r line; do
printf "[\033[0;34m%s\033[0m] %s\n" "$($cmd)" "$line";
done
}
color_codes() {
# Define the text attributes and colors
attributes=(
"0" "1" "4" "5" "7"
)
colors=(
"30" "31" "32" "33" "34" "35" "36" "37"
)
# Loop through each attribute and color, displaying them horizontally
for attribute in "${attributes[@]}"; do
for color in "${colors[@]}"; do
echo -en "\033[${attribute};${color}m ${attribute};${color} \033[0m\t"
done
echo ""
done
# Reset to default
echo -e "\033[0mDefault Text"
}
}
zshrc_set_aliases() {
Expand Down Expand Up @@ -1556,7 +1589,7 @@ zshrc_set_aliases() {
alias dtail='docker logs -tf --tail="50" "$@"'
# Clipboard
alias clip='xclip -selection clipboard'
alias clip='xsel --clipboard --trim -i'
# btop > htop > top
if type htop > /dev/null 2>&1; then
Expand Down
43 changes: 37 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ case "$response" in
nextcloud-client \
p7zip \
qalculate-gtk \
touchegg \
veracrypt \
zathura \
zathura-pdf-mupdf \
Expand Down Expand Up @@ -789,6 +790,7 @@ case "$response" in
nextcloud-desktop \
p7zip-full \
qalculate-gtk \
touchegg \
unrar \
zathura \
-y
Expand All @@ -807,6 +809,7 @@ case "$response" in
noto-fonts-emoji \
p7zip \
qalculate-gtk \
touchegg \
unrar \
veracrypt \
zathura \
Expand All @@ -829,6 +832,7 @@ case "$response" in
nextcloudclient \
noto-emoji \
qalculate-gtk \
touchegg \
unrar \
veracrypt \
yt-dlp \
Expand Down Expand Up @@ -872,6 +876,39 @@ case "$response" in
;;
esac

read -r -p "Would you like to setup Gnome? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
# Set fonts for Gnome.
if [[ "$XDG_CURRENT_DESKTOP" == "GNOME" ]]; then
gsettings set org.gnome.desktop.interface font-name 'FreeSans 11'
gsettings set org.gnome.desktop.interface document-font-name 'FreeSans 11'
gsettings set org.gnome.desktop.interface monospace-font-name 'Hack Nerd Font Mono 11'

if [ -s /usr/share/applications/brave.desktop ]; then
xdg-settings set default-web-browser brave.desktop
elif [ -s /usr/share/applications/brave-browser.desktop ]; then
xdg-settings set default-web-browser brave-browser.desktop
fi

# TODO: Install extensions
#[email protected]
#blur-my-shell@aunetx
#[email protected]
#[email protected]
#[email protected]
#[email protected]
#[email protected]
#[email protected]
#[email protected]
#[email protected]
#[email protected]
fi
;;
*)
echo "Skipping font installation"
;;
esac

read -r -p "Would you like to attempt an install of Suckless Terminal (st)? [y/N] " response
case "$response" in
Expand Down Expand Up @@ -1210,12 +1247,6 @@ case "$response" in
gsettings set org.gnome.desktop.interface document-font-name 'FreeSans 11'
gsettings set org.gnome.desktop.interface monospace-font-name 'Hack Nerd Font Mono 11'
fi

if [ -s /usr/share/applications/brave.desktop ]; then
xdg-settings set default-web-browser brave.desktop
elif [ -s /usr/share/applications/brave-browser.desktop ]; then
xdg-settings set default-web-browser brave-browser.desktop
fi
;;
*)
echo "Skipping font installation"
Expand Down

0 comments on commit 12aeee8

Please sign in to comment.