From e31da14de540397f48f7ab85c6f4971ffc82d263 Mon Sep 17 00:00:00 2001 From: DustVoice Date: Wed, 4 Mar 2020 03:51:39 +0100 Subject: [PATCH] Switch to bspwm --- .config/.gitignore | 3 + .config/bspwm/bspwmrc | 52 +++ .config/dmenu/dmenu-bspwm-movement-desktop.sh | 40 ++ .config/dmenu/dmenu-bspwm-movement-monitor.sh | 35 ++ .config/dmenu/dmenu-bspwm-rename-desktop.sh | 34 ++ .config/polybar/config | 372 ++++++++++++------ .config/polybar/i3 | 1 - .config/polybar/i3wmthemer_bar_launch.sh | 7 - .config/polybar/launch.sh | 13 + .config/polybar/nitrogen | 1 - .config/sxhkd/sxhkdrc | 154 ++++++++ 11 files changed, 584 insertions(+), 128 deletions(-) create mode 100755 .config/bspwm/bspwmrc create mode 100755 .config/dmenu/dmenu-bspwm-movement-desktop.sh create mode 100755 .config/dmenu/dmenu-bspwm-movement-monitor.sh create mode 100755 .config/dmenu/dmenu-bspwm-rename-desktop.sh delete mode 120000 .config/polybar/i3 delete mode 100755 .config/polybar/i3wmthemer_bar_launch.sh create mode 100755 .config/polybar/launch.sh delete mode 120000 .config/polybar/nitrogen create mode 100644 .config/sxhkd/sxhkdrc diff --git a/.config/.gitignore b/.config/.gitignore index d22d12c..ab9df9d 100644 --- a/.config/.gitignore +++ b/.config/.gitignore @@ -4,9 +4,12 @@ !/.compton.conf/ !/alacritty/ +!/bspwm/ +!/dmenu/ !/fish/ !/i3/ !/i3status/ !/nitrogen/ !/nvim/ !/polybar/ +!/sxhkd/ diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc new file mode 100755 index 0000000..b70e19e --- /dev/null +++ b/.config/bspwm/bspwmrc @@ -0,0 +1,52 @@ +#!/bin/sh + +sxhkd & + +nitrogen --restore & +/usr/lib/xfce-polkit/xfce-polkit & +xss-lock -- i3lock -n -e -c 333333 + +i=1 +for monitor in $(bspc query -M); do + bspc monitor $monitor -d 1 + let i++ +done +NMON=$i +unset i + +bspc config border_width 2 +bspc config window_gap 0 +bspc config top_padding 20 +bspc config bottom_padding 0 +bspc config left_padding 0 +bspc config right_padding 0 +bspc config single_monocle false +bspc config click_to_focus true +bspc config split_ratio 0.50 +bspc config borderless_monocle true +bspc config gapless_monocle true +bspc config focus_by_distance true +bspc config focus_follows_pointer true +bspc config history_aware_focus true +bspc config remove_disabled_monitors true +bspc config merge_overlapping_monitors true +bspc config pointer_modifier mod1 +bspc config pointer_action1 move +bspc config pointer_action2 resize_side +bspc config pointer_action3 resize_corner + +bspc config normal_border_color "#4c566a" +bspc config active_border_color "#1e1e1e" +bspc config focused_border_color "#5e81cc" +bspc config presel_feedback_color "#5e81ac" +bspc config urgent_border_color "#dd2727" + +#polybar hidden when fullscreen for vlc, youtube, mpv ... +#find out the name of your monitor with xrandr +xdo below -t $(xdo id -n root) $(xdo id -a polybar-main_DisplayPort-0) +xdo below -t $(xdo id -n root) $(xdo id -a polybar-main_DisplayPort-1) +xdo below -t $(xdo id -n root) $(xdo id -a polybar-main_HDMI-A-0) + +bspc rule -a Screenkey manage=off + +$HOME/.config/polybar/launch.sh diff --git a/.config/dmenu/dmenu-bspwm-movement-desktop.sh b/.config/dmenu/dmenu-bspwm-movement-desktop.sh new file mode 100755 index 0000000..f550203 --- /dev/null +++ b/.config/dmenu/dmenu-bspwm-movement-desktop.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +dmenu_string="Wrong parameter" + +case $1 in + "goto") + dmenu_string="Switch to desktop: " ;; + "move") + dmenu_string="Move node to desktop: " ;; + "movefollow") + dmenu_string="Move and follow node to desktop: " ;; +esac + +desktop=$(bspc query -m focused -D --names | dmenu -p "$dmenu_string") + +found=false + +desktop_list=$(bspc query -m focused -D --names | tr '\n' ' ') + +if [[ $desktop != "" ]]; +then + for name in $desktop_list; do + if [[ $name == $desktop ]]; then + found=true + fi + done +fi + +if [ ! $found = true ]; then + bspc monitor -d $desktop_list $desktop +fi + +case $1 in + "goto") + bspc desktop -f $desktop ;; + "move") + bspc node -d $desktop ;; + "movefollow") + bspc node -d $desktop --follow ;; +esac diff --git a/.config/dmenu/dmenu-bspwm-movement-monitor.sh b/.config/dmenu/dmenu-bspwm-movement-monitor.sh new file mode 100755 index 0000000..ce3f478 --- /dev/null +++ b/.config/dmenu/dmenu-bspwm-movement-monitor.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +dmenu_string="Wrong parameter" + +case $1 in + "goto") + dmenu_string="Switch to monitor: " ;; + "swap") + dmenu_string="Swap monitor with monitor: " ;; + "movenode") + dmenu_string="Move node to monitor: " ;; + "movenodefollow") + dmenu_string="Move and follow node to monitor: " ;; + "movedesktop") + dmenu_string="Move desktop to monitor: " ;; + "movedesktopfollow") + dmenu_string="Move and follow desktop to monitor: " ;; +esac + +monitor=$(bspc query -M --names | dmenu -p "$dmenu_string") + +case $1 in + "goto") + bspc monitor -f $monitor ;; + "swap") + bspc monitor -s $monitor ;; + "movenode") + bspc node -m $monitor ;; + "movenodefollow") + bspc node -m $monitor --follow ;; + "movedesktop") + bspc desktop -m $monitor ;; + "movedesktopfollow") + bspc desktop -m $monitor --follow ;; +esac diff --git a/.config/dmenu/dmenu-bspwm-rename-desktop.sh b/.config/dmenu/dmenu-bspwm-rename-desktop.sh new file mode 100755 index 0000000..da2c2bc --- /dev/null +++ b/.config/dmenu/dmenu-bspwm-rename-desktop.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +dmenu_string="Wrong parameter" + +case $1 in + "rename") + dmenu_string="Rename desktop to: " ;; + "swap") + dmenu_string="Swap desktop with desktop: " ;; + "swapfollow") + dmenu_string="Swap and follow desktop with desktop: " ;; +esac + +desktop=$(bspc query -m focused -D --names | dmenu -p "$dmenu_string") + +case $1 in + "rename") + if [[ $desktop != "" ]]; + then + bspc desktop -n $desktop + else + response=$(echo "" | dmenu -p 'Really remove this desktop? (n = abort): ') + + if [[ $response != "n" ]]; + then + bspc desktop -r + fi + fi + ;; + "swap") + bspc desktop -s $desktop ;; + "swapfollow") + bspc desktop -s $desktop --follow ;; +esac diff --git a/.config/polybar/config b/.config/polybar/config index da58660..92e9bf7 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -1,157 +1,291 @@ -[bar/i3wmthemer_bar] -width = 100% -height = 27 -radius = 0 +[colors] +background = #000000 +background-alt = #000000 +foreground = #cccccc +foreground-alt = #cccccc +primary = #526274 +secondary = #57553a +alert = #a17c38 +active = {active} +inactive = {inactive} +highlight = #57553a +error = #a64848 + +bspwmborder = #57553a +pulse = #41434f +xkb = #844d2c +memory = #57553a +eth = #a17c38 +pc = #41434f +xwindow = #a17c38 +mus = #57553a + +[bar/top] +monitor = ${env:MONITOR:} +font-0 = Hack:pixelsize=10;2 +monitor-strict = false +override-redirect = false +bottom = false fixed-center = false +width = 100% +height = 20 +offset-x = 0% +offset-y = 0% -background = #1f1f1f -foreground = #c6c6c6 +background = ${colors.background} +foreground = ${colors.foreground} -line-size = 3 -line-color = +radius = 3 +line-size = 2 +line-color = #000000 border-size = 0 -border-color = +border-color = #000000 padding-left = 0 -padding-right = 2 +padding-right = 0 -module-margin-left = 1 -module-margin-right = 2 +module-margin-left = 0 +module-margin-right = 0 -font-0 = "Source Code Pro Semibold:size=10;1" -font-1 = "Font Awesome 5 Free:style=Solid:size=10;1" -font-2 = "Font Awesome 5 Brands:size=10;1" +modules-left = bspwm sep -modules-left = wlan eth -modules-center = i3 -modules-right = date powermenu +;modules-center = xwindow -tray-position = -;tray-padding = +modules-right = date sep xkeyboard sep cpu space temperature sep memory sep filesystem sep pulseaudio sep + +tray-position = right +tray-padding = 0 +tray-maxsize = 14 +tray-background = #000000 + +wm-restack = bspwm + +;override-redirect = true + +scroll-up = bspwm-desknext +scroll-down = bspwm-deskprev cursor-click = pointer cursor-scroll = ns-resize -[module/i3] -type = internal/i3 -format = -index-sort = true -wrapping-scroll = false - -label-mode-padding = 2 -label-mode-foreground = #828282 -label-mode-background = #1f1f1f - -label-focused = %index% -label-focused-background = #8abeb7 -label-focused-foreground = #1f1f1f -label-focused-padding = 2 - -label-unfocused = %index% -label-unfocused-background = #8abeb7 -label-unfocused-foreground = #1f1f1f -label-unfocused-padding = 2 - -label-visible = %index% -label-visible-background = #8abeb7 -label-visible-foreground = #1f1f1f -label-visible-padding = 2 - -label-urgent = %index% -label-urgent-background = #BA2922 -label-urgent-padding = 2 - -[module/wlan] -type = internal/network -interface = net1 -interval = 3.0 - -format-connected = -format-connected-foreground = #1f1f1f -format-connected-background = #8abeb7 -format-connected-padding = 2 -label-connected = %essid% - -format-disconnected = - -ramp-signal-0 =  -ramp-signal-1 =  -ramp-signal-2 =  -ramp-signal-3 =  -ramp-signal-4 =  -ramp-signal-foreground = #1f1f1f - -[module/eth] -type = internal/network -interface = enp0s3 -interval = 3.0 - -format-connected-padding = 2 -format-connected-foreground = #1f1f1f -format-connected-background = #8abeb7 -format-connected-prefix = " " -format-connected-prefix-foreground = #1f1f1f -label-connected = %local_ip% - -format-disconnected = - [module/date] type = internal/date -interval = 5 +interval = 1 -date = -date-alt = " %Y-%m-%d" +format =