From ad1ea9462374ed7b8096cb844ae2d572a4dac033 Mon Sep 17 00:00:00 2001 From: Stephan Raabe Date: Mon, 19 Jun 2023 15:04:00 +0200 Subject: [PATCH] Updates --- .bashrc | 43 +++++++++++++++++++++++++------------------ polybar/config.ini | 10 ++++++++-- qtile/config.py | 12 +++++++----- scripts/cleanup.sh | 2 +- scripts/growthrate.py | 10 ++++++---- 5 files changed, 47 insertions(+), 30 deletions(-) diff --git a/.bashrc b/.bashrc index e3f5ba2..4e965ed 100644 --- a/.bashrc +++ b/.bashrc @@ -13,23 +13,13 @@ [[ $- != *i* ]] && return PS1='[\u@\h \W]\$ ' -# ----------------------------------------------------- -# SCREEN RESOLUTINS -# ----------------------------------------------------- -alias res1='xrandr --output DisplayPort-0 --mode 2560x1440 --rate 120' -alias res2='xrandr --output DisplayPort-0 --mode 1920x1080 --rate 120' - -export PATH="/usr/lib/ccache/bin/:$PATH" - # ----------------------------------------------------- # ALIASES # ----------------------------------------------------- -alias update-grub='sudo grub-mkconfig -o /boot/grub/grub.cfg' -alias c='clear' -alias w='~/dotfiles/scripts/updatewal.sh' -alias setkb='setxkbmap de;echo "Keyboard set back to de."' -# APPLICATIONS +alias c='clear' +alias nf='neofetch' +alias pf='pfetch' alias ls='exa -al' alias mutt='neomutt' alias m='neomutt' @@ -41,12 +31,11 @@ alias ts='~/dotfiles/scripts/snapshot.sh' alias matrix='cmatrix' alias shot='scrot -d 3 -c -z -u' alias shotsel='scrot -s' -alias nf='neofetch' -alias pf='pfetch' alias wifi='nmtui' alias od='~/private/onedrive.sh' # GIT + alias gs="git status" alias ga="git add" alias gc="git commit -m" @@ -56,25 +45,43 @@ alias gst="git stash" alias gpf="git stash; git pull" # SCRIPTS + +alias w='~/dotfiles/scripts/updatewal.sh' alias gr='python ~/dotfiles/scripts/growthrate.py' 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='vim ~/dotfiles/qtile/config.py' -alias confp='vim ~/dotfiles/picom/picom.conf' -alias confb='vim ~/dotfiles/.bashrc' + +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."' + +# ----------------------------------------------------- +# SCREEN RESOLUTINS +# ----------------------------------------------------- +alias res1='xrandr --output DisplayPort-0 --mode 2560x1440 --rate 120' +alias res2='xrandr --output DisplayPort-0 --mode 1920x1080 --rate 120' + +export PATH="/usr/lib/ccache/bin/:$PATH" + # ----------------------------------------------------- # START STARSHIP # ----------------------------------------------------- diff --git a/polybar/config.ini b/polybar/config.ini index 5244155..98e5b54 100644 --- a/polybar/config.ini +++ b/polybar/config.ini @@ -31,7 +31,7 @@ separator = "" separator-foreground = ${colors.disabled} font-0 = "Fira Sans SemiBold:size=11;2" font-1 = "Font Awesome 6 Free Solid:pixelsize=11;2" -modules-left = xworkspaces mymenu mychatgpt +modules-left = xworkspaces mychatgpt scrcpy mymenu modules-center = xwindow modules-right = battery xkeyboard mycalculator mysystem filesystem pulseaudio memory cpu date myexit cursor-click = pointer @@ -51,9 +51,15 @@ content-foreground = ${colors.primary} content = "" click-left = "~/dotfiles/scripts/applauncher.sh" +[module/scrcpy] +type = custom/text +content-foreground = ${colors.foreground} +content = "Pixel" +click-left = "scrcpy -d" + [module/mychatgpt] type = custom/text -content-foreground = ${colors.primary} +content-foreground = ${colors.foreground} content = "ChatGPT" click-left = "brave --app=https://chat.openai.com" diff --git a/qtile/config.py b/qtile/config.py index a7257c7..f095de3 100644 --- a/qtile/config.py +++ b/qtile/config.py @@ -141,14 +141,16 @@ dgroups_key_binder = simple_key_binder(mod) groups.append(ScratchPad("6", [ DropDown("chatgpt", "chromium --app=https://chat.openai.com", x=0.3, y=0.1, width=0.40, height=0.4, on_focus_lost_hide=False ), - DropDown("filemanager", "mousepad", x=0.3, y=0.1, width=0.40, height=0.4, on_focus_lost_hide=False ), - DropDown("terminal", "alacritty", x=0.3, y=0.1, width=0.40, height=0.4, on_focus_lost_hide=False ) + DropDown("mousepad", "mousepad", x=0.3, y=0.1, width=0.40, height=0.4, on_focus_lost_hide=False ), + DropDown("terminal", "alacritty", x=0.3, y=0.1, width=0.40, height=0.4, on_focus_lost_hide=False ), + DropDown("scrcpy", "scrcpy -d", x=0.8, y=0.05, width=0.15, height=0.6, on_focus_lost_hide=False ) ])) keys.extend([ - Key([], 'F10', lazy.group["6"].dropdown_toggle("chatgpt")), - Key([mod], 'F11', lazy.group["6"].dropdown_toggle("filemanager")), - Key([mod], 'F12', lazy.group["6"].dropdown_toggle("terminal")) + Key([mod], 'F10', lazy.group["6"].dropdown_toggle("chatgpt")), + Key([mod], 'F11', lazy.group["6"].dropdown_toggle("mousepad")), + Key([mod], 'F12', lazy.group["6"].dropdown_toggle("terminal")), + Key([mod], 'F9', lazy.group["6"].dropdown_toggle("scrcpy")) ]) # -------------------------------------------------------- diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh index 7925c4f..6e03939 100755 --- a/scripts/cleanup.sh +++ b/scripts/cleanup.sh @@ -1,4 +1,4 @@ yay -Scc su -c 'pacman -Qtdq | pacman -Rns -' -su /c 'pacman -Qqd | pacman -Rsu -' +su -c 'pacman -Qqd | pacman -Rsu -' diff --git a/scripts/growthrate.py b/scripts/growthrate.py index 8033e07..9eff21c 100644 --- a/scripts/growthrate.py +++ b/scripts/growthrate.py @@ -17,14 +17,16 @@ from rich.prompt import FloatPrompt # Show prompts console = Console() -num1 = FloatPrompt.ask("Original value") +num1 = FloatPrompt.ask("Old value") num2 = FloatPrompt.ask("New value") -# printing the sum in float +# Calculate the growth rate gr = ((num2-num1)/num1) percentage = "{:.2%}".format(gr) + +# Print result to the console console.print(percentage, style="bold") -# copy result into the system clipboard +# Copy result into the system clipboard pyperclip.copy(percentage) -print("Output has been copied to the clipboard!") +print("Result has been copied to the clipboard!")