diff --git a/.bashrc b/.bashrc index 0da0a04..299a047 100644 --- a/.bashrc +++ b/.bashrc @@ -21,27 +21,24 @@ alias c='clear' alias nf='neofetch' alias pf='pfetch' alias ls='exa -al' -alias mutt='neomutt' -alias m='neomutt' alias shutdown='systemctl poweroff' alias v='nvim' -alias r='ranger' -alias t='sudo timeshift --list' alias ts='~/dotfiles/scripts/snapshot.sh' alias matrix='cmatrix' -alias shot='scrot -d 3 -c -z -u' -alias shotsel='scrot -s' alias wifi='nmtui' alias od='~/private/onedrive.sh' alias rw='~/dotfiles/waybar/reload.sh' alias winclass="xprop | grep 'CLASS'" +# ----------------------------------------------------- # Window Managers +# ----------------------------------------------------- alias Qtile='startx' -# alias Hyprland="~/dotfiles/hypr/starthypr.sh" +# ----------------------------------------------------- # GIT +# ----------------------------------------------------- alias gs="git status" alias ga="git add" @@ -50,8 +47,11 @@ alias gp="git push" alias gpl="git pull" alias gst="git stash" alias gsp="git stash; git pull" +alias gcheck="git checkout" +# ----------------------------------------------------- # SCRIPTS +# ----------------------------------------------------- alias w='~/dotfiles/scripts/updatewal.sh' alias gr='python ~/dotfiles/scripts/growthrate.py' @@ -59,24 +59,32 @@ alias ChatGPT='python ~/mychatgpt/mychatgpt.py' alias chat='python ~/mychatgpt/mychatgpt.py' alias ascii='~/dotfiles/scripts/figlet.sh' +# ----------------------------------------------------- # VIRTUAL MACHINE +# ----------------------------------------------------- alias vm='~/private/launchvm.sh' alias lg='~/dotfiles/scripts/looking-glass.sh' alias vmstart='virsh --connect qemu:///system start win11' alias vmstop='virsh --connect qemu:///system destroy win11' +# ----------------------------------------------------- # EDIT CONFIG FILES +# ----------------------------------------------------- alias confq='nvim ~/dotfiles/qtile/config.py' alias confp='nvim ~/dotfiles/picom/picom.conf' alias confb='nvim ~/dotfiles/.bashrc' +# ----------------------------------------------------- # EDIT NOTES +# ----------------------------------------------------- alias notes='vim ~/notes.txt' +# ----------------------------------------------------- # SYSTEM +# ----------------------------------------------------- alias update-grub='sudo grub-mkconfig -o /boot/grub/grub.cfg' alias setkb='setxkbmap de;echo "Keyboard set back to de."' @@ -84,11 +92,14 @@ alias setkb='setxkbmap de;echo "Keyboard set back to de."' # ----------------------------------------------------- # SCREEN RESOLUTINS # ----------------------------------------------------- + +# Qtile alias res1='xrandr --output DisplayPort-0 --mode 2560x1440 --rate 120' alias res2='xrandr --output DisplayPort-0 --mode 1920x1080 --rate 120' -alias r1='hyprctl keyword monitor ,preferred,auto,1' -alias r2='hyprctl keyword monitor ,1920x1080,auto,1' +#Hyprland +alias r1='hyprctl keyword monitor ,2560x1440@120,auto,1' +alias r2='hyprctl keyword monitor ,1920x1080@120,auto,1' export PATH="/usr/lib/ccache/bin/:$PATH" diff --git a/1-install.sh b/1-install.sh index 2877843..e22dbb9 100755 --- a/1-install.sh +++ b/1-install.sh @@ -74,16 +74,13 @@ echo "" echo "-> Install main packages" packagesPacman=( - "picom" + "pacman-contrib" "alacritty" "rofi" - "rofi-calc" "chromium" - "scrot" "nitrogen" "dunst" "starship" - "slock" "neovim" "mpv" "freerdp" @@ -152,7 +149,7 @@ while true; do read -p "Do you want to install the custom login promt? (Yy/Nn): " yn case $yn in [Yy]* ) - sudo cp ~/dotfiles/issue /etc/issue + sudo cp ~/dotfiles/login/issue /etc/issue echo "Login promt installed." break;; [Nn]* ) diff --git a/2-install-qtile.sh b/2-install-qtile.sh index 86dd004..8cf8070 100755 --- a/2-install-qtile.sh +++ b/2-install-qtile.sh @@ -48,6 +48,9 @@ echo "-> Install main packages" packagesPacman=( "qtile" "polybar" + "picom" + "scrot" + "slock" ); # ------------------------------------------------------ diff --git a/issue b/login/issue similarity index 100% rename from issue rename to login/issue diff --git a/scripts/installupdates.sh b/scripts/installupdates.sh new file mode 100755 index 0000000..5709283 --- /dev/null +++ b/scripts/installupdates.sh @@ -0,0 +1,86 @@ +#!/bin/bash +# ___ _ _ _ _ _ _ _ +# |_ _|_ __ ___| |_ __ _| | | | | | |_ __ __| | __ _| |_ ___ ___ +# | || '_ \/ __| __/ _` | | | | | | | '_ \ / _` |/ _` | __/ _ \/ __| +# | || | | \__ \ || (_| | | | | |_| | |_) | (_| | (_| | || __/\__ \ +# |___|_| |_|___/\__\__,_|_|_| \___/| .__/ \__,_|\__,_|\__\___||___/ +# |_| +# by Stephan Raabe (2023) +# ----------------------------------------------------- +# Required: yay trizen timeshift btrfs-grub +# ----------------------------------------------------- + +sleep 1 +source ~/dotfiles/scripts/library.sh +clear + +echo "-----------------------------------------------------" +echo "Check for updates" +echo "-----------------------------------------------------" +echo "" + +if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then + updates_arch=0 +fi + +if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then + updates_aur=0 +fi + +updates=$(("$updates_arch" + "$updates_aur")) + +if [ "$updates" -gt 0 ]; then + + echo "-> Pacman:" + checkupdates + echo "" + echo "-> AUR" + trizen -Su --aur + echo "" + echo "-> $updates updates available." + echo "" +else + echo "-> NO updates available" + exit +fi + +# ------------------------------------------------------ +# Confirm Start +# ------------------------------------------------------ + +while true; do + read -p "DO YOU WANT TO START THE UPDATE NOW? (Yy/Nn): " yn + case $yn in + [Yy]* ) + echo "Update process started." + break;; + [Nn]* ) + exit; + break;; + * ) echo "Please answer yes or no.";; + esac +done + +if [[ $(_isInstalledYay "Timeshift") == 1 ]]; +then + + echo "" + echo "-----------------------------------------------------" + echo "Create a snapshot" + echo "-----------------------------------------------------" + echo "" + read -p "Enter a comment for the snapshot: " c + sudo timeshift --create --comments "$c" + sudo timeshift --list + sudo grub-mkconfig -o /boot/grub/grub.cfg + echo "DONE. Snapshot $c created!" + echo "" + +fi + +echo "-----------------------------------------------------" +echo "Start update" +echo "-----------------------------------------------------" +echo "" + +yay diff --git a/scripts/updates.sh b/scripts/updates.sh index 1cc8e8a..b21c5d0 100755 --- a/scripts/updates.sh +++ b/scripts/updates.sh @@ -8,6 +8,19 @@ # # by Stephan Raabe (2023) # ----------------------------------------------------- +# Requires pacman-contrib trizen + +# ----------------------------------------------------- +# Define threshholds for color indicators +# ----------------------------------------------------- + +threshhold_green=0 +threshhold_yellow=25 +threshhold_red=100 + +# ----------------------------------------------------- +# Calculate available updates pacman and aur (with trizen) +# ----------------------------------------------------- if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then updates_arch=0 @@ -19,8 +32,24 @@ fi updates=$(("$updates_arch" + "$updates_aur")) -if [ "$updates" -gt 0 ]; then - echo " $updates" -else - echo " 0" +# ----------------------------------------------------- +# Output in JSON format for Waybar Module custom-updates +# ----------------------------------------------------- + +css_class="green" + +# test classes +# printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "red"}' +# exit + +if [ "$updates" -gt $threshhold_yellow ]; then + css_class="yellow" +fi +if [ "$updates" -gt $threshhold_red ]; then + css_class="red" +fi +if [ "$updates" -gt $threshhold_green ]; then + printf '{"text": "%s", "alt": "%s", "tooltip": "%s Updates", "class": "%s"}' "$updates" "$updates" "$updates" "$css_class" +else + printf '{"text": "0", "alt": "0", "tooltip": "0 Updates", "class": "green"}' fi diff --git a/scripts/updatewal-swww.sh b/scripts/updatewal-swww.sh index d0821ef..a4a5c00 100755 --- a/scripts/updatewal-swww.sh +++ b/scripts/updatewal-swww.sh @@ -20,9 +20,8 @@ wal -q -i ~/wallpaper/ source "$HOME/.cache/wal/colors.sh" # ----------------------------------------------------- -# Copy color file to waybar folder +# Copy selected wallpaper into .cache folder # ----------------------------------------------------- -cp ~/.cache/wal/colors-waybar.css ~/dotfiles/waybar/ cp $wallpaper ~/.cache/current_wallpaper.jpg # ----------------------------------------------------- diff --git a/scripts/wallpaper-swww.sh b/scripts/wallpaper-swww.sh index 2afbd78..3cf3d0e 100755 --- a/scripts/wallpaper-swww.sh +++ b/scripts/wallpaper-swww.sh @@ -28,9 +28,8 @@ if [ "$selected" ]; then source "$HOME/.cache/wal/colors.sh" # ----------------------------------------------------- - # Copy color file to waybar folder + # Copy selected wallpaper into .cache folder # ----------------------------------------------------- - cp ~/.cache/wal/colors-waybar.css ~/dotfiles/waybar/ cp $wallpaper ~/.cache/current_wallpaper.jpg newwall=$(echo $wallpaper | sed "s|$HOME/wallpaper/||g") diff --git a/waybar/colors-waybar.css b/waybar/colors-waybar.css deleted file mode 100644 index b69e75d..0000000 --- a/waybar/colors-waybar.css +++ /dev/null @@ -1,20 +0,0 @@ -@define-color foreground #bfbfc0; -@define-color background #020103; -@define-color cursor #bfbfc0; - -@define-color color0 #020103; -@define-color color1 #FBBA52; -@define-color color2 #4B3E81; -@define-color color3 #705E91; -@define-color color4 #9575A6; -@define-color color5 #CB7B96; -@define-color color6 #AB8EAC; -@define-color color7 #bfbfc0; -@define-color color8 #414042; -@define-color color9 #FBBA52; -@define-color color10 #4B3E81; -@define-color color11 #705E91; -@define-color color12 #9575A6; -@define-color color13 #CB7B96; -@define-color color14 #AB8EAC; -@define-color color15 #bfbfc0; diff --git a/waybar/launch.sh b/waybar/launch.sh index dedd9e2..7eb606b 100755 --- a/waybar/launch.sh +++ b/waybar/launch.sh @@ -18,7 +18,7 @@ killall waybar # ----------------------------------------------------- if [[ $USER = "raabe" ]] then - waybar -c ~/dotfiles/waybar/myconfig & + waybar -c ~/dotfiles/waybar/myconfig & -s ~/dotfiles/waybar/style.css else waybar & fi diff --git a/waybar/modules.json b/waybar/modules.json index 8d69c11..a4989f8 100644 --- a/waybar/modules.json +++ b/waybar/modules.json @@ -67,10 +67,13 @@ // Updates Count "custom/updates": { - "format": " {}", + "format": " {}", + "tooltip-format": "{}", + "escape": true, + "return-type": "json", "exec": "~/dotfiles/scripts/updates.sh", - "restart-interval": 600, - "on-click": "alacritty -e yay", + "restart-interval": 60, + "on-click": "alacritty -e ~/dotfiles/scripts/installupdates.sh", "tooltip": false }, diff --git a/waybar/style.css b/waybar/style.css index 52f064e..b3192ae 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -13,7 +13,7 @@ /* ----------------------------------------------------- * Import Pywal colors * ----------------------------------------------------- */ -@import 'colors-waybar.css'; +@import '../../.cache/wal/colors-waybar.css'; /* ----------------------------------------------------- * General @@ -117,7 +117,7 @@ window#waybar.empty #window { * ----------------------------------------------------- */ #taskbar { - background: transparent; + background: @color11; margin: 3px 15px 3px 0px; padding: 2px 3px 1px 3px; border-radius: 14px; @@ -191,6 +191,20 @@ window#waybar.empty #window { opacity:0.8; } +#custom-updates.green { + background-color: #FFFFFF; +} + +#custom-updates.yellow { + background-color: #ff9a3c; + color: #ffffff; +} + +#custom-updates.red { + background-color: #dc2f2f; + color: #ffffff; +} + /* ----------------------------------------------------- * Custom Youtube * ----------------------------------------------------- */ diff --git a/wlogout/layout b/wlogout/layout index 75c8f18..488aa5b 100644 --- a/wlogout/layout +++ b/wlogout/layout @@ -1,35 +1,36 @@ { "label" : "lock", "action" : "swaylock", - "text" : "Lock" + "text" : "Lock", + "keybind" : "l" } - { "label" : "hibernate", "action" : "systemctl hibernate", - "text" : "Hibernate" + "text" : "Hibernate", + "keybind" : "h" } - { "label" : "logout", - "action" : "hyprctl dispatch exit 0", - "text" : "Logout" + "action" : "loginctl terminate-user $USER", + "text" : "Logout", + "keybind" : "e" } - { "label" : "shutdown", "action" : "systemctl poweroff", - "text" : "Shutdown" + "text" : "Shutdown", + "keybind" : "s" } - { "label" : "suspend", "action" : "systemctl suspend", - "text" : "Suspend" + "text" : "Suspend", + "keybind" : "u" } - { "label" : "reboot", "action" : "systemctl reboot", - "text" : "Reboot" -} \ No newline at end of file + "text" : "Reboot", + "keybind" : "r" +} diff --git a/wlogout/noise.png b/wlogout/noise.png new file mode 100644 index 0000000..028b188 Binary files /dev/null and b/wlogout/noise.png differ diff --git a/wlogout/style.css b/wlogout/style.css index 8b90d80..b20f2c8 100644 --- a/wlogout/style.css +++ b/wlogout/style.css @@ -1,44 +1,78 @@ +/* + _ _ +__ _| | ___ __ _ ___ _ _| |_ +\ \ /\ / / |/ _ \ / _` |/ _ \| | | | __| + \ V V /| | (_) | (_| | (_) | |_| | |_ + \_/\_/ |_|\___/ \__, |\___/ \__,_|\__| + |___/ + +by Stephan Raabe (2023) +----------------------------------------------------- +*/ + * { background-image: none; + transition: 0ms; } + window { - background-color: rgba(12, 12, 12, 0.5); + background-color: rgba(12, 12, 12, 0.1); + background-image: url('./noise.png'); } + button { - color: #FFFFFF; - background-color: #1E1E1E; + color: #FFFFFF; border-style: solid; - border-width: 0px; + border-width: 2px; background-repeat: no-repeat; background-position: center; background-size: 25%; + + background-color: rgba(108, 112, 134, 0.4); + border: 1px solid rgba(108, 112, 134, 0.3); + border-top: 1px solid rgba(108, 112, 134, 0.3); } -button:focus, button:active, button:hover { - background-color: #3700B3; - outline-style: none; +button:focus, +button:active, +button:hover { + background-color: rgba(156, 161, 192, 0.5); + border: 1px solid rgba(108, 112, 134, 0.15); + border-top: 1px solid rgba(108, 112, 134, 0.15); } #lock { - background-image: image(url("/usr/share/wlogout/icons/lock.png"), url("/usr/local/share/wlogout/icons/lock.png")); + margin: 10px; + border-radius: 20px; + background-image: image(url("/usr/share/wlogout/icons/lock.png"), url("/usr/local/share/wlogout/icons/lock.png")); } #logout { - background-image: image(url("/usr/share/wlogout/icons/logout.png"), url("/usr/local/share/wlogout/icons/logout.png")); + margin: 10px; + border-radius: 20px; + background-image: image(url("/usr/share/wlogout/icons/logout.png"), url("/usr/local/share/wlogout/icons/logout.png")); } #suspend { - background-image: image(url("/usr/share/wlogout/icons/suspend.png"), url("/usr/local/share/wlogout/icons/suspend.png")); + margin: 10px; + border-radius: 20px; + background-image: image(url("/usr/share/wlogout/icons/suspend.png"), url("/usr/local/share/wlogout/icons/suspend.png")); } #hibernate { - background-image: image(url("/usr/share/wlogout/icons/hibernate.png"), url("/usr/local/share/wlogout/icons/hibernate.png")); + margin: 10px; + border-radius: 20px; + background-image: image(url("/usr/share/wlogout/icons/hibernate.png"), url("/usr/local/share/wlogout/icons/hibernate.png")); } #shutdown { - background-image: image(url("/usr/share/wlogout/icons/shutdown.png"), url("/usr/local/share/wlogout/icons/shutdown.png")); + margin: 10px; + border-radius: 20px; + background-image: image(url("/usr/share/wlogout/icons/shutdown.png"), url("/usr/local/share/wlogout/icons/shutdown.png")); } #reboot { - background-image: image(url("/usr/share/wlogout/icons/reboot.png"), url("/usr/local/share/wlogout/icons/reboot.png")); + margin: 10px; + border-radius: 20px; + background-image: image(url("/usr/share/wlogout/icons/reboot.png"), url("/usr/local/share/wlogout/icons/reboot.png")); }