From bf6eb6b13abb90d0784e7112d1cded0b246075b1 Mon Sep 17 00:00:00 2001 From: Asocia Date: Sun, 11 Jul 2021 16:51:11 +0300 Subject: [PATCH] Switch to i3 --- .config/i3/config | 235 ++++++++++++++++ .config/picom/picom.conf | 41 +++ .config/polybar/config | 389 ++++++++++++++++++++++++++ .config/polybar/launch.sh | 4 + .config/polybar/rofi/colors.rasi | 10 + .config/polybar/rofi/confirm.rasi | 20 ++ .config/polybar/rofi/networkmenu.rasi | 123 ++++++++ .config/polybar/rofi/powermenu.rasi | 40 +++ .config/polybar/scripts/gpu.sh | 3 + .config/polybar/scripts/launcher.sh | 3 + .config/polybar/scripts/network.sh | 67 +++++ .config/polybar/scripts/powermenu.sh | 94 +++++++ .config/polybar/scripts/uptime.sh | 3 + .config/polybar/scripts/weather.sh | 3 + .config/polybar/scripts/wttr.sh | 4 + scripts/misc/battery-level.sh | 27 ++ scripts/rofi/launch.sh | 11 + scripts/rofi/music.sh | 24 ++ scripts/rofi/powermenu.sh | 19 ++ 19 files changed, 1120 insertions(+) create mode 100644 .config/i3/config create mode 100644 .config/picom/picom.conf create mode 100644 .config/polybar/config create mode 100755 .config/polybar/launch.sh create mode 100644 .config/polybar/rofi/colors.rasi create mode 100644 .config/polybar/rofi/confirm.rasi create mode 100644 .config/polybar/rofi/networkmenu.rasi create mode 100644 .config/polybar/rofi/powermenu.rasi create mode 100755 .config/polybar/scripts/gpu.sh create mode 100755 .config/polybar/scripts/launcher.sh create mode 100755 .config/polybar/scripts/network.sh create mode 100755 .config/polybar/scripts/powermenu.sh create mode 100755 .config/polybar/scripts/uptime.sh create mode 100755 .config/polybar/scripts/weather.sh create mode 100755 .config/polybar/scripts/wttr.sh create mode 100755 scripts/misc/battery-level.sh create mode 100755 scripts/rofi/launch.sh create mode 100755 scripts/rofi/music.sh create mode 100755 scripts/rofi/powermenu.sh diff --git a/.config/i3/config b/.config/i3/config new file mode 100644 index 0000000..94df464 --- /dev/null +++ b/.config/i3/config @@ -0,0 +1,235 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod1 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:monospace 8 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +exec --no-startup-id nm-applet + +# custom settings +exec_always --no-startup-id pkill picom; picom --no-use-damage +exec_always --no-startup-id pkill dunst; dunst + + +exec_always --no-startup-id xrdb ~/.Xresources +exec_always --no-startup-id ~/.config/polybar/launch.sh +# exec_always --no-startup-id $HOME/.config/polybar/launch.sh +# +# + +# Set common scripts to vars +set $rofi ~/scripts/rofi/launch.sh +set $music ~/scripts/music/mpv-controller.sh + +# Turn borders off +for_window [class="^.*"] border pixel 2 +client.focused #555555 #555555 #ffffff #2e9ef4 #CC0000 + +# Change gap size +gaps outer 0 +gaps inner 0 +gaps top 20 + +# kill focused window +bindsym $mod+q kill + +# Start rofi with appmenu and tabmenu +bindsym $mod+space layout toggle split +bindsym $mod+d exec $rofi appmenu +bindsym $mod+Tab workspace back_and_forth +bindsym $mod+Shift+e exec $rofi powermenu + + +# Set up screenshots and partial screenshots +bindsym --release Print exec maim ~/images/scrots/`date +%Y-%m-%d_%H:%M:%S`.png +bindsym --release Shift+Print exec maim -s ~/images/scrots/`date +%Y-%m-%d_%H:%M:%S`.png + + +# Bind brightness keys to light interface +bindsym XF86MonBrightnessUp exec light -A 5 +bindsym XF86MonBrightnessDown exec light -U 5 + +# Drag floating windows +floating_modifier $mod + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# start a terminal +# bindsym $mod+Return exec i3-sensible-terminal + +# kill focused window +# bindsym $mod+Shift+q kill + +# start dmenu (a program launcher) +# bindsym $mod+d exec dmenu_run +# There also is the (new) i3-dmenu-desktop which only displays applications +# shipping a .desktop file. It is a wrapper around dmenu, so you need that +# installed. +# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop + +# change focus +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right + +# alternatively, you can use the cursor keys: +# bindsym $mod+Left focus left +# bindsym $mod+Down focus down +# bindsym $mod+Up focus up +# bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# alternatively, you can use the cursor keys: +# bindsym $mod+Shift+Left move left +# bindsym $mod+Shift+Down move down +# bindsym $mod+Shift+Up move up +# bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+backslash split h + +# split in vertical orientation +bindsym $mod+minus split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+Control+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +assign [class="Discord"] $ws9 + +# Bind keys to switch to next workspace +bindsym $mod+n workspace next +bindsym $mod+p workspace prev +bindsym $mod+bracketleft workspace back_and_forth +# bindsym $mod+bracketright workspace back_and_forth + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +# bindsym $mod+Shift+e exec "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 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 h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l 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" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +# bar { +# status_command i3status +# } diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf new file mode 100644 index 0000000..3c8bd2c --- /dev/null +++ b/.config/picom/picom.conf @@ -0,0 +1,41 @@ +backend = "glx"; + +opacity-rule = [ ]; + + +corner-radius = 6.0; +rounded-corners-exclude = [ + # "widthb > 1365 && heightb > 736" # For smart gaps and a non-floating bar + # "class_g = 'Dunst'" +]; + + +# Add dual-kawase blur +blur-background = true; +blur-background-frame = true; +blur-background-fixed = true; +blur-kern = "3x3box"; +blur-method = "dual_kawase"; +blur-strength = 16; +blur-background-exclude = [ + "class_g = 'slop'", + "class_g = 'XAVA'", + "class_g = 'lattedock'", + "class_g = 'latte-dock'" +]; + + +shadow = true; +shadow-radius = 12; +shadow-opacity = 0.25; +shadow-offset-x = -7; +shadow-offset-y = -7; +shadow-exclude = [ + "class_g = 'XAVA'" +]; + + +fading = true; +fade-in-step = 0.16; +fade-out-step = 0.16; +fade-exclude = [ ]; diff --git a/.config/polybar/config b/.config/polybar/config new file mode 100644 index 0000000..061b066 --- /dev/null +++ b/.config/polybar/config @@ -0,0 +1,389 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== +; +; 並 全 侀 冀 勇 勺 喝 啕 喙 嗢 塚 墳 奄 奔 婢 嬨 廒 廙 彩 徭 惘 慎 愈 憎 慠 懲 戴 揄 搜 摒 敖 晴 朗 望 杖 歹 殺 流 滛 滋 漢 瀞 煮 瞧 爵 犯 猪 瑱 甆 画 瘝 瘟 益 盛 直 睊 着 磌 窱 節 类 絛 練 缾 者 荒 華 蝹 襁 覆 視 調 諸 請 謁 諾 諭 謹 變 贈 輸 遲 醙 鉶 陼 難 靖 韛 響 頋 頻 鬒 龜 𢡊 𢡄 𣏕 㮝 䀘 䀹 𥉉 𥳐 𧻓 齃 龎 +[colors] + background = #fa1e2137 + foreground = #e3eaf3 + primary = #02c084 + secondary = #65a2d9 + tertiary = #d07ef2 + fourth = #e5c246 + alert = #ed404c + +[colors-andromeda] + background = #282A3A + background-alt = #3a3e4e + foreground = #e1e3e4 + foreground-alt = #7e8294 + primary = #f0c362 + secondary = #bb97ee + alert = #fb617e + red = #fb617e + green = #9ed06c + yellow = #f0c362 + blue = #6dcae8 + magenta = #bb97ee + cyan = #f89860 + gray = #7e8294 + black = #181a1c + +[bar/main] + width = 100% + offset-x = 0 + offset-y = 0 + + height = 20 + radius = 0.0 + + override-redirect = true + wm-restack = i3 + + background = #1E222A + foreground = ${colors.foreground} + + padding-left = 1 + padding-right = 1 + module-margin-left = 1 + module-margin-right = 2 + + font-0 = Hack Nerd Font:pixelsize=11:antialias=true;2.5 + font-1 = Hack Nerd Font:style=Regular:pixelsize=17:antialias=true;3 + + modules-left = i3 cpu temperaturecpu memory + modules-center = xwindow + modules-right = audio backlight wlan wired-network battery date powermenu + + cursor-click = pointer + cursor-scroll = ns-resize + + tray-position = right + tray-padding = 0 +;tray-background = #0063ff + + +[module/xwindow] + type = internal/xwindow + label = %title% + + +[module/filesystem] + type = internal/fs + interval = 25111 + mount-0 = / + label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% + label-unmounted = %mountpoint% not mounted + label-unmounted-foreground = ${colors.foreground} + + +[module/i3] + type = internal/i3 + pin-workspaces = false + strip-wsnumbers = true + index-sort = true + enable-click = true + enable-scroll = true + wrapping-scroll = false + reverse-scroll = false + fuzzy-match = true +; bigger icons +; ws-icon-0 = "0;%{T2}%{T-}" +; ws-icon-1 = "1;%{T2}%{T-}" +; ws-icon-2 = "2;%{T2}%{T-}" +; ws-icon-3 = "3;%{T2}%{T-}" +; ws-icon-4 = "4;%{T2}4%{T-}" +; ﲵ + ws-icon-default = "" + ws-icon-0 = "0;" + ws-icon-1 = "1;" + ws-icon-2 = "2;" + ws-icon-3 = "3;" + ws-icon-4 = "4;4" + ws-icon-5 = "5;5" + ws-icon-6 = "6;6" + ws-icon-7 = "7;7" + ws-icon-8 = "8;8" + ws-icon-9 = "9;ﭮ" + + format = + label-mode = %mode% + label-mode-padding = 2 + label-mode-background = #e60053 + + label-focused = %icon% + label-focused-foreground = ${colors.fourth} + label-focused-background = #3a3e4e + label-focused-padding = 1 + + label-unfocused = ${self.label-focused} + label-unfocused-foreground = #0a7383 + label-unfocused-padding = ${self.label-focused-padding} + + label-visible = ${self.label-focused} + label-visible-foreground = #0a7383 + label-visible-padding = ${self.label-focused-padding} + + label-urgent = ${self.label-focused} + label-urgent-foreground = ${colors.alert} + label-urgent-padding = ${self.label-focused-padding} + + +[module/backlight] + type = internal/backlight + card = intel_backlight + + format =