From 3aca4a27afd22006c6d789f6dc2ed6f15996c9e0 Mon Sep 17 00:00:00 2001 From: oasido Date: Sat, 13 Apr 2024 19:35:54 +0300 Subject: [PATCH] add i3wm, polybar, sxhkd, rofi --- .config/i3/config | 62 +++++++++ .config/i3/theme | 9 ++ .config/i3/workspaces | 29 +++++ .config/polybar/config.ini | 199 +++++++++++++++++++++++++++++ .config/polybar/launch.sh | 16 +++ .config/polybar/polybar | 1 + .config/polybar/theme.ini | 24 ++++ .config/rofi/config.rasi | 11 ++ .config/rofi/themes/spotlight.rasi | 98 ++++++++++++++ .config/sxhkd/sxhkdrc | 109 ++++++++++++++++ 10 files changed, 558 insertions(+) create mode 100644 .config/i3/config create mode 100644 .config/i3/theme create mode 100644 .config/i3/workspaces create mode 100644 .config/polybar/config.ini create mode 100755 .config/polybar/launch.sh create mode 160000 .config/polybar/polybar create mode 100644 .config/polybar/theme.ini create mode 100644 .config/rofi/config.rasi create mode 100644 .config/rofi/themes/spotlight.rasi create mode 100644 .config/sxhkd/sxhkdrc diff --git a/.config/i3/config b/.config/i3/config new file mode 100644 index 0000000..f6ff8ac --- /dev/null +++ b/.config/i3/config @@ -0,0 +1,62 @@ +include $HOME/.config/i3/theme +include $HOME/.config/i3/workspaces + +set $mod Mod4 +set $primary DP-2 +set $secondary DP-0 + +# font pango:monospace 12 +font pango:JetBrains Mono 12 + +exec --no-startup-id dex --autostart --environment i3 +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork +exec --no-startup-id nm-applet +exec --no-startup-id sxhkd +exec --no-startup-id compton +exec --no-startup-id ~/.dot/.local/bin/scripts/audio-setup + +# Autostart applications +exec --no-startup-id flatpak run dev.vencord.Vesktop +exec --no-startup-id flatpak run org.telegram.desktop + +floating_modifier $mod + +# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop + +for_window [class="^.*"] border pixel 2 +for_window [class="^.*"] client.focused + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt +# same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +# bar { +# # status_command i3status +# status_command SCRIPTS_DIR=~/.config/i3blocks/scripts i3blocks +# tray_output DP-2 +# tray_padding 5 +# separator_symbol "|" +# } + +exec --no-startup-id $HOME/.config/polybar/launch.sh + diff --git a/.config/i3/theme b/.config/i3/theme new file mode 100644 index 0000000..89bcb46 --- /dev/null +++ b/.config/i3/theme @@ -0,0 +1,9 @@ +#sonokai +# class border backgr. text indicator child_border +client.focused #f3a96a #f3a96a #1a1826 #f3a96a #f3a96a +client.focused_inactive #82878b #82878b #ffffff #82878b #82878b +client.unfocused #333333 #222222 #888888 #292d2e #222222 +client.urgent #cc241d #900000 #ffffff #cc241d #cc241d +client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c + +client.background #ffffff diff --git a/.config/i3/workspaces b/.config/i3/workspaces new file mode 100644 index 0000000..a36bb6e --- /dev/null +++ b/.config/i3/workspaces @@ -0,0 +1,29 @@ +set $ws0 "0" +set $ws1 "1: >_" +set $ws2 "2: Web" +set $ws3 "3: Dev" +set $ws4 "4: Comms" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" +set $ws11 "11" +set $ws12 "12" + +workspace $ws1 output $primary +workspace $ws2 output $secondary +workspace $ws3 output $secondary +workspace $ws4 output $secondary +workspace $ws9 output $primary +workspace $ws10 output $secondary + +assign [class="Alacritty|gnome-terminal-server"] $ws1 +assign [class="chromium-browser|LibreWolf"] $ws2 +assign [class="docker desktop"] $ws3 +assign [class="vesktop|discord|telegram-desktop"] $ws4 +assign [class="steam"] $ws9 +assign [class="REAPER|pavucontrol"] $ws10 + +for_window [class="vol|ttrm|mus|fm|news"] floating enable, resize set 1000 600, move scratchpad, border pixel 0 diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini new file mode 100644 index 0000000..34fafd1 --- /dev/null +++ b/.config/polybar/config.ini @@ -0,0 +1,199 @@ +[colors] +background = #282A2E +background-alt = #373B41 +foreground = #C5C8C6 +primary = #F0C674 +secondary = #8ABEB7 +alert = #A54242 +disabled = #707880 + +[bar/main] +monitor = DP-2 +width = 100% +height = 22pt +radius = 0 +bottom = true + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3pt + +; border-size = 4pt +border-size = 0 +border-color = #00000000 + +padding-left = 0 +padding-right = 1 + +module-margin = 1 + +separator = | +separator-foreground = ${colors.disabled} + +font-0 = JetBrains Mono;2 + +modules-left = xworkspaces xwindow +modules-right = filesystem pulseaudio xkeyboard memory cpu wlan date systray + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +tray-detached = false +tray-offset-x = 0 +tray-offset-y = 0 +tray-padding = 2 +tray-maxsize = 20 +tray-scale = 1.0 +tray-position = none +tray-background = ${colors.background} + +[bar/secondary] +monitor = DP-0 +monitor-strict = false +width = 100% +height = 22pt +radius = 0 +bottom = true + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3pt + +; border-size = 4pt +border-size = 0 +border-color = #00000000 + +padding-left = 0 +padding-right = 1 + +module-margin = 1 + +separator = | +separator-foreground = ${colors.disabled} + +font-0 = JetBrains Mono;2 + +modules-left = xworkspaces xwindow +modules-right = date + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +[module/systray] +type = internal/tray + +format-margin = 8pt +tray-spacing = 16pt + +[module/xworkspaces] +type = internal/xworkspaces +pin-workspaces = true + +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#F0C674}%mountpoint%%{F-} %percentage_used%% + +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.disabled} + +[module/pulseaudio] +type = internal/pulseaudio + +format-volume-prefix = "VOL " +format-volume-prefix-foreground = ${colors.primary} +format-volume = + +label-volume = %percentage%% + +label-muted = muted +label-muted-foreground = ${colors.disabled} +click-right = pavucontrol + +[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 = "RAM " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = "CPU " +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% + +[network-base] +type = internal/network +interval = 5 +format-connected = +format-disconnected = +label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected + +[module/wlan] +inherit = network-base +interface-type = wireless +label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip% + +[module/eth] +inherit = network-base +interface-type = wired +label-connected = %{F#F0C674}%ifname%%{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} + +[settings] +screenchange-reload = true +pseudo-transparency = true + +; vim:ft=dosini diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh new file mode 100755 index 0000000..c3005fa --- /dev/null +++ b/.config/polybar/launch.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# 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 -c ~/.config/polybar/config.ini main 2>&1 | tee -a /tmp/polybar1.log & disown +polybar -c ~/.config/polybar/config.ini secondary 2>&1 | tee -a /tmp/polybar1.log & disown +# polybar -c ~/.config/polybar/config.ini example 2>&1 | tee -a /tmp/polybar1.log & disown +# polybar -c ~/.config/polybar/config.ini mainbar-i3 2>&1 | tee -a /tmp/polybar1.log & disown + +echo "Bars launched..." diff --git a/.config/polybar/polybar b/.config/polybar/polybar new file mode 160000 index 0000000..11b522c --- /dev/null +++ b/.config/polybar/polybar @@ -0,0 +1 @@ +Subproject commit 11b522c313f7b2b0a10063721ec8b0bf544de6f4 diff --git a/.config/polybar/theme.ini b/.config/polybar/theme.ini new file mode 100644 index 0000000..ceb8286 --- /dev/null +++ b/.config/polybar/theme.ini @@ -0,0 +1,24 @@ +[colors] +background = #1F1F28 +foreground = #DCD7BA +alert = #C34043 + +darkred = #e82424 +red = #c34043 +darkgreen = #76946A +green = #98BB6C +darkyellow = #FF9E3B +yellow = #DCA561 +darkblue = #658594 +blue = #7FB4CA +darkpurple = #957FB8 +purple = #938AA9 +darkaqua = #6A9589 +aqua = #7AA89F +gray = #717C7C +darkbg = #16161D +lightbg = #363646 +lightbg2 = #54546D +darkorange = #d65d0e +orange = #FF9E3B + diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi new file mode 100644 index 0000000..fb88254 --- /dev/null +++ b/.config/rofi/config.rasi @@ -0,0 +1,11 @@ +configuration { + display-drun: "Applications:"; + display-window: "Windows:"; + drun-display-format: "{icon} {name}"; + font: "JetBrains Mono 20"; + modi: "window,run,drun"; + show-icons: true; + icon-theme: "Papirus"; +} + +@theme "/home/oasido/.config/rofi/themes/spotlight.rasi" diff --git a/.config/rofi/themes/spotlight.rasi b/.config/rofi/themes/spotlight.rasi new file mode 100644 index 0000000..0e27360 --- /dev/null +++ b/.config/rofi/themes/spotlight.rasi @@ -0,0 +1,98 @@ +/******************************************************************************* + * MACOS SPOTLIGHT LIKE DARK THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "Montserrat 12"; + + bg0: #242424E6; + bg1: #7E7E7E80; + bg2: #0860f2E6; + + fg0: #DEDEDE; + fg1: #FFFFFF; + fg2: #DEDEDE80; + + background-color: transparent; + text-color: @fg0; + + margin: 0; + padding: 0; + spacing: 0; +} + +window { + background-color: @bg0; + + location: center; + width: 640; + border-radius: 8; +} + +inputbar { + font: "Montserrat 20"; + padding: 12px; + spacing: 12px; + children: [ icon-search, entry ]; +} + +icon-search { + expand: false; + filename: "search"; + size: 28px; +} + +icon-search, entry, element-icon, element-text { + vertical-align: 0.5; +} + +entry { + font: inherit; + + placeholder : "Search"; + placeholder-color : @fg2; +} + +message { + border: 2px 0 0; + border-color: @bg1; + background-color: @bg1; +} + +textbox { + padding: 8px 24px; +} + +listview { + lines: 10; + columns: 1; + + fixed-height: false; + border: 1px 0 0; + border-color: @bg1; +} + +element { + padding: 8px 16px; + spacing: 16px; + background-color: transparent; +} + +element normal active { + text-color: @bg2; +} + +element selected normal, element selected active { + background-color: @bg2; + text-color: @fg1; +} + +element-icon { + size: 1em; +} + +element-text { + text-color: inherit; +} diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc new file mode 100644 index 0000000..ded1caa --- /dev/null +++ b/.config/sxhkd/sxhkdrc @@ -0,0 +1,109 @@ +super + Escape + pkill -USR1 -x sxhkd + +super + shift + Return + nemo + +# Terminal +super + Return + alacritty + +# --- i3wm --- + +# Close focused window +super + shift + q + i3-msg [instance="__focused__"] kill + +# Program launcher +super + d + rofi -show drun + +# Change focus +super + {Left,Down,Up,Right} + i3-msg focus {left,down,up,right} + +# Move focused window +super + shift + {Left,Down,Up,Right} + i3-msg move {left,down,up,right} + +# Split orientation +super + {h,v} + i3-msg split {horizontal,vertical} + +# Fullscreen toggle for focused container +super + f + i3-msg fullscreen toggle + +# Layout change +super + {s,w,e} + i3-msg layout {stacking,tabbed,toggle split} + +# Floating toggle +super + shift + space + i3-msg floating toggle + +# Focus mode toggle +super + space + i3-msg focus mode_toggle + +# Focus parent/child container +super + {a,d} + i3-msg focus {parent,child} + +# Workspace switching +super + {1-9,0} + i3-msg workspace number {1-9,10} + +# Move container to workspace +super + shift + {1-9,0} + i3-msg move container to workspace number {1-9,10} + +# Reload and restart i3 +super + shift + {c,r} + i3-msg {reload,restart} + +# Exit i3 +super + shift + e + i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit' + +# Resize mode +super + r + i3-msg mode "resize" + +# Volume adjustments +XF86AudioRaiseVolume + pulsemixer --change-volume +5 --max-volume 100; pkill -SIGUSR1 i3status + +XF86AudioLowerVolume + pulsemixer --change-volume -5 --max-volume 100; pkill -SIGUSR1 i3status + +XF86AudioMute + pactl set-sink-mute @DEFAULT_SINK@ toggle; pkill -SIGUSR1 i3status + +# Toggle microphone mute with specific source ID +XF86Launch5 + pulsemixer --id source-$(pulsemixer --list-sources | grep -i "RODE NT-USB Analog Stereo" | sed -n 's/.*ID: source-\([0-9]*\).*/\1/p') --toggle-mute + +# Media controls +XF86AudioPlay + playerctl play + +XF86AudioPause + playerctl pause + +XF86AudioNext + playerctl next + +XF86AudioPrev + playerctl previous + +# Keyboard layout toggle +alt + shift + setxkbmap -layout us,il -option grp:alt_shift_toggle + +# Brightness +XF86MonBrightnessUp + xbacklight -inc 20 +XF86MonBrightnessDown + xbacklight -dec 20 +