dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 9c81d7674796a7724809ab7cec1e8e808bb21c9c
Author: emmett1 <emmett1.2miligrams@protonmail.com>
Date:   Thu, 17 Apr 2025 07:41:01 +0800

updated

Diffstat:
A.ashrc | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/backgrounds/gray-wallpapper.png | 0
A.config/backgrounds/peakpx.jpg | 0
A.config/backgrounds/trees_grass_fog_117045_1920x1080.jpg | 0
A.config/dunst/dunstrc | 256+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/foot/foot.ini | 25+++++++++++++++++++++++++
A.config/gtk-3.0/bookmarks | 2++
A.config/gtk-3.0/settings.ini | 14++++++++++++++
A.config/mako/config | 27+++++++++++++++++++++++++++
A.config/shfm/opener.sh | 20++++++++++++++++++++
A.config/sway/config | 213+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/sway/statusbar.sh | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/sway/swayfx | 13+++++++++++++
A.config/user-dirs.dirs | 15+++++++++++++++
A.profile | 20++++++++++++++++++++
Apull.sh | 8++++++++
Apush.sh | 11+++++++++++
17 files changed, 742 insertions(+), 0 deletions(-)

diff --git a/.ashrc b/.ashrc @@ -0,0 +1,54 @@ +# __ +# ___ ____ / / ________ +# _/ _ `(_-</ _ \/ __/ __/ +# (_)_,_/___/_//_/_/ \__/ +# + +export PATH=$PATH:~/bin +export SHFM_OPENER=~/.config/shfm/opener.sh +export PF_INFO="ascii title os host kernel uptime pkgs memory shell editor" +export LANG=en_US.UTF-8 + +alias sudo='doas' +alias bi='sudo apkg -i' +alias bu='sudo apkg -u' +alias ss='apkg -s' +alias ii='sudo apkg -I' +alias rff='sudo sync && sudo /sbin/reboot' +alias off='sudo sync && sudo /sbin/poweroff' +alias cpick='slurp -p | grim -g - - | magick - txt: | tail -n 1' + +oxo() { + [ "$1" ] || return 1 + [ -f "$1" ] || return 1 + curl -F"file=@$1" http://0x0.st +} + +gc() { + [ -f abuild ] || return + . ./abuild || { echo error; return; } + git add . || { echo error; return; } + if [ "$1" ]; then + git commit -m "$name: $*" + else + git commit -m "$name: updated to $version" + fi +} + +gs() { + git status . +} + +gp() { + git push +} + +gpp() { + git pull +} + +gd() { + git diff . +} + +pfetch diff --git a/.config/backgrounds/gray-wallpapper.png b/.config/backgrounds/gray-wallpapper.png Binary files differ. diff --git a/.config/backgrounds/peakpx.jpg b/.config/backgrounds/peakpx.jpg Binary files differ. diff --git a/.config/backgrounds/trees_grass_fog_117045_1920x1080.jpg b/.config/backgrounds/trees_grass_fog_117045_1920x1080.jpg Binary files differ. diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc @@ -0,0 +1,256 @@ +[global] +font = Tewi:9 + +# Allow a small subset of html markup: +# <b>bold</b> +# <i>italic</i> +# <s>strikethrough</s> +# <u>underline</u> +# +# For a complete reference see +# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>. +# If markup is not allowed, those tags will be stripped out of the +# message. +allow_markup = yes +plain_text = no + +# The format of the message. Possible variables are: +# %a appname +# %s summary +# %b body +# %i iconname (including its path) +# %I iconname (without its path) +# %p progress value if set ([ 0%] to [100%]) or nothing +# Markup is allowed +format = "%s</b>\n%b" + +# Sort messages by urgency. +sort = no + +# Show how many messages are currently hidden (because of geometry). +indicate_hidden = yes + +# Alignment of message text. +# Possible values are "left", "center" and "right". +alignment = center + +# The frequency with wich text that is longer than the notification +# window allows bounces back and forth. +# This option conflicts with "word_wrap". +# Set to 0 to disable. +bounce_freq = 0 + +# Show age of message if message is older than show_age_threshold +# seconds. +# Set to -1 to disable. +show_age_threshold = -1 + +# Split notifications into multiple lines if they don't fit into +# geometry. +word_wrap = yes + +# Ignore newlines '\n' in notifications. +ignore_newline = no + +# Hide duplicate's count and stack them +stack_duplicates = yes +hide_duplicates_count = yes + + +# The geometry of the window: +# [{width}]x{height}[+/-{x}+/-{y}] +# The geometry of the message window. +# The height is measured in number of notifications everything else +# in pixels. If the width is omitted but the height is given +# ("-geometry x2"), the message window expands over the whole screen +# (dmenu-like). If width is 0, the window expands to the longest +# message displayed. A positive x is measured from the left, a +# negative from the right side of the screen. Y is measured from +# the top and down respectevly. +# The width can be negative. In this case the actual width is the +# screen width minus the width defined in within the geometry option. +#geometry = "250x50-40+40" +geometry = "300x50-15+49" + +# Shrink window if it's smaller than the width. Will be ignored if +# width is 0. +shrink = no + +# The transparency of the window. Range: [0; 100]. +# This option will only work if a compositing windowmanager is +# present (e.g. xcompmgr, compiz, etc.). +transparency = 5 + +# Don't remove messages, if the user is idle (no mouse or keyboard input) +# for longer than idle_threshold seconds. +# Set to 0 to disable. +idle_threshold = 0 + +# Which monitor should the notifications be displayed on. +monitor = 0 + +# Display notification on focused monitor. Possible modes are: +# mouse: follow mouse pointer +# keyboard: follow window with keyboard focus +# none: don't follow anything +# +# "keyboard" needs a windowmanager that exports the +# _NET_ACTIVE_WINDOW property. +# This should be the case for almost all modern windowmanagers. +# +# If this option is set to mouse or keyboard, the monitor option +# will be ignored. +follow = none + +# Should a notification popped up from history be sticky or timeout +# as if it would normally do. +sticky_history = yes + +# Maximum amount of notifications kept in history +history_length = 15 + +# Display indicators for URLs (U) and actions (A). +show_indicators = no + +# The height of a single line. If the height is smaller than the +# font height, it will get raised to the font height. +# This adds empty space above and under the text. +line_height = 3 + +# Draw a line of "separatpr_height" pixel height between two +# notifications. +# Set to 0 to disable. +separator_height = 2 + +# Padding between text and separator. +padding = 6 + +# Horizontal padding. +horizontal_padding = 6 + +# Define a color for the separator. +# possible values are: +# * auto: dunst tries to find a color fitting to the background; +# * foreground: use the same color as the foreground; +# * frame: use the same color as the frame; +# * anything else will be interpreted as a X color. +separator_color = frame + +# Print a notification on startup. +# This is mainly for error detection, since dbus (re-)starts dunst +# automatically after a crash. +startup_notification = false + +# dmenu path. +dmenu = /usr/bin/dmenu -p dunst: + +# Browser for opening urls in context menu. +browser = /usr/bin/firefox -new-tab + +# Align icons left/right/off +icon_position = off +max_icon_size = 80 + +# Paths to default icons. +icon_folders = /usr/share/icons/Paper/16x16/mimetypes/:/usr/share/icons/Paper/48x48/status/:/usr/share/icons/Paper/16x16/devices/:/usr/share/icons/Paper/48x48/notifications/:/usr/share/icons/Paper/48x48/emblems/ + + +[frame] +width = 2 +color = "#8EC07C" + +[shortcuts] + +# Shortcuts are specified as [modifier+][modifier+]...key +# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2", +# "mod3" and "mod4" (windows-key). +# Xev might be helpful to find names for keys. + +# Close notification. +close = ctrl+space + +# Close all notifications. +close_all = ctrl+shift+space + +# Redisplay last message(s). +# On the US keyboard layout "grave" is normally above TAB and left +# of "1". +history = ctrl+grave + +# Context menu. +context = ctrl+shift+period + +[urgency_low] +# IMPORTANT: colors have to be defined in quotation marks. +# Otherwise the "#" and following would be interpreted as a comment. +frame_color = "#141c21" +foreground = "#93a1a1" +background = "#141c21" +timeout = 4 + +[urgency_normal] +frame_color = "#141c21" +foreground = "#93a1a1" +background = "#141c21" +timeout = 6 + +[urgency_critical] +frame_color = "#141c21" +foreground = "#93a1a1" +background = "#141c21" +timeout = 8 + + +# Every section that isn't one of the above is interpreted as a rules to +# override settings for certain messages. +# Messages can be matched by "appname", "summary", "body", "icon", "category", +# "msg_urgency" and you can override the "timeout", "urgency", "foreground", +# "background", "new_icon" and "format". +# Shell-like globbing will get expanded. +# +# SCRIPTING +# You can specify a script that gets run when the rule matches by +# setting the "script" option. +# The script will be called as follows: +# script appname summary body icon urgency +# where urgency can be "LOW", "NORMAL" or "CRITICAL". +# +# NOTE: if you don't want a notification to be displayed, set the format +# to "". +# NOTE: It might be helpful to run dunst -print in a terminal in order +# to find fitting options for rules. + +#[espeak] +# summary = "*" +# script = dunst_espeak.sh + +#[script-test] +# summary = "*script*" +# script = dunst_test.sh + +#[ignore] +# # This notification will not be displayed +# summary = "foobar" +# format = "" + +#[signed_on] +# appname = Pidgin +# summary = "*signed on*" +# urgency = low +# +#[signed_off] +# appname = Pidgin +# summary = *signed off* +# urgency = low +# +#[says] +# appname = Pidgin +# summary = *says* +# urgency = critical +# +#[twitter] +# appname = Pidgin +# summary = *twitter.com* +# urgency = normal +# +# vim: ft=cfg diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini @@ -0,0 +1,25 @@ +font=Monospace:size=8 +pad=35x35 +initial-window-size-chars=90x28 + +[colors] +#alpha=0.7 +background=141c21 +foreground=93a1a1 +regular0=263640 # black +regular1=d12f2c # red +regular2=819400 # green +regular3=b08500 # yellow +regular4=2587cc # blue +regular5=696ebf # magenta +regular6=289c93 # cyan +regular7=bfbaac # white +bright0=4a697d # bright black +bright1=fa3935 # bright red +bright2=a4bd00 # bright green +bright3=d9a400 # bright yellow +bright4=2ca2f5 # bright blue +bright5=8086e8 # bright magenta +bright6=33c5ba # bright cyan +bright7=fdf6e3 # bright white + diff --git a/.config/gtk-3.0/bookmarks b/.config/gtk-3.0/bookmarks @@ -0,0 +1,2 @@ +file:///run/media media +file:///mnt/data data diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini @@ -0,0 +1,14 @@ +[Settings] +gtk-theme-name=Default +gtk-icon-theme-name=hicolor +gtk-font-name=Monospace 9 +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=0 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintmedium diff --git a/.config/mako/config b/.config/mako/config @@ -0,0 +1,27 @@ +sort=-time +layer=overlay +background-color=#141c21 +width=300 +height=110 +border-size=2 +border-color=#93a1a1 +#border-radius=15 +icons=0 +max-icon-size=64 +default-timeout=5000 +ignore-timeout=1 +font=monospace 8 + +[urgency=low] +border-color=#93a1a1 + +[urgency=normal] +border-color=#93a1a1 + +[urgency=high] +border-color=#bf616a +default-timeout=0 + +[category=mpd] +default-timeout=2000 +group-by=category diff --git a/.config/shfm/opener.sh b/.config/shfm/opener.sh @@ -0,0 +1,20 @@ +#!/bin/sh -e +# +# open file in application based on file extension + +case $(file -bi "$1") in + audio/*) + exec foot -e 'mpv --no-video "$1"';; + video/*) + mpv "$1";; + image/*) + imv "$1";; + text/html*) + librewolf "$1";; + text/*) + "${EDITOR:=vi}" "$1";; + *) + echo "unknown file type: $(file -bi $1)" + read _ + ;; +esac diff --git a/.config/sway/config b/.config/sway/config @@ -0,0 +1,213 @@ +# _____ _ _ _ _____ __ __ +# | __| | | | _ | | | +# |__ | | | | |_ _| +# |_____|_____|__|__| |_| +# +# sway config - by emmett1 +# + +set $mod Mod1 +set $super Mod4 +set $left h +set $down j +set $up k +set $right l +set $term footclient +set $web librewolf + +# --- colours --- +set $colour1 #141c21 +set $colour2 #93a1a1 +set $colour3 #808080 +set $alpha ff + +# --- font --- +set $font pango:Monospace 8 + +# --- config --- +default_border none +client.focused $colour1 $colour1 $colour1 $colour1 $colour1 +gaps inner 10 +floating_modifier $mod normal + +# --- startup --- +exec { + foot -s + dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus + swaybg -c 353535 + + # turn off screen when idle + swayidle -w \ + timeout 900 'swaymsg "output * power off"' \ + resume 'swaymsg "output * power on"' +} + +# --- touchpad --- +input "type:touchpad" { + dwt enabled + dwtp enabled + tap enabled + tap_button_map lrm + natural_scroll enabled +} + +# --- keybindings --- +bindsym { + # tiling foot + $mod+Return exec $term + + # floating foot + $mod+Shift+Return exec $term -a 'floatingfoot' + + # other programs shortcut + $mod+w exec $web + $mod+e exec geany + + # floating terms programs + $mod+a exec $term -a 'filemanager' shfm + $super+v exec $term -a 'floatingfoot' alsamixer + $super+h exec $term -a 'floatingfoot' htop + + $mod+control+Right workspace next + $mod+control+Left workspace prev + + # alsa + XF86AudioRaiseVolume exec amixer -Mq set Speaker 5%+ + XF86AudioLowerVolume exec amixer -Mq set Speaker 5%- + + # screenshot + $mod+shift+s exec GRIM_DEFAULT_DIR=~/pictures grim -t jpeg -q 100 + + # Kill focused window + $mod+Shift+c kill + + # Start your launcher + $mod+p exec wmenu-run -f 'monospace 8' -N 141c21 -S 141c21 -s 819400 + + # Reload the configuration file + $mod+Shift+r reload + + # Exit sway (logs you out of your Wayland session) + $mod+Shift+q exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' + + # switch workspace back and forth + $mod+tab workspace back_and_forth + + # Move your focus around + $mod+$left focus left + $mod+$down focus down + $mod+$up focus up + $mod+$right focus right + # Or use $mod+[up|down|left|right] + $mod+Left focus left + $mod+Down focus down + $mod+Up focus up + $mod+Right focus right + + # Move the focused window with the same, but add Shift + $mod+Shift+$left move left + $mod+Shift+$down move down + $mod+Shift+$up move up + $mod+Shift+$right move right + # Ditto, with arrow keys + $mod+Shift+Left move left + $mod+Shift+Down move down + $mod+Shift+Up move up + $mod+Shift+Right move right + + # Switch to workspace + $mod+1 workspace 1 + $mod+2 workspace 2 + $mod+3 workspace 3 + $mod+4 workspace 4 + $mod+5 workspace 5 + $mod+6 workspace 6 + $mod+7 workspace 7 + $mod+8 workspace 8 + $mod+9 workspace 9 + # Move focused container to workspace + $mod+Shift+1 move container to workspace 1 + $mod+Shift+2 move container to workspace 2 + $mod+Shift+3 move container to workspace 3 + $mod+Shift+4 move container to workspace 4 + $mod+Shift+5 move container to workspace 5 + $mod+Shift+6 move container to workspace 6 + $mod+Shift+7 move container to workspace 7 + $mod+Shift+8 move container to workspace 8 + $mod+Shift+9 move container to workspace 9 + + # container split + $mod+b splith + $mod+v splitv + + # Make the current focus fullscreen + $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + $mod+space focus mode_toggle +} + +# --- floating windows --- +# swaymsg -t get_tree | grep "app_id" +for_window { + [app_id="floatingfoot"] floating enable + [app_id="alsamixer"] floating enable + [app_id="mpv"] floating enable + [app_id="imv"] floating enable + [app_id="qemu"] floating enable + [app_id="gcolor3"] floating enable + [title = "About Mozilla Firefox"] floating enable + [app_id="firefox" title="Library"] floating enable, border pixel 1, sticky enable + [title = "About LibreWolf"] floating enable + [app_id="librewolf" title="Library"] floating enable, border pixel 1, sticky enable +} + +# --- assign workspace --- +assign { + [app_id="firefox"] 2 + [app_id="librewolf"] 2 + [app_id="filemanager"] 3 + [app_id="geany"] 4 +} + +# --- resizing container --- +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +# --- statusbar --- +bar { + position top + font $font + + status_command while sh $HOME/.config/sway/statusbar.sh; do sleep 1; done + + colors { + statusline $colour2 + background $colour1$alpha + # border background text + focused_workspace $colour1$alpha $colour1$alpha $colour2 + inactive_workspace $colour1$alpha $colour1$alpha $colour3 + } +} diff --git a/.config/sway/statusbar.sh b/.config/sway/statusbar.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +_print() { + title=$1; shift + echo -n "$title ${@}${sep}" +} + +_need() { + case $1 in + */*) [ -e $1 ] || return 1;; + *) command -v $1 >/dev/null 2>&1 || return 1;; + esac +} + +_playerctl() { + _need playerctl || return 0 + msg=$(playerctl metadata --format '{{ artist }} - {{ title }}' 2>/dev/null) || \ + msg=Stopped + _print MUSIC $msg +} + +_net() { + _need ping || return 0 + ping -c 1 8.8.8.8 >/dev/null 2>&1 && msg=Online || msg=Offline + _print NET $msg +} + +_vol() { + _need amixer || return 0 + msg=$(amixer get Master | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p'| uniq) + [ "$(amixer get Master | grep Mono: | awk '{print $6}')" = '[off]' ] && msg=X + _print VOL $msg +} + +_bat() { + [ -d /sys/class/power_supply/BAT0 ] && _bat=0 + [ -d /sys/class/power_supply/BAT1 ] && _bat=1 + [ "$_bat" ] || return 0 + capacity=$(cat /sys/class/power_supply/BAT${_bat}/capacity) + status=$(cat /sys/class/power_supply/BAT${_bat}/status) + msg="$([ "$status" = Charging ] && echo +)$capacity" + _print BAT $msg +} + +_ram() { + used=$(free -m | awk '/Mem:/ { print $3"M" }') + total=$(free -m | awk '/Mem:/ { print $2"M" }') + msg="$used/$total" + _print RAM $msg +} + +_temp() { + _need sensors || return 0 + msg=$(sensors | grep "Package id" | awk '{print $4}' | sed 's/+//') + _print TEMP $msg +} + +_clock() { + date "+%a %d %b %I:%M:%S" +} + +sep=' | ' + +echo "$(_playerctl)$(_net)$(_temp)$(_ram)$(_bat)$(_vol)$(_clock)" diff --git a/.config/sway/swayfx b/.config/sway/swayfx @@ -0,0 +1,13 @@ +# config for swayfx + +blur enable +blur_radius 2 +blur_xray enable +shadows enable +corner_radius 5 + +# swaybar +layer_effects "panel" corner_radius 5 +layer_effects "panel" blur enable +layer_effects "panel" blur_radius 2 +layer_effects "panel" shadows enable diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs @@ -0,0 +1,15 @@ +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run. +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. +# +XDG_DESKTOP_DIR="$HOME/desktop" +XDG_DOWNLOAD_DIR="$HOME/downloads" +XDG_TEMPLATES_DIR="$HOME/templates" +XDG_PUBLICSHARE_DIR="$HOME/public" +XDG_DOCUMENTS_DIR="$HOME/documents" +XDG_MUSIC_DIR="$HOME/music" +XDG_PICTURES_DIR="$HOME/pictures" +XDG_VIDEOS_DIR="$HOME/videos" diff --git a/.profile b/.profile @@ -0,0 +1,20 @@ +# ____ __ +# ___ _______ / _(_) /__ +# _ / _ \/ __/ _ \/ _/ / / -_) +# (_) .__/_/ \___/_//_/_/\__/ +# /_/ +# + +export ENV=~/.ashrc +export PATH=$PATH:~/bin +export SHFM_OPENER=~/.config/shfm/opener.sh +export PF_INFO="ascii title os host kernel uptime pkgs memory shell editor" + +if [ ! "$XDG_RUNTIME_DIR" ]; then + export XDG_RUNTIME_DIR="/tmp/$(id -u)-runtime-dir" + mkdir -pm 0700 "$XDG_RUNTIME_DIR" +fi + +if [ ! "$WAYLAND_DISPLAY" ] && [ "$(tty)" = /dev/tty1 ]; then + exec sway +fi diff --git a/pull.sh b/pull.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +for f in $(find . -path "./.git" -prune -o -type f -print); do + f=${f#*/} + case $f in */pull.sh|*/push.sh) continue;; esac + [ -f $HOME/$f ] || continue + cp -v $HOME/$f ${f%/*} +done diff --git a/push.sh b/push.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +for f in $(find . -path "./.git" -prune -o -type f -print); do + f=${f#*/} + case $f in + pull.sh|push.sh) continue;; + */*) mkdir -pv $HOME/${f%/*} + cp -v $f $HOME/${f%/*};; + *) cp -v $f $HOME + esac +done