From 57f32cb47a4abdf5b614f1eb9d2c64260249a0eb Mon Sep 17 00:00:00 2001 From: Fabiamln Becker Date: Wed, 27 Jul 2022 15:35:16 +0200 Subject: [PATCH] Update i3 config / migrate to sway --- .config/i3/config | 66 ++++++++++++------------------------- .config/i3/config.d/outputs | 5 +++ .config/i3/status.sh | 14 ++++++++ 3 files changed, 40 insertions(+), 45 deletions(-) create mode 100644 .config/i3/config.d/outputs create mode 100755 .config/i3/status.sh diff --git a/.config/i3/config b/.config/i3/config index 2a179e9..fb5db83 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -1,26 +1,16 @@ -# 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 http://i3wm.org/docs/userguide.html for a complete reference! +######################### +# Run services +######################### +exec waybar 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 +font pango:monospace 14 -# GET DEM BORDERS OUT OF HEREc:w -# -# Thanks Childz -for_window [class="^.*"] border pixel 2 - # class border backgr. text indicator child_border -for_window [class="^.*"] client.focused #77dd77 #285577 #ffffff #2e9ef4 #285577 +# Remove all borders from applications +default_border none # This font is widely installed, provides lots of unicode glyphs, right-to-left # text rendering and scalability on retina/hidpi displays (thanks to pango). @@ -38,7 +28,7 @@ floating_modifier $mod # start a terminal # bindsym $mod+Return exec i3-sensible-terminal -bindsym $mod+Return exec alacritty +bindsym $mod+Return exec xterm # kill focused window # bindsym $mod+space exec "/home/theprimeagen/dotfiles/awesome-streamerrc/ThePrimeagen/tmux2" @@ -46,7 +36,8 @@ bindsym $mod+Return exec alacritty bindsym $mod+Shift+q kill # start dmenu (a program launcher) -bindsym $mod+d exec --no-startup-id i3-dmenu-desktop +# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop +bindsym $mod+d exec --no-startup-id wofi --show run --gtk-dark # 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 @@ -159,35 +150,20 @@ bindsym $mod+r mode "resize" # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) +set $status_script ~/.config/sway/status.sh + bar { - status_command i3status - tray_output primary + status_command while $status_script; do sleep 1; done + position top + colors { + statusline #ffffff + + background #323232 + } + font pango:DejaVu Sans Mono 14 } -# ------------------------------------------ -# CUSTOM KEYS START -# ------------------------------------------ -exec --no-startup-id nm-applet - -bindsym $mod+Shift+s exec --no-startup-id ~/dotfiles/bin/monitor -bindsym $mod+Shift+n exec --no-startup-id ~/dotfiles/bin/resolution - -# FKeys -# Pulse Audio controls -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume -bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound -# -# # Sreen brightness controls -bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness -bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness - -# Alsa audio controls. -bindsym $mod+Shift+comma exec ~/.config/i3/scripts/alsa restore -bindsym $mod+semicolon exec ~/.config/i3/scripts/alsa down Headphone -bindsym $mod+comma exec ~/.config/i3/scripts/alsa up Headphone -bindsym $mod+m move workspace to output left - # Suspend bindsym $mod+Shift+period exec systemctl suspend +include ~/.config/sway/config.d/* diff --git a/.config/i3/config.d/outputs b/.config/i3/config.d/outputs new file mode 100644 index 0000000..fc5a270 --- /dev/null +++ b/.config/i3/config.d/outputs @@ -0,0 +1,5 @@ +# Devices +set $display_tv 'Technical Concepts Ltd TCL SMART TV 0x00001111' + +# Resolution +output $display_tv mode 1920x1080@30Hz diff --git a/.config/i3/status.sh b/.config/i3/status.sh new file mode 100755 index 0000000..4b7d737 --- /dev/null +++ b/.config/i3/status.sh @@ -0,0 +1,14 @@ +# The Sway configuration file in ~/.config/sway/config calls this script. +# You should see changes to the status bar after saving this script. If +# not, do "killall swaybar" and $mod+Shift+c to reload the configuration. +# Produces "21 days", for example +uptime_formatted=$(uptime | cut -d ',' -f1 | cut -d ' ' -f4,5) +# The abbreviated weekday (e.g., "Sat"), followed by the ISO-formatted date +# like 2018-10-06 and the time (e.g., 14:01) +date_formatted=$(date "+%a %F %H:%M") +# Get the Linux version but remove the "-1-ARCH" part +linux_version=$(uname -r | cut -d '-' -f1) +# Returns the battery status: "Full", "Discharging", or "Charging". +# battery_status=$(cat /sys/class/power_supply/BAT0/status) +# Emojis and characters for the status bar 💎 💻 💡 🔌 ⚡ 📁 \| +echo $uptime_formatted ↑ $linux_version