From 709efa3eac1851d120956e515b035f3480fe2c77 Mon Sep 17 00:00:00 2001 From: gianmarco Date: Sat, 21 May 2022 00:34:36 +0200 Subject: [PATCH] Changed the drop down terminal from Yakuake to a custom Alacritty script --- .config/bspwm/bspwmrc | 3 + .config/gtk-3.0/settings.ini | 2 +- .config/picom/picom.conf | 6 +- .config/polybar/gmg/scripts/polywins.sh | 2 +- .config/sxhkd/sxhkdrc | 4 +- .zshrc | 2 +- Scripts/autostart.sh | 4 +- Scripts/bspdropterm.sh | 80 +++++++++++++++++++++++++ 8 files changed, 94 insertions(+), 9 deletions(-) create mode 100755 Scripts/bspdropterm.sh diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 15bba5d..af28a2d 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -40,8 +40,11 @@ bspc rule -a kmag state=floating bspc rule -a GLava state=floating bspc rule -a Arandr state=floating bspc rule -a kid3 state=floating +bspc rule -a Woeusbgui state=floating +bspc rule -a kcalc state=floating bspc rule -a desktop="Desktop" locked=on +~/Scripts/bspdropterm.sh --init ~/Scripts/autostart.sh ~/.config/polybar/launch.sh --gmg picom diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini index c7155d6..70a0b59 100644 --- a/.config/gtk-3.0/settings.ini +++ b/.config/gtk-3.0/settings.ini @@ -1,5 +1,5 @@ [Settings] -gtk-application-prefer-dark-theme=true +gtk-theme-name=Materia-dark gtk-button-images=1 gtk-cursor-theme-name=capitaine-cursors-light gtk-cursor-theme-size=0 diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf index 87c0c18..f499341 100644 --- a/.config/picom/picom.conf +++ b/.config/picom/picom.conf @@ -191,7 +191,8 @@ active-opacity = 1.0; focus-exclude = [ "class_g = 'Cairo-clock'", "class_g = 'Bar'", # lemonbar - "class_g = 'slop'" # maim + "class_g = 'slop'", # maim + "class_g = 'activate-linux'" ]; # Use fixed inactive dim value, instead of adjusting according to window opacity. @@ -282,7 +283,8 @@ blur-background-exclude = [ "class_g = 'slop'", "_GTK_FRAME_EXTENTS@:c", "class_g = 'flameshot'", - "class_g = 'Plank'" + "class_g = 'Plank'", + "class_g = 'activate-linux'" ]; diff --git a/.config/polybar/gmg/scripts/polywins.sh b/.config/polybar/gmg/scripts/polywins.sh index 4864d9c..89c6e7e 100755 --- a/.config/polybar/gmg/scripts/polywins.sh +++ b/.config/polybar/gmg/scripts/polywins.sh @@ -13,7 +13,7 @@ inactive_underline= separator=" " show="window_class" # options: window_title, window_class, window_classname -forbidden_classes="Polybar Conky Gmrun" +forbidden_classes="Polybar Conky Gmrun drop-down-term" empty_desktop_message="" char_limit=30 diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index ed336fe..031a60b 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -50,9 +50,9 @@ super + k super + j clementine -# Yakuake +# drop down Alacritty super + y - yakuake + ~/Scripts/bspdropterm.sh --toggle # KSysGuard ctrl + {shift + Escape,alt + Delete} diff --git a/.zshrc b/.zshrc index 51aab6b..e5bcec6 100644 --- a/.zshrc +++ b/.zshrc @@ -1,7 +1,7 @@ # This is Gianmarco's .zshrc. export HISTFILE=~/.zsh_history -export SAVEHIST=1000 +ZSH_THEME="m3-round" export HISTSIZE=1000 source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme diff --git a/Scripts/autostart.sh b/Scripts/autostart.sh index eb6351d..f8bdacb 100755 --- a/Scripts/autostart.sh +++ b/Scripts/autostart.sh @@ -16,7 +16,7 @@ akregator --hide-mainwindow & kmail & krfb --nodialog & ktorrent & -yakuake & +#yakuake & keepassxc & syncthingtray --wait & #stalonetray & @@ -32,4 +32,4 @@ kdeconnect-indicator & #done ~/Scripts/usbsounds.sh & -~/Scripts/xbk.sh & \ No newline at end of file +~/Scripts/xbk.sh & diff --git a/Scripts/bspdropterm.sh b/Scripts/bspdropterm.sh new file mode 100755 index 0000000..e71f283 --- /dev/null +++ b/Scripts/bspdropterm.sh @@ -0,0 +1,80 @@ +#!/bin/sh + +# MIT License +# Copyright (c) 2021 Ayan Nath + +# bspdropterm - Drop down terminal functionality for bspwm + +### Configuration +term="alacritty" +termPosition="1750x700+0+20" +termClassname="drop-down-term" +### + +termStatus="/tmp/dropdownterm_status" +termIdFile="/tmp/dropdownterm_id" +termId="$(/usr/bin/cat "$termIdFile")" + +spawn_term() { + "$term" --class "$termClassname","$termClassname" > /dev/null 2>&1 +} + +init_drop_down_term() { + bspc rule -a "$termClassname" state=floating rectangle="$termPosition" hidden=on sticky=on locked=on + spawn_term & + sleep 0.5 + printf 0x00%X "$(xdotool search --classname "$termClassname")" > "$termIdFile" & + echo "0" > "$termStatus" & +} + +term_toggle() { + currentStatus="$(/usr/bin/cat $termStatus)" + if [ "$currentStatus" = "1" ]; then + bspc node "$termId" -g hidden=on + echo "0" > "$termStatus" + else + bspc node "$termId" -g hidden=off + echo "1" > "$termStatus" + # focus on the window + bspc node "$termId" -f + fi +} + +help_text() { + /usr/bin/cat << 'EOF' +bspdropterm - Drop down terminal functionality for bspwm + +USAGE: + bspdropterm [OPTION] + +OPTIONS: + --init + Initialise drop down terminal. + + --toggle + Toggle visibility of drop down terminal. + +CONFIG: + Open the script and modify the variables term, termPostition and termClassname as per your needs. + You may need to edit the contents of the function spawn_term if you don't use Alacritty. + + term Name of the terminal you use ($TERMINAL by default) + termPosition Position (as per bspwmrc convention) of the drop down terminal + termClassname Classname of the drop down terminal + +Copyright (c) 2021 Ayan Nath +EOF + exit 0 +} + +case "$1" in + "--init") + init_drop_down_term + ;; + "--toggle") + term_toggle + ;; + *) + help_text + ;; +esac