From 7343a15f123c78d7c29ff7a189798de689869026 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Fri, 7 Mar 2025 00:41:38 -0300 Subject: Initial commit. --- desktop-x11/.config/bspwm/bspwmrc | 134 +++++ desktop-x11/.config/polybar/base.ini | 73 +++ desktop-x11/.config/polybar/colors.ini | 35 ++ desktop-x11/.config/polybar/config.ini | 49 ++ desktop-x11/.config/polybar/launch.sh | 45 ++ desktop-x11/.config/polybar/modules.ini | 354 +++++++++++++ desktop-x11/.config/sxhkd/sxhkdrc | 353 +++++++++++++ desktop-x11/.local/bin/rofi-pass | 868 ++++++++++++++++++++++++++++++++ 8 files changed, 1911 insertions(+) create mode 100755 desktop-x11/.config/bspwm/bspwmrc create mode 100644 desktop-x11/.config/polybar/base.ini create mode 100644 desktop-x11/.config/polybar/colors.ini create mode 100644 desktop-x11/.config/polybar/config.ini create mode 100755 desktop-x11/.config/polybar/launch.sh create mode 100644 desktop-x11/.config/polybar/modules.ini create mode 100644 desktop-x11/.config/sxhkd/sxhkdrc create mode 100755 desktop-x11/.local/bin/rofi-pass (limited to 'desktop-x11') diff --git a/desktop-x11/.config/bspwm/bspwmrc b/desktop-x11/.config/bspwm/bspwmrc new file mode 100755 index 0000000..1c662f4 --- /dev/null +++ b/desktop-x11/.config/bspwm/bspwmrc @@ -0,0 +1,134 @@ +#! /bin/sh + +# set -xv +# exec 2>>/tmp/bspwm.log + +pgrep -x sxhkd > /dev/null || sxhkd & + +# setxkbmap -rules evdev -model pc105 -layout ck61 -variant ck61 -option caps:escape +# setxkbmap -option caps:escape +# xmodmap $HOME/.Xmodmap + +# My monitors: +# DP-2-2 +# HDMI-2 +# eDP-1 +CONNECTED_MONITORS=`xrandr -q | grep -w connected | cut -d ' ' -f1` +MONITORS_COUNT=`echo "$CONNECTED_MONITORS" | wc -l` + +# Network Interfaces for Polybar modules +NETWORK_INTERFACES=`nmcli -t device | grep -v bridge` +ETHERNET_INTERFACES=`echo "$NETWORK_INTERFACES" | grep ":ethernet:"` +ETHERNET_COUNT=`echo "$ETHERNET_INTERFACES" | wc -l` +ETHER_IFACE= +if [[ "$ETHERNET_COUNT" == "1" ]]; then + ETHER_IFACE=`echo "$ETHERNET_INTERFACES" | cut -d ':' -f1` +else + ETHER_IFACE=`echo "$ETHERNET_INTERFACES" | grep ":connected" | cut -d ':' -f1` +fi +WIFI_INTERFACES=`echo "$NETWORK_INTERFACES" | grep ":wifi:"` +WIFI_COUNT=`echo "$WIFI_INTERFACES" | wc -l` +WIFI_IFACE= +if [[ "$WIFI_COUNT" == "1" ]]; then + WIFI_IFACE=`echo "$WIFI_INTERFACES" | cut -d ':' -f1` +else + WIFI_IFACE=`echo "$WIFI_INTERFACES" | grep ":connected" | cut -d ':' -f1` +fi + +killall polybar +xrandr --output eDP-1 --mode 1920x1080 + +if [ "$MONITORS_COUNT" = "1" ]; then + bspc monitor eDP-1 -d I II III IV V VI VII VIII IX X + # PRIMARY_MONITOR="eDP-1" WIFI_IFACE="wlp4s0" polybar primary-monitor & + PRIMARY_MONITOR="eDP-1" ETHER_IFACE="$ETHER_IFACE" WIFI_IFACE="$WIFI_IFACE" polybar primary-monitor & +else + EXTERNAL_MONITOR=`echo "$CONNECTED_MONITORS" | grep -v "eDP-1" | head -n1` + if [ "$EXTERNAL_MONITOR" = "DP-2-1" ] || [ "$EXTERNAL_MONITOR" = "DP-2-2" ]; then + EXTERNAL_MONITOR_RESOLUTION="2560x1080" + # xrandr --output $EXTERNAL_MONITOR --primary --mode 2560x1080 --left-of eDP-1 + # bspc monitor eDP-1 -d IX X + # bspc monitor $EXTERNAL_MONITOR -d I II III IV V VI VII VIII + else + EXTERNAL_MONITOR_RESOLUTION="1920x1080" + # xrandr --output $EXTERNAL_MONITOR --primary --mode 1920x1080 --left-of eDP-1 + # bspc monitor eDP-1 -d I II + # bspc monitor $EXTERNAL_MONITOR -d III IV V VI VII VIII IX X + fi + xrandr --output $EXTERNAL_MONITOR --primary --mode $EXTERNAL_MONITOR_RESOLUTION --left-of eDP-1 + bspc monitor eDP-1 -d IX X + bspc monitor $EXTERNAL_MONITOR -d I II III IV V VI VII VIII + SECONDARY_MONITOR="eDP-1" polybar secondary-monitor & + PRIMARY_MONITOR="$EXTERNAL_MONITOR" ETHER_IFACE="$ETHER_IFACE" WIFI_IFACE="$WIFI_IFACE" polybar primary-monitor & +fi + +bspc config border_width 1 +bspc config window_gap 3 + +bspc config split_ratio 0.52 # 0.6 +bspc config borderless_monocle false # true +bspc config gapless_monocle true + +bspc config focus_follows_pointer true +bspc config pointer_follows_focus true +bspc config pointer_follows_monitor true + +# Border colors +# Original +# bspc config normal_border_color "#484848" +# bspc config focused_border_color "#21BA45" +# bspc config active_border_color "#BA9521" +# bspc config presel_feedback_color "#E2FF20" + +# Vault Tec +bspc config normal_border_color "#345985" +bspc config focused_border_color "#FDF070" +bspc config active_border_color "#5C835E" +bspc config presel_feedback_color "#A63C45" + +# xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/Xresources +pgrep -x picom > /dev/null || picom & +pgrep -x unclutter > /dev/null || unclutter & +pgrep -x dunst > /dev/null || dunst & +pgrep -x nm-applet > /dev/null || nm-applet & +# /usr/bin/gnome-keyring-daemon --start --components=ssh +xset r rate 300 50 + +feh --bg-fill $HOME/Dropbox/Images/wallpapers/dore-christ-leaving-the-praetorium.jpeg +# wal -i $HOME/Dropbox/Images/wallpapers/dore-christ-leaving-the-praetorium.jpeg >/dev/null 2>&1 + +# bspc rule -a Gimp desktop='^8' state=floating follow=on +# bspc rule -a Chromium desktop='^2' +# bspc rule -a mplayer2 state=floating +# bspc rule -a Kupfer.py focus=on +# bspc rule -a Screenkey manage=off + +bspc rule -a Floating state=floating center=true follow=on + +bspc rule -a Arandr state=floating +bspc rule -a Blueman-manager state=floating +bspc rule -a Cheese state=floating center=true follow=on +bspc rule -a Clocks state=floating center=true follow=on +bspc rule -a Eog state=floating center=true follow=on +bspc rule -a Gitg state=floating center=true follow=on +bspc rule -a Gitk state=floating center=true follow=on +bspc rule -a Gnome-calculator state=floating center=true follow=on +bspc rule -a Gnome-calendar state=floating center=true follow=on +bspc rule -a Gnome-control-center state=floating center=true follow=on +bspc rule -a Gnome-screenshot state=floating center=true follow=on +bspc rule -a Gnome-todo state=floating center=true follow=on +bspc rule -a Gnome-tweaks state=floating center=true follow=on +bspc rule -a MuPDF state=floating center=true follow=on +bspc rule -a Pavucontrol state=floating center=true follow=on +bspc rule -a Qemu-system-i386 state=floating center=true follow=on +bspc rule -a Qemu-system-x86_64 state=floating center=true follow=on +bspc rule -a Signal state=floating +bspc rule -a SimpleScreenRecorder state=floating center=true follow=on +bspc rule -a Surf state=floating center=true follow=on +bspc rule -a Sxiv state=floating center=true follow=on +bspc rule -a mpv state=floating center=true follow=on +bspc rule -a "Org.gnome.Characters:*:*" state=floating center=true follow=on +bspc rule -a "Gpick:*:*" state=floating center=true follow=on +bspc rule -a "*:*:Picture-in-Picture" state=floating follow=on +bspc rule -a "*:*:Network Connections" state=floating follow=on +bspc rule -a gnome-calculator state=floating center=true follow=on diff --git a/desktop-x11/.config/polybar/base.ini b/desktop-x11/.config/polybar/base.ini new file mode 100644 index 0000000..807104b --- /dev/null +++ b/desktop-x11/.config/polybar/base.ini @@ -0,0 +1,73 @@ +;========================================================== +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +;========================================================== + +[settings] +; Reload upon receiving XCB_RANDR_SCREEN_CHANGE_NOTIFY events +screenchange-reload = true +pseudo-transparency = false + +; Compositing operators +; @see: https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t +compositing-background = source +compositing-foreground = over +compositing-overline = over +compositing-underline = over +compositing-border = over + +; Define fallback values used by all module formats +; format-foreground = +; format-background = +; format-underline = +; format-overline = +; format-spacing = +; format-padding = +; format-margin = +; format-offset = + +[global/wm] +margin-top = 0 +margin-bottom = 0 + +[bar/base] +enable-ipc = true + +background = ${colors.background} +foreground = ${colors.foreground} + +font-0 = RobotoMono Nerd Font:style=Medium,Regular:size=8:antialias=true;2 +font-1 = FontAwesome:style=Regular:size=8:antialias=true;1 +font-2 = Symbola:style=Regular:size=8:antialias=true;1 +font-3 = fixed:pixelsize=0;0 + +width = 100% +height = 18 +fixed-center = false +bottom = false + +line-size = 2 +line-color = #f00 + +border-size = 0 +border-color = #00000000 + +padding-left = 0 +padding-right = 0 + +module-margin-left = 0 +module-margin-right = 1 + +scroll-up = i3wm-wsprev +scroll-down = i3wm-wsnext + +cursor-click = pointer +cursor-scroll = ns-resize + +override-redirect = false diff --git a/desktop-x11/.config/polybar/colors.ini b/desktop-x11/.config/polybar/colors.ini new file mode 100644 index 0000000..d768194 --- /dev/null +++ b/desktop-x11/.config/polybar/colors.ini @@ -0,0 +1,35 @@ +;========================================================== +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +;========================================================== + +[colors] +background = ${xrdb:color0:#cc222222} +background-alt = #444444 +foreground = ${xrdb:color7:#dfdfdf} +foreground-alt = #555555 + +primary = #ffb52a +secondary = #e60053 +alert = #bd2c40 + +module-label-foreground = #000000 +module-label-background = #0a6cf5 +module-value-foreground = #000000 +module-value-background = #d0d0d0d0 + +module-value-intensity-1 = #55aa55 +module-value-intensity-2 = #557755 +module-value-intensity-3 = #f5a70a +module-value-intensity-4 = #ff5555 + +module-value-negative-foreground = #7C7772 +module-value-negative-background = #C1BAAD + +; vim:ft=dosini diff --git a/desktop-x11/.config/polybar/config.ini b/desktop-x11/.config/polybar/config.ini new file mode 100644 index 0000000..82a92fc --- /dev/null +++ b/desktop-x11/.config/polybar/config.ini @@ -0,0 +1,49 @@ +;========================================================== +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +;========================================================== + +include-file = ./colors.ini +include-file = ./base.ini +include-file = ./modules.ini + +[bar/primary-monitor] +inherit = bar/base + +monitor = ${env:PRIMARY_MONITOR} + +modules-left = ewmh +modules-center = xwindow +modules-right = cpu temperature fs-root fs-storage network-iface-1 network-iface-2 vpn calendar + +tray-position = right +tray-padding = 4 +tray-foreground = ${root.foreground} +tray-background = ${root.background} + +[bar/secondary-monitor] +inherit = bar/base + +monitor = ${env:SECONDARY_MONITOR} + +bottom = true + +modules-left = ewmh +; modules-center = mpd +modules-right = battery pulseaudio xkeyboard + +[module/network-iface-1] +inherit = module/network-eth +interface = ${env:ETHER_IFACE} + +[module/network-iface-2] +inherit = module/network-wifi +interface = ${env:WIFI_IFACE} + +; vim:ft=dosini diff --git a/desktop-x11/.config/polybar/launch.sh b/desktop-x11/.config/polybar/launch.sh new file mode 100755 index 0000000..0704e24 --- /dev/null +++ b/desktop-x11/.config/polybar/launch.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -x polybar >/dev/null; do sleep 1; done + +host=$(hostname) + +# My monitors: +# DP-2-2 +# HDMI-2 +# eDP-1 +LAPTOP_BUILT_IN_MONITOR="eDP-1" + +NETWORK_INTERFACES=`nmcli -t device | grep -v bridge` + +ETHERNET_INTERFACES=`echo "$NETWORK_INTERFACES" | grep ":ethernet:"` +ETHERNET_COUNT=`echo "$ETHERNET_INTERFACES" | wc -l` +ETHER_IFACE= +if [[ "$ETHERNET_COUNT" == "1" ]]; then + ETHER_IFACE=`echo "$ETHERNET_INTERFACES" | cut -d ':' -f1` +else + ETHER_IFACE=`echo "$ETHERNET_INTERFACES" | grep ":connected" | cut -d ':' -f1` +fi + +WIFI_INTERFACES=`echo "$NETWORK_INTERFACES" | grep ":wifi:"` +WIFI_COUNT=`echo "$WIFI_INTERFACES" | wc -l` +WIFI_IFACE= +if [[ "$WIFI_COUNT" == "1" ]]; then + WIFI_IFACE=`echo "$WIFI_INTERFACES" | cut -d ':' -f1` +else + WIFI_IFACE=`echo "$WIFI_INTERFACES" | grep ":connected" | cut -d ':' -f1` +fi + +# Launch polybar +CONNECTED_MONITORS=`xrandr -q | grep -w connected | cut -d ' ' -f1` +MONITORS_COUNT=`echo "$CONNECTED_MONITORS" | wc -l` +if [[ "$MONITORS_COUNT" == "1" ]]; then + PRIMARY_MONITOR="$CONNECTED_MONITORS" ETHER_IFACE="$ETHER_IFACE" WIFI_IFACE="$WIFI_IFACE" polybar primary-monitor & +else + PRIMARY_MONITOR=`echo "$CONNECTED_MONITORS" | grep -v "$LAPTOP_BUILT_IN_MONITOR" | head -n1` ETHER_IFACE="$ETHER_IFACE" WIFI_IFACE="$WIFI_IFACE" polybar primary-monitor & + SECONDARY_MONITOR="$LAPTOP_BUILT_IN_MONITOR" polybar secondary-monitor & +fi diff --git a/desktop-x11/.config/polybar/modules.ini b/desktop-x11/.config/polybar/modules.ini new file mode 100644 index 0000000..c3b2d0e --- /dev/null +++ b/desktop-x11/.config/polybar/modules.ini @@ -0,0 +1,354 @@ +;========================================================== +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +;========================================================== + +; Internal modules ------------------------------------------------------------ + +[module/date] +type = internal/date +interval = 5 +time = %H:%M +format-prefix-foreground = ${colors.foreground-alt} +format-underline = #0a6cf5 + +label = %time% + +[module/xwindow] +type = internal/xwindow +label = %title:0:30:...% + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +format-prefix = " ⌨ " +format-prefix-foreground = ${colors.module-label-foreground} +format-prefix-background = #219ebc +format-foreground = ${colors.module-value-foreground} +format-background = ${colors.module-value-background} + +label-layout = " %layout% " + +label-indicator-padding = 2 +label-indicator-margin = 1 +label-indicator-background = ${colors.secondary} +label-indicator-underline = ${colors.secondary} + +click-left = ~/.local/bin/fix-keyboard + +[fs-base] +type = internal/fs +interval = 25 + +format-unmounted-prefix = ${self.format-mounted-prefix} +format-unmounted-prefix-foreground = ${self.format-mounted-prefix-foreground} +format-unmounted-prefix-background = ${self.format-mounted-prefix-background} + +label-mounted = " %percentage_free%% free · %free% " +label-mounted-foreground = ${colors.module-value-foreground} +label-mounted-background = ${colors.module-value-background} + +label-unmounted = " absent " +label-unmounted-foreground = ${colors.module-value-negative-foreground} +label-unmounted-background = ${colors.module-value-negative-background} + +[module/fs-root] +inherit = fs-base +mount-0 = / +format-mounted-prefix = "  Root " +format-mounted-prefix-foreground = #005500 +format-mounted-prefix-background = #b0e000 + +[module/fs-storage] +inherit = fs-base +mount-0 = /home/setanta/storage +format-mounted-prefix = "  External " +format-mounted-prefix-foreground = #b7f6b9 +format-mounted-prefix-background = #347D39 + +[module/ewmh] +type = internal/xworkspaces + +pin-workspaces = true +enable-click = true +enable-scroll = true +reverse-scroll = true + +format = + +; Available tokens: +; %name% +; %icon% +; %index% +; Default: %icon% %name% +label-active = %name% +label-active-foreground = ${colors.primary} +label-active-background = #625233 + +label-occupied = %name% +label-occupied-foreground = ${colors.foreground} +label-occupied-background = ${colors.background-alt} + +label-urgent = %name% +label-urgent-foreground = #ff3a03 +label-urgent-background = #743021 + +label-font = 2.5 + +label-active-padding = 1 +label-urgent-padding = 1 +label-occupied-padding = 1 +label-empty-padding = 1 + +[module/cpu] +type = internal/cpu +interval = 5 +format = "