From 323ba1e6f332381239fe703134e76c99e6b9c0f1 Mon Sep 17 00:00:00 2001 From: doryan Date: Tue, 10 Sep 2024 22:53:10 +0400 Subject: [PATCH] add some configs for bspwm --- bspwm/bspwmrc | 33 +++++ picom/picom.conf | 358 +++++++++++++++++++++++++++++++++++++++++++++ polybar/config.ini | 318 ++++++++++++++++++++++++++++++++++++++++ polybar/launch.sh | 13 ++ sxhkd/sxhkdrc | 125 ++++++++++++++++ 5 files changed, 847 insertions(+) create mode 100755 bspwm/bspwmrc create mode 100644 picom/picom.conf create mode 100644 polybar/config.ini create mode 100755 polybar/launch.sh create mode 100644 sxhkd/sxhkdrc diff --git a/bspwm/bspwmrc b/bspwm/bspwmrc new file mode 100755 index 0000000..74c75ef --- /dev/null +++ b/bspwm/bspwmrc @@ -0,0 +1,33 @@ +#!/bin/sh + +pgrep -x sxhkd > /dev/null || sxhkd & +pgrep -x picom > /dev/null || picom & + +bspc monitor DVI-I-1 -d I II III IV V +bspc monitor HDMI-1 -d VI VII VIII IX X + +bspc config border_width 3 +bspc config window_gap 5 + +bspc config pointer_modifier super +bspc config focus_follows_pointer true +bspc config pointer_follows_focus false +bspc config pointer_motion_interval 5 +bspc config pointer_modifier mod4 +bspc config pointer_action1 move +bspc config pointer_action2 resize_side +bspc config pointer_action3 resize_corner + +bspc rule -a scratch sticky=on state=floating focus=on + +bspc config split_ratio 0.52 +bspc config borderless_monocle true +bspc config gapless_monocle true + +bash $HOME/.config/polybar/launch.sh & +sxhkd & +nitrogen --restore & +dunst & +xsetroot -cursor_name left_ptr & +pipewire & +pipewire-pulse diff --git a/picom/picom.conf b/picom/picom.conf new file mode 100644 index 0000000..35eaa1b --- /dev/null +++ b/picom/picom.conf @@ -0,0 +1,358 @@ +################################# +# ANIMATIONS # +################################# + +# Toggles whether animations should be used for windows +animations = true; + +# Changes animation stiffness. +# What stiffness basically is inferring is how much the window geometry will be stretched, +# when opening/closing windows +animation-stiffness = 250; + +# Change the mass of windows +# Modifying the mass of windows makes them virtually heavier and therefore slower to animate. +animation-window-mass = 0.5; + +# Change dampening applied during the animation +# This setting basically does what it says. It dampens the animation of windows. +animation-dampening = 18; + +# Toggles clamping +# if you are using a animation setting that would make the window extend larger than it would be after, +# the animation has played then it will cut the animation off once the window reaches its physical geometry. +animation-clamping = false; + +# Set the open window animation. +# Options: ("none","zoom","fly-in","slide-up","slide-down","slide-left","slide-right") +animation-for-open-window = "zoom"; + +# Set the closing window animation. +# Options: ("none","zoom","fly-in","slide-up","slide-down","slide-left","slide-right") +animation-for-unmap-window = "zoom"; + +# Exclude certain windows from having a open animation. + +# Exclude certain windows from having a closing animation. + +# animation-unmap-exclude = [ +# "class_g = 'Dunst'" +# ]; + + +################################# +# Shadows # +################################# + +# Enabled client-side shadows on windows. Note desktop windows +# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, +# unless explicitly requested using the wintypes option. +# +# Can be set per-window using rules. +# +# Default: false +shadow = false; + +# The blur radius for shadows, in pixels. +# +# Default: 12 +shadow-radius = 7; + +# The opacity of shadows. +# +# Range: 0.0 - 1.0 +# Default: 0.75 +# shadow-opacity = .75 + +# The left offset for shadows, in pixels. +# +# Default: -15 +shadow-offset-x = -7; + +# The top offset for shadows, in pixels. +# +# Default: -15 +shadow-offset-y = -7; + +# Hex string color value of shadow. Formatted like "#RRGGBB", e.g. "#C0FFEE". +# +# Default: #000000 +# shadow-color = "#000000" + +# Crop shadow of a window fully on a particular monitor to that monitor. This is +# currently implemented using the X RandR extension. +# +# Default: false +# crop-shadow-to-monitor = false + + +################################# +# Fading # +################################# + +# Fade windows in/out when opening/closing and when opacity changes, +# unless no-fading-openclose is used. Can be set per-window using rules. +# +# Default: false +fading = false; + +# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) +fade-in-step = 0.03; + +# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) +fade-out-step = 0.03; + +# The time between steps in fade step, in milliseconds. (> 0, defaults to 10) +# fade-delta = 10 + +# Do not fade on window open/close. +# no-fading-openclose = false + +# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc. +# no-fading-destroyed-argb = false + + +################################# +# Transparency / Opacity # +################################# + +# Opacity of window titlebars and borders. +# +# Range: 0.1 - 1.0 +# Default: 1.0 (disabled) +frame-opacity = 1.0; + +# Use fixed inactive dim value, instead of adjusting according to window opacity. +# +# Default: false +# inactive-dim-fixed = true + +################################# +# Corners # +################################# + +# Sets the radius of rounded window corners. When > 0, the compositor will +# round the corners of windows. Does not interact well with +# `transparent-clipping`. +# +# Default: 0 (disabled) +corner-radius = 8; + +################################# +# Blur # +################################# + +# Parameters for background blurring, see BLUR section in the man page for more information. +# blur-method = +# blur-size = 12 +# blur-deviation = true +# +# blur-strength = 5 + +# Blur background of semi-transparent / ARGB windows. +# Can be set per-window using rules. +# +# Default: false +# blur-background = true + +# Blur background of windows when the window frame is not opaque. +# Implies: +# blur-background +# +# Default: false +# blur-background-frame = false + +# Use fixed blur strength rather than adjusting according to window opacity. +# +# Default: false +# blur-background-fixed = false + + +# Specify the blur convolution kernel, with the following format: +# example: +# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"; +# Can also be a pre-defined kernel, see the man page. +# +# Default: "" +blur-kern = "3x3box"; + +################################# +# General Settings # +################################# + +# Enable remote control via D-Bus. See the man page for more details. +# +# Default: false +# dbus = true + +# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. +# daemon = false + +# Specify the backend to use: `xrender`, `glx`, or `egl`. +# +# Default: "xrender" +backend = "glx" + +# Use higher precision during rendering, and apply dither when presenting the +# rendered screen. Reduces banding artifacts, but may cause performance +# degradation. Only works with OpenGL. +dithered-present = false; + +# Enable/disable VSync. +# +# Default: false +vsync = true; + +# Try to detect windows with rounded corners and don't consider them +# shaped windows. The accuracy is not very high, unfortunately. +# +# Has nothing to do with `corner-radius`. +# +# Default: false +detect-rounded-corners = true; + +# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers +# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows. +# +# Default: false +detect-client-opacity = true; + +# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, +# rather than listening to 'FocusIn'/'FocusOut' event. May be more accurate, +# provided that the WM supports it. +# +# Default: false +# use-ewmh-active-win = false + +# Unredirect all windows if a full-screen opaque window is detected, +# to maximize performance for full-screen windows. Known to cause flickering +# when redirecting/unredirecting windows. +# +# Default: false +# unredir-if-possible = false + +# Delay before unredirecting the window, in milliseconds. +# +# Default: 0. +# unredir-if-possible-delay = 0 + +# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows +# in the same group focused at the same time. +# +# Default: false +detect-transient = true; + +# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same +# group focused at the same time. This usually means windows from the same application +# will be considered focused or unfocused at the same time. +# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too. +# +# Default: false +# detect-client-leader = false + +# Use of damage information for rendering. This cause the only the part of the +# screen that has actually changed to be redrawn, instead of the whole screen +# every time. Should improve performance. +# +# Default: false +use-damage = true; + +# Use X Sync fence to wait for the completion of rendering of other windows, +# before using their content to render the current screen. +# +# Required for explicit sync drivers, such as nvidia. +# +# Default: false +# xrender-sync-fence = false + +# GLX backend: Use specified GLSL fragment shader for rendering window +# contents. Read the man page for a detailed explanation of the interface. +# +# Can be set per-window using rules. +# +# window-shader-fg = "default" + +# Force all windows to be painted with blending. Useful if you +# have a `window-shader-fg` that could turn opaque pixels transparent. +# +# Default: false +# force-win-blend = false + +# Do not use EWMH to detect fullscreen windows. +# Reverts to checking if a window is fullscreen based only on its size and coordinates. +# +# Default: false +# no-ewmh-fullscreen = false + +# Dimming bright windows so their brightness doesn't exceed this set value. +# Brightness of a window is estimated by averaging all pixels in the window, +# so this could comes with a performance hit. +# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. +# +# Default: 1.0 (disabled) +# max-brightness = 1.0 + +# Make transparent windows clip other windows like non-transparent windows do, +# instead of blending on top of them. e.g. placing a transparent window on top +# of another window will cut a "hole" in that window, and show the desktop background +# underneath. +# +# Default: false +# transparent-clipping = false + +# Set the log level. Possible values are: +# "trace", "debug", "info", "warn", "error" +# in increasing level of importance. Case insensitive. +# If using the "TRACE" log level, it's better to log into a file +# using *--log-file*, since it can generate a huge stream of logs. +# +# Default: "warn" +# log-level = "warn"; + +# Set the log file. +# If *--log-file* is never specified, logs will be written to stderr. +# Otherwise, logs will to written to the given file, though some of the early +# logs might still be written to the stderr. +# When setting this option from the config file, it is recommended to use an absolute path. +# +# log-file = "/path/to/your/log/file" + +# Write process ID to a file. +# write-pid-path = "/path/to/your/log/file" + +# Rule-based per-window options. +# +# See WINDOW RULES section in the man page for how these work. +rules: ({ + match = "window_type = 'tooltip'"; + fade = false; + shadow = true; + opacity = 0.75; + full-shadow = false; +}, { + match = "window_type = 'dock' || " + "window_type = 'desktop' || " + "_GTK_FRAME_EXTENTS@"; + blur-background = false; +}, { + match = "window_type != 'dock'"; + # shader = "my_shader.frag"; +}, { + match = "window_type = 'dock' || " + "window_type = 'desktop'"; + corner-radius = 0; +}, { + match = "name = 'Notification' || " + "class_g = 'Conky' || " + "class_g ?= 'Notify-osd' || " + "class_g = 'Cairo-clock' || " + "_GTK_FRAME_EXTENTS@"; + shadow = false; +}) + +# `@include` directive can be used to include additional configuration files. +# Relative paths are search either in the parent of this configuration file +# (when the configuration is loaded through a symlink, the symlink will be +# resolved first). Or in `$XDG_CONFIG_HOME/picom/include`. +# +# @include "extra.conf" diff --git a/polybar/config.ini b/polybar/config.ini new file mode 100644 index 0000000..9807fea --- /dev/null +++ b/polybar/config.ini @@ -0,0 +1,318 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +background = #282A2E +background-alt = #373B41 +foreground = #C5C8C6 +primary = #89A989 +secondary = #478061 +alert = #A54242 +disabled = #707880 + +[bar/example] +width = 100% +height = 18pt +radius = 7pt + +; dpi = 96 + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 1pt + +border-size = 4pt +border-color = #00000000 + +padding-left = 0 +padding-right = 1 + +module-margin = 1 + +separator = | +separator-foreground = ${colors.disabled} + +font-0 = "FiraCode Nerd Font:size=10;2" + +modules-left = xworkspaces +modules-center = xwindow +modules-right = memory cpu pulseaudio xkeyboard wlan eth date battery + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +; wm-restack = generic +; wm-restack = bspwm +; wm-restack = i3 + +; override-redirect = true + +; This module is not active by default (to enable it, add it to one of the +; modules-* list above). +; Please note that only a single tray can exist at any time. If you launch +; multiple bars with this module, only a single one will show it, the others +; will produce a warning. Which bar gets the module is timing dependent and can +; be quite random. +; For more information, see the documentation page for this module: +; https://polybar.readthedocs.io/en/stable/user/modules/tray.html +[module/systray] +type = internal/tray + +format-margin = 8pt +tray-spacing = 16pt + +[module/xworkspaces] +type = internal/xworkspaces + +label-active = %name% +label-active-background = ${colors.background-alt} +label-active-underline= ${colors.primary} +label-active-padding = 1 + +label-occupied = %name% +label-occupied-padding = 1 + +label-urgent = %name% +label-urgent-background = ${colors.alert} +label-urgent-padding = 1 + +label-empty = %name% +label-empty-foreground = ${colors.disabled} +label-empty-padding = 1 + +[module/xwindow] +type = internal/xwindow +label = %title:0:60:...% + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / + +label-mounted = %{F#89A989}%mountpoint%%{F-} %percentage_used%% + +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.disabled} + +[module/pulseaudio] +type = internal/pulseaudio + +format-volume = %{F#89A989}%{F-} + +label-volume = %percentage%% + +label-muted = 󰝟 muted + +; Only applies if is used +ramp-volume-0 = 󰕿 +ramp-volume-1 = 󰖀 +ramp-volume-2 = 󰕾 + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +label-layout = %layout% +label-layout-foreground = ${colors.primary} + +label-indicator-padding = 2 +label-indicator-margin = 1 +label-indicator-foreground = ${colors.background} +label-indicator-background = ${colors.secondary} + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = " " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = " " +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% + +[network-base] +type = internal/network +interval = 5 +format-connected = +format-disconnected = +label-disconnected = %{F#89A989}󰲛 %{F#707880} disconnected + +[module/wlan] +inherit = network-base +interface-type = wireless +label-connected = %{F#89A989}%ifname%%{F-} %essid% %local_ip% + +ramp-signal-0 = 󰤭 +ramp-signal-1 = 󰤯 +ramp-signal-2 = 󰤟 +ramp-signal-3 = 󰤢 +ramp-signal-4 = 󰤥 +ramp-signal-5 = 󰤨 + +[module/eth] +inherit = network-base +interface-type = wired +label-connected = %{F#89A989}󰈀 %{F-} %local_ip% + +[module/date] +type = internal/date +interval = 1 + +date = %H:%M +date-alt = %Y-%m-%d %H:%M:%S + +label = %date% +label-foreground = ${colors.primary} + +[module/battery] +type = internal/battery + +; This is useful in case the battery never reports 100% charge +; Default: 100 +full-at = 99 + +; format-low once this charge percentage is reached +; Default: 10 +; New in version 3.6.0 +low-at = 5 + +; Use the following command to list batteries and adapters: +; $ ls -1 /sys/class/power_supply/ +battery = BAT0 +adapter = ADP1 + +; If an inotify event haven't been reported in this many +; seconds, manually poll for new values. +; +; Needed as a fallback for systems that don't report events +; on sysfs/procfs. +; +; Disable polling by setting the interval to 0. +; +; Default: 5 +poll-interval = 5 + +; see "man date" for details on how to format the time string +; NOTE: if you want to use syntax tags here you need to use %%{...} +; Default: %H:%M:%S +time-format = %H:%M + +; Available tags: +; (default) +; +; +; +format-charging = + +; Available tags: +; (default) +; +; +; +format-discharging = + +; Available tags: +; (default) +; +; +;format-full = + +; Format used when battery level drops to low-at +; If not defined, format-discharging is used instead. +; Available tags: +; +; +; +; +; New in version 3.6.0 +;format-low = + +; Available tokens: +; %percentage% (default) - is set to 100 if full-at is reached +; %percentage_raw% +; %time% +; %consumption% (shows current charge rate in watts) +label-charging = Charging %percentage%% + +; Available tokens: +; %percentage% (default) - is set to 100 if full-at is reached +; %percentage_raw% +; %time% +; %consumption% (shows current discharge rate in watts) +label-discharging = Discharging %percentage%% + +; Available tokens: +; %percentage% (default) - is set to 100 if full-at is reached +; %percentage_raw% +label-full = Fully charged + +; Available tokens: +; %percentage% (default) - is set to 100 if full-at is reached +; %percentage_raw% +; %time% +; %consumption% (shows current discharge rate in watts) +; New in version 3.6.0 +label-low = BATTERY LOW + +; Only applies if is used +ramp-capacity-0 =  +ramp-capacity-1 =  +ramp-capacity-2 =  +ramp-capacity-3 =  +ramp-capacity-4 =  + +; Only applies if is used +bar-capacity-width = 10 + +; Only applies if is used +animation-charging-0 =  +animation-charging-1 =  +animation-charging-2 =  +animation-charging-3 =  +animation-charging-4 =  +; Framerate in milliseconds +animation-charging-framerate = 750 + +; Only applies if is used +animation-discharging-0 =  +animation-discharging-1 =  +animation-discharging-2 =  +animation-discharging-3 =  +animation-discharging-4 =  +; Framerate in milliseconds +animation-discharging-framerate = 500 + +; Only applies if is used +; New in version 3.6.0 +animation-low-0 = ! +animation-low-1 = +animation-low-framerate = 200 + +[settings] +screenchange-reload = true +pseudo-transparency = true + +; vim:ft=dosini diff --git a/polybar/launch.sh b/polybar/launch.sh new file mode 100755 index 0000000..64d81e7 --- /dev/null +++ b/polybar/launch.sh @@ -0,0 +1,13 @@ +#!/bin/zsh + +# Terminate already running bar instances +# If all your bars have ipc enabled, you can use +polybar-msg cmd quit +# Otherwise you can use the nuclear option: +# killall -q polybar + +# Launch bar1 and bar2 +echo "---" | tee -a /tmp/polybar1.log /tmp/polybar2.log +polybar example | tee -a /tmp/polybar1.log & disown + +echo "Bars launched..." diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc new file mode 100644 index 0000000..567e5af --- /dev/null +++ b/sxhkd/sxhkdrc @@ -0,0 +1,125 @@ +# +# wm independent hotkeys +# + +# make screenshot + +Print + flameshot gui + +# terminal emulator +super + Return + tabbed -r 2 st -w '' +# program launcher +super + d + rofi -show drun -show-icons -drun-icon-theme Mojave-CT-Night-Mode + + +# make sxhkd reload its configuration files: +super + Escape + pkill -USR1 -x sxhkd + +# +# bspwm hotkeys +# + +# quit/restart bspwm +super + alt + {q,r} + bspc {quit,wm -r} + +# close and kill +super + {q, shift + q} + bspc node -{c,k} + +# alternate between the tiled and monocle layout +super + m + bspc desktop -l next + +# send the newest marked node to the newest preselected node +super + y + bspc node newest.marked.local -n newest.!automatic.local + +# swap the current node and the biggest window +super + g + bspc node -s biggest.window +# +# state/flags +# + +# set the window state +super + {t,shift + t,s,f} + bspc node -t {tiled,pseudo_tiled,floating,fullscreen} + +# set the node flags +super + ctrl + {m,x,y,z} + bspc node -g {marked,locked,sticky,private} + +# +# focus/swap +# + +# focus the node in the given direction +super + {_,shift + }{h,j,k,l} + bspc node -{f,s} {west,south,north,east} + +# focus the node for the given path jump +super + {p,b,comma,period} + bspc node -f @{parent,brother,first,second} + +# focus the next/previous win dow in the current desktop +super + {_,shift + }c + bspc node -f {next,prev}.local.!hidden.window + +# focus the next/previous desktop in the current monitor +super + bracket{left,right} + bspc desktop -f {prev,next}.local + +# focus the last node/desktop +super + {grave,Tab} + bspc {node,desktop} -f last + +# focus the older or newer node in the focus history +super + {o,i} + bspc wm -h off; \ + bspc node {older,newer} -f; \ + bspc wm -h on + +# focus or send to the given desktop +super + {_,shift + }{1-9,0} + bspc {desktop -f,node -d} '^{1-9,10}' + +# +# preselect +# + +# preselect the direction +super + ctrl + {h,j,k,l} + bspc node -p {west,south,north,east} + +# preselect the ratio +super + ctrl + {1-9} + bspc node -o 0.{1-9} + +# cancel the preselection for the focused node +super + ctrl + space + bspc node -p cancel + +# cancel the preselection for the focused desktop +super + ctrl + shift + space + bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel + +# +# move/resize +# + +# expand a window by moving one of its side outward +super + alt + {h,j,k,l} + bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} + +# contract a window by moving one of its side inward +super + alt + shift + {h,j,k,l} + bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} + +# move a floating window +super + {Left,Down,Up,Right} + bspc node -v {-20 0,0 20,0 -20,20 0}