1
Fork 0
mirror of https://github.com/wlinator/dotfiles.git synced 2024-10-02 17:03:13 +00:00

add laptop conf

This commit is contained in:
wlinator 2024-06-19 09:02:11 -04:00
parent 282f3c908e
commit 124276897f
11 changed files with 15805 additions and 0 deletions

105
.config/i3/config Normal file
View file

@ -0,0 +1,105 @@
# i3 config file (v4.22)
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"
set $mod Mod4
floating_modifier $mod
#font pango:Clear Sans 10
bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set +10%
bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 10%-
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $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
bindsym $mod+Return exec kitty
bindsym $mod+Shift+q kill
bindsym Print exec flameshot gui
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
bindsym $mod+f fullscreen toggle
bindsym $mod+w layout tabbed
bindsym $mod+s layout stacking
bindsym $mod+e layout toggle split
bindsym $mod+h split h
bindsym $mod+b split v
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+a focus parent
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
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
bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
bindsym $mod+l exec "i3lock -efi /usr/share/backgrounds/i3lock/cat-peek-adjusted.png"
# https://github.com/adi1090x/rofi - dmenu, powermenu & clipboard.
bindsym $mod+Shift+e exec --no-startup-id ~/.config/rofi/powermenu/type-1/powermenu.sh
bindsym $mod+d exec --no-startup-id ~/.config/rofi/launchers/type-4/launcher.sh
bindsym $mod+v exec --no-startup-id rofi -modi "clipboard:greenclip print" -show clipboard -theme ~/.config/rofi/launchers/type-1/style-4.rasi
exec --no-startup-id kitty --class "scratchpad"
exec --no-startup-id greenclip daemon>/dev/null
exec --no-startup-id nm-applet
#exec --no-startup-id /usr/bin/picom --config ~/.config/picom/picom.conf
exec_always --no-startup-id /usr/bin/lxpolkit
exec_always --no-startup-id "~/.config/polybar/launch.sh"
exec_always --no-startup-id "nitrogen --set-zoom-fill --random ~/.config/i3/img/"
exec_always --no-startup-id "setxkbmap -layout gb"
for_window [class="scratchpad"] , move scratchpad
for_window [class="(?i)Discord(?i)"] move container to workspace $ws3
for_window [class="Spotify"] move container to workspace $ws4
default_border pixel 0
######################
## UNCOMMENT TO USE ###
######################
#exec --no-startup-id nitrogen --set-auto /path/to/image.png.svg.jpg
#bindsym mod4+s [title="^Sup ::"] scratchpad show
#assign [class="Discord"] $ws3 #doesn't work
#bindsym $mod+d focus child
#exec_always --no-startup-id "brightnessctl set 5%"
#gaps inner 5px
#smart_gaps on
#tiling_drag modifier titlebar
#exec --no-startup-id kitty --class "btopboot" --session "~/.config/kitty/startup.conf"
#for_window [class="btopboot"] move container to workspace $ws5

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 KiB

181
.config/i3/scripts/powermenu Executable file
View file

@ -0,0 +1,181 @@
#!/usr/bin/env bash
#
# Use rofi/zenity to change system runstate thanks to systemd.
#
# Note: this currently relies on associative array support in the shell.
#
# Inspired from i3pystatus wiki:
# https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu
#
# Copyright 2015 Benjamin Chrétien <chretien at lirmm dot fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# modified to work with latest rofi update by joekamprad <joekamprad@endeavouros.com>
#######################################################################
# BEGIN CONFIG #
#######################################################################
# Use a custom lock script
#LOCKSCRIPT="i3lock-extra -m pixelize"
# Colors: FG (foreground), BG (background), HL (highlighted)
FG_COLOR="#bbbbbb"
BG_COLOR="#111111"
HLFG_COLOR="#111111"
HLBG_COLOR="#bbbbbb"
BORDER_COLOR="#222222"
# Options not related to colors (most rofi options do not work anymore)
ROFI_OPTIONS=(-theme ~/.config/rofi/powermenu.rasi)
# Zenity options
ZENITY_TITLE="Power Menu"
ZENITY_TEXT="Action:"
ZENITY_OPTIONS=(--column= --hide-header)
#######################################################################
# END CONFIG #
#######################################################################
# Whether to ask for user's confirmation
enable_confirmation=false
# Preferred launcher if both are available
preferred_launcher="rofi"
usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc.
where:
-h show this help text
-c ask for user confirmation
-p preferred launcher (rofi or zenity)
This script depends on:
- systemd,
- i3,
- rofi or zenity."
# Check whether the user-defined launcher is valid
launcher_list=(rofi zenity)
function check_launcher() {
if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then
echo "Supported launchers: ${launcher_list[*]}"
exit 1
else
# Get array with unique elements and preferred launcher first
# Note: uniq expects a sorted list, so we cannot use it
i=1
launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \
| sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' '))
fi
}
# Parse CLI arguments
while getopts "hcp:" option; do
case "${option}" in
h) echo "${usage}"
exit 0
;;
c) enable_confirmation=true
;;
p) preferred_launcher="${OPTARG}"
check_launcher "${preferred_launcher}"
;;
*) exit 1
;;
esac
done
# Check whether a command exists
function command_exists() {
command -v "$1" &> /dev/null 2>&1
}
# systemctl required
if ! command_exists systemctl ; then
exit 1
fi
# menu defined as an associative array
typeset -A menu
# Menu with keys/commands
menu=(
[ Shutdown]="systemctl poweroff"
[ Reboot]="systemctl reboot"
[ Suspend]="systemctl suspend"
[ Logout]="i3-msg exit"
)
menu_nrows=${#menu[@]}
# Menu entries that may trigger a confirmation message
menu_confirm="Shutdown Reboot Suspend Logout"
launcher_exe=""
launcher_options=""
rofi_colors=""
function prepare_launcher() {
if [[ "$1" == "rofi" ]]; then
rofi_colors=(-bc "${BORDER_COLOR}" -bg "${BG_COLOR}" -fg "${FG_COLOR}" \
-hlfg "${HLFG_COLOR}" -hlbg "${HLBG_COLOR}")
launcher_exe="rofi"
launcher_options=(-dmenu -i -lines "${menu_nrows}" -p "${ROFI_TEXT}" \
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
elif [[ "$1" == "zenity" ]]; then
launcher_exe="zenity"
launcher_options=(--list --title="${ZENITY_TITLE}" --text="${ZENITY_TEXT}" \
"${ZENITY_OPTIONS[@]}")
fi
}
for l in "${launcher_list[@]}"; do
if command_exists "${l}" ; then
prepare_launcher "${l}"
break
fi
done
# No launcher available
if [[ -z "${launcher_exe}" ]]; then
exit 1
fi
launcher=(${launcher_exe} "${launcher_options[@]}")
selection="$(printf '%s\n' "${!menu[@]}" | sort | "${launcher[@]}")"
function ask_confirmation() {
if [ "${launcher_exe}" == "rofi" ]; then
confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \
"${rofi_colors}" "${ROFI_OPTIONS[@]}")
[ "${confirmed}" == "Yes" ] && confirmed=0
elif [ "${launcher_exe}" == "zenity" ]; then
zenity --question --text "Are you sure you want to ${selection,,}?"
confirmed=$?
fi
if [ "${confirmed}" == 0 ]; then
i3-msg -q "exec ${menu[${selection}]}"
fi
}
if [[ $? -eq 0 && ! -z ${selection} ]]; then
if [[ "${enable_confirmation}" = true && \
${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then
ask_confirmation
else
i3-msg -q "exec ${menu[${selection}]}"
fi
fi

0
.config/kitty/.conf Normal file
View file

83
.config/kitty/kitty.conf Normal file
View file

@ -0,0 +1,83 @@
font_size 11
enable_audio_bell no
foreground #d8dee9
background #1c1c1c
background_opacity 0.95
selection_foreground #1c1c1c
selection_background #5e81ac
# Cursor colors
cursor #5e81ac
cursor_text_color #1c1c1c
# URL underline color when hovering with mouse
url_color #5e81ac
# Kitty window border colors
active_border_color #ff8888
inactive_border_color #777777
bell_border_color #bf616a
# OS Window titlebar colors
wayland_titlebar_color system
macos_titlebar_color system
# Tab bar colors
active_tab_foreground #1c1c1c
active_tab_background #5e81ac
inactive_tab_foreground #d8dee9
inactive_tab_background #242424
tab_bar_background #1c1c1c
# Colors for marks (marked text in the terminal)
mark1_foreground #1c1c1c
mark1_background #ff8888
mark2_foreground #1c1c1c
mark2_background #5e81ac
mark3_foreground #1c1c1c
mark3_background #5e81ac
# The 16 terminal colors
# black
color0 #3b4252
color8 #434c5e
# red
color1 #bf616a
color9 #d08770
# green
color2 #a3be8c
color10 #b4c38f
# yellow
color3 #ebcb8b
color11 #e5c07b
# blue
color4 #5e81ac
color12 #81a1c1
# magenta
color5 #b48ead
color13 #be91a4
# cyan
color6 #88c0d0
color14 #8fbcbb
# white
color7 #e5e9f0
color15 #eceff4
# tab bar
tab_bar_min_tabs 1
tab_bar_edge bottom
tab_bar_style powerline
tab_powerline_style slanted
tab_title_template {title}{' :{}:'.format(num_windows) if num_windows > 1 else ''}

View file

@ -0,0 +1,5 @@
# startup.conf
new_tab btop
cd ~
launch /usr/bin/btop

17
.config/polybar/checkupdates.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
# this script exists because running 'checkupdates' in
# polybar directly will fail when ran on multiple monitors
# with the same interval.
# !!!
# you need 'pacman-contrib'
# !!!
cd ~/.config/polybar/
{ # try
checkupdates | wc -l >> updates_list.txt;
tail -1 updates_list.txt;
} || { # catch
tail -1 updates_list.txt;
}

219
.config/polybar/config.ini Normal file
View file

@ -0,0 +1,219 @@
[colors]
background = #ee1c1c1c
#background = #5B5C5E
background-alt = #242424
foreground = #e5e5e5
primary = #0a5a8d
secondary = #5bb5c5
alert = #ff8888
disabled = #777777
[bar/main]
monitor = ${env:MONITOR:}
width = 100%
height = 24pt
radius = 0
bottom = false
dpi = 96
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3pt
border-size = 0pt
border-color = #00000000
padding-left = 3
padding-right = 3
module-margin = 2
separator = |
separator-foreground = ${colors.disabled}
font-0 = DejaVu Sans:style=Condensed,Book;3
font-1 = Font Awesome 6 Free:pixelsize=12;2
font-2 = Font Awesome 6 Free Solid:pixelsize=12;2
font-3 = Font Awesome 6 Brands:pixelsize=12;2
modules-left = power xworkspaces kernelversion checkforupdates xwindow
modules-right = filesystem pulseaudio memory cpu battery wlan eth date
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
tray-position = left
tray-detached = false
; tray-offset-x = -300
; wm-restack = generic
; wm-restack = bspwm
wm-restack = i3
; override-redirect = true
[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:70:...%
[module/kernelversion]
type = custom/script
exec = { uname; echo " "; uname -r; } | tr -d '\n'
interval = 90
[module/checkforupdates]
type = custom/script
exec = sh ~/.config/polybar/checkupdates.sh
tail = true
label =  updates: %output:0:15:...%
label-fail = 'checkupdates' failed!! Package pacman-contrib?
interval = 90
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
#label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%
label-mounted =  %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.disabled}
[module/pulseaudio]
type = internal/pulseaudio
ramp-volume-0 =
ramp-volume-1 =
ramp-volume-2 =
#format-volume-prefix = "VOL "
format-volume-prefix-foreground = ${colors.primary}
format-volume = <ramp-volume> <label-volume>
label-volume = %percentage%%
label-muted =  muted
label-muted-foreground = ${colors.disabled}
[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%%
[module/battery]
type = internal/battery
format-prefix = "BAT0 "
format-prefix-foreground = ${colors.primary}
full-at = 100
low-at = 5
battery = BAT0
poll-interval = 1
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
ramp-capacity-4 =
animation-charging-0 =
animation-charging-1 =
animation-charging-2 =
animation-charging-3 =
animation-charging-4 =
; Framerate in milliseconds
animation-charging-framerate = 750
format-discharging = <ramp-capacity> <label-discharging>
format-charging = <animation-charging> <label-charging>
label-discharging = %percentage%% - %consumption% W
label-charging = %percentage%% +%consumption% W
label-low =  BATTERY LOW
label-full =  Fully charged
[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
#label-disconnected = ! %{F#F0C674}%ifname%%{F#707880} disconnected
label-disconnected =  disconnected !
[module/wlan]
inherit = network-base
interface-type = wireless
#label-connected =  %{F#F0C674}%ifname%%{F-} %essid% %local_ip%
label-connected =  %essid% %local_ip%
[module/eth]
inherit = network-base
interface-type = wired
label-connected =  %{F#F0C674}%ifname%%{F-} %local_ip%
label-disconnected =
[module/date]
type = internal/date
interval = 1
date =  %I:%M %p
date-alt =  %Y-%m-%d
label = %date%
#label-foreground = ${colors.primary}
[settings]
screenchange-reload = true
pseudo-transparency = true
; vim:ft=dosini
[module/power]
type=custom/text
content=""
click-left= exec ~/.config/rofi/powermenu/type-1/powermenu.sh

View file

@ -0,0 +1,199 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[colors]
background = #51087E
background-alt = #373B41
foreground = #ffffff
primary = #FFAC1C
secondary = #FFAC1C
alert = #A54242
disabled = #999999
[bar/main]
width = 100%
height = 24pt
radius = 10
; dpi = 96
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3pt
border-size = 5pt
border-color = #00000000
padding-left = 0
padding-right = 1
module-margin = 1
separator = •
separator-foreground = ${colors.disabled}
font-0 = monospace;2
modules-left = xworkspaces kernelversion checkforupdates
modules-right = filesystem pulseaudio memory cpu battery wlan eth date
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
; tray-position = right
; wm-restack = generic
; wm-restack = bspwm
; wm-restack = i3
; override-redirect = true
[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:40:...%
[module/kernelversion]
type = custom/script
exec = { uname; echo " "; uname -r; } | tr -d '\n'
interval = 90
[module/checkforupdates]
type = custom/script
exec = yay -Qu | wc -l | xargs
label = updates: %output:0:25:...%
label-fail = 'yay -Qu | wc | xargs' failed!!
interval = 25
[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>
label-volume = %percentage%%
label-muted = muted
label-muted-foreground = ${colors.disabled}
[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%%
[module/battery]
type = internal/battery
format-prefix = "BAT0 "
format-prefix-foreground = ${colors.primary}
full-at = 100
low-at = 5
battery = BAT0
poll-interval = 1
format-discharging = <label-discharging>
label-discharging = D %percentage%% - %consumption% W
label-charging = C %percentage%% - %time% t
label-low = BATTERY LOW
label-full = Fully charged
[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-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

15
.config/polybar/launch.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
# Terminate already running bar instances
killall -q polybar
# If all your bars have ipc enabled, you can also use
# polybar-msg cmd quit
# Launch Polybar, using default config location ~/.config/polybar/config.ini
# polybar main 2>&1 | tee -a /tmp/polybar.log & disown
for m in $(polybar --list-monitors | cut -d":" -f1); do
MONITOR=$m polybar --reload main &
done
echo "Polybar launched.. (~/.config/polybar/launch.sh)"

File diff suppressed because it is too large Load diff