diff options
author | Justine Smithies <justine@smithies.me.uk> | 2024-11-08 20:48:58 +0000 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2024-11-08 20:48:58 +0000 |
commit | c2fbc4d1717864a0055592e0b73d71c010e8686c (patch) | |
tree | 76e5bf50cc0f9c1b83f474740a8015d7f4e0ef26 /.config | |
parent | b9d24b3b6bdaed04fab07d9150c51d4f0f7a5c7d (diff) |
Initial commit
Diffstat (limited to '.config')
37 files changed, 2635 insertions, 0 deletions
diff --git a/.config/bat/config b/.config/bat/config new file mode 100755 index 0000000..bc2ec99 --- /dev/null +++ b/.config/bat/config @@ -0,0 +1,32 @@ +# This is `bat`s configuration file. Each line either contains a comment or +# a command-line option that you want to pass to `bat` by default. You can +# run `bat --help` to get a list of all possible configuration options. + +# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes` +# for a list of all available themes +#--theme="TwoDark" +--theme="gruvbox-dark" + +# Enable this to use italic text on the terminal. This is not supported on all +# terminal emulators (like tmux, by default): +#--italic-text=always + +# Uncomment the following line to disable automatic paging: +--paging=never + +# Uncomment the following line if you are using less version >= 551 and want to +# enable mouse scrolling support in `bat` when running inside tmux. This might +# disable text selection, unless you press shift. +#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse" + +# Syntax mappings: map a certain filename pattern to a language. +# Example 1: use the C++ syntax for .ino files +# Example 2: Use ".gitignore"-style highlighting for ".ignore" files +#--map-syntax "*.ino:C++" +#--map-syntax ".ignore:Git Ignore" + +# Force colorization +# --force-colorization + +# Show line numbers, Git modifications and file header (but no grid) +--style="plain" diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss new file mode 100644 index 0000000..d3cba0b --- /dev/null +++ b/.config/eww/eww.scss @@ -0,0 +1,107 @@ +* { + all: unset; //Unsets everything so you can style everything from scratch +} + +//Global Styles +.bar0, .bar1 { + background-color: rgba(0, 0, 0, 0); + color: #ffffff; + font-family: GoMono Nerd Font; + font-size: 12px; +} + +.bar { + background-color: rgba(0, 0, 0, 0.7); + // box-shadow: 2px 4px 2px 1px rgba(0, 0, 0, 0.5); + margin: 2px 10px 0px 10px; + border-radius: 0px; +} + +// Styles on classes (see eww.yuck for more information) + +.sidestuff { + color: #ffffff; +} + +.audio { + color: #ffffff; + padding-right: 10px; +} + +.brightness { + color: #ffffff; + padding-right: 10px; +} + +.net { + color: #ffffff; + padding-right: 10px; +} + +.apk { + color: #98971a; + padding-right: 10px; +} + +.apk-empty { + color: #98971a; + padding-right: 0px; +} + +.scratchpad { + color: #ffd5cd; + padding-right: 10px; +} + +.scratchpad-empty { + color: #ffd5cd; + padding-right: 0px; +} + +.clock { + color: #ffffff; +} + +.idle { + color: #ffffff; + padding-right: 10px; +} + +.language { + color: #ffd5cd; + padding-right: 10px; +} + +.battery { + color: #ffffff; + padding-right: 10px; +} + +.w0, .w01, .w02, .w03, .w04, .w05, .w06, .w07, .w08, .w09, .w011, .w022, .w033, .w044, .w055, .w066, .w077, .w088, .w099 { + padding: 3px 10px; + box-shadow: inset 0 -2px transparent; +} + +/* Unoccupied */ +.w0 { + color: #a89984; +} + +/* Occupied */ +.w01, .w02, .w03, .w04, .w05, .w06, .w07, .w08, .w09 { + color: #fbf1c7; +} + +/* Focused */ +.w011, .w022, .w033, .w044, .w055, .w066, .w077, .w088, .w099 { + color: #fbf1c7; + box-shadow: inset 0 -3px #98971a; +} + +.workspace { +padding: 0 10px; +} + +.workspace button:hover { + box-shadow: inset 0 -3px #ffffff; +} diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck new file mode 100644 index 0000000..4db3241 --- /dev/null +++ b/.config/eww/eww.yuck @@ -0,0 +1,192 @@ +(defwidget bar0 [] +(box :class "bar" + (centerbox :orientation "h" + (workspaces0) + (clock) + (sidestuff))) +) + +(defwidget bar1 [] +(box :class "bar" + (centerbox :orientation "h" + (workspaces1) + (clock) + (sidestuff))) +) + +(defwidget sidestuff [] + (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end" + (updates) + (language) + (idleinhibit) + (bright) + (audio) + (net) + (battery) + )) + +(deflisten workspace0 + "scripts/workspace.sh 0") + +(defwidget workspaces0 [] + (literal :content workspace0)) + +(deflisten workspace1 + "scripts/workspace.sh 1") + +(defwidget workspaces1 [] + (literal :content workspace1)) + +(defwidget language [] + (box :class "language" + :orientation "h" + :space-evenly false + :halign "end" + :spacing 10 + (button + :class "" + :onclick "scripts/keyboardlayout.sh toggle" + language) +)) + +(defwidget clock [] + (box :class "clock" + :orientation "h" + :space-evenly false + :halign "center" + (button + :class "" + :onclick "scripts/calendar.sh show" + date-time) + (label :unindent false :text " - ") + (label :text time_poll) +)) + +(defwidget audio [] + (box :class "audio" + :orientation "h" + :space-evenly false + :halign "end" + :spacing 10 + (button + :class "" + :onclick "scripts/volumecontrol down" + :onmiddleclick "scripts/volumecontrol mute" + :onrightclick "scripts/volumecontrol up" + volume) +)) + +(defwidget bright [] + (box :class "brightness" + :orientation "h" + :space-evenly false + :halign "end" + :spacing 10 + (button + :class "" + :onclick "scripts/brightnesscontrol down" + :onrightclick "scripts/brightnesscontrol up" + brightness) +)) + +(defwidget updates [] + (box + :class "${matches(chimera-updates, '^\s*$')?'apk-empty':'apk'}" + :orientation "h" + :space-evenly false + :halign "end" + :spacing 10 + (button + :class "" + :onclick "foot bash -c 'doas apk upgrade; ~/.config/eww/scripts/chimera-updates.sh Refresh'&" + chimera-updates) +)) + +(defwidget idleinhibit [] + (box :class "idle" + :orientation "h" + :space-evenly false + :halign "end" + :spacing 10 + (button + :class "" + :onclick "scripts/idleinhibit.sh toggle" + idle) +)) + +(defwidget net [] + (box :class "net" + :orientation "h" + :space-evenly false + :halign "end" + :spacing 10 + (button + :class "" + :timeout 500 + :onclick "scripts/network.sh ShowInfo" + network) +)) + +(defwidget battery [] + (box :class "battery" + :orientation "h" + :space-evenly false + :halign "end" + :spacing 10 + (button + :class "" + :onclick "scripts/battery.sh left-click" + battery) +)) + +(defpoll time_poll :interval "1s" "date +%H:%M") + +(defpoll battery :interval "10s" + "scripts/battery.sh") + +(defpoll language :interval "1s" + "scripts/keyboardlayout.sh") + +(defpoll network :interval "1s" + "scripts/network.sh") + +(defpoll idle :interval "1s" + "scripts/idleinhibit.sh") + +(defpoll chimera-updates :interval "600s" + "scripts/chimera-updates.sh") + +(defpoll volume :interval "1s" + "scripts/volumecontrol") + +(defpoll brightness :interval "1s" + "scripts/brightnesscontrol") + +(defpoll date-time :interval "1s" + "scripts/date-time.sh") + +(defwindow bar0 + :monitor 0 + :windowtype "dock" + :geometry (geometry :x "0%" + :y "5px" + :width "100%" + :height "20px" + :anchor "top center") + :stacking "fg" + :exclusive true + :focusable false + (bar0)) + +(defwindow bar1 + :monitor 1 + :windowtype "dock" + :geometry (geometry :x "0%" + :y "5px" + :width "100%" + :height "20px" + :anchor "top center") + :stacking "fg" + :exclusive true + :focusable false + (bar1)) diff --git a/.config/eww/scripts/arch-updates.sh b/.config/eww/scripts/arch-updates.sh new file mode 100755 index 0000000..e3da71f --- /dev/null +++ b/.config/eww/scripts/arch-updates.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +function CheckUpdates() { +xbps-install -Mun 1> /tmp/void-updates +updates="$(cat /tmp/void-updates | awk '{ print $1 }')" +number=$(cat /tmp/void-updates | wc -l) + +if [ "$number" -gt 0 ]; then + text=" $number" +else + text="" +fi + +echo "$text" +} + +function RefreshUpdates() { + value="$(CheckUpdates)" + eww update arch-updates="$value" +} + +function Update() { + foot bash -c 'sudo xbps-install -Suv' + RefreshUpdates +} + +case "$1" in + Refresh) + RefreshUpdates + exit 0 + ;; + Update) + Update + exit 0 + ;; + *) + CheckUpdates + exit 0 +esac diff --git a/.config/eww/scripts/bar-toggle.sh b/.config/eww/scripts/bar-toggle.sh new file mode 100755 index 0000000..78d0050 --- /dev/null +++ b/.config/eww/scripts/bar-toggle.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +monitors=$(river-bedload -print outputs | jq -r -c '.[] | .name' | wc -l | xargs) + +for ((i = 0 ; i < $monitors ; i++)); do + echo $i + active_monitor=$(river-bedload -print outputs | jq 'map(.focused)|to_entries|.[]|select(.value)|.key') + # Flip value e.g 0 to 1 + if [ "$monitors" != "1" ]; then + ((active_monitor ^= 1)) + fi + bar=$(eww active-windows | grep "bar$i") + if [ "$active_monitor" == "$i" ] && [ "$bar" == "bar$i: bar$i" ]; then + eww close bar$i + elif [ "$active_monitor" == "$i" ]; then + eww open bar$i + fi +done + diff --git a/.config/eww/scripts/battery.sh b/.config/eww/scripts/battery.sh new file mode 100755 index 0000000..a984346 --- /dev/null +++ b/.config/eww/scripts/battery.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +# Send a notification if battery is low, change status in info file accordingly +notify_low () { + + # Battery isn't much but is charging (don't notify) + [ "$status" = "on-line" ] && return + + # Battery critically low + if [ "$capacity" -le 10 ] && ! grep -q critically-low "$lowinfo"; then + notify-send -i "$HOME/.config/icons/critical-battery.png" -u critical "Battery critically low!" + echo critically-low >"$lowinfo" + + # Battery is low + elif [ "$capacity" -le 20 ] && ! grep -q low "$lowinfo"; then + notify-send -i "$HOME/.config/icons/low-battery.png" -t 5500 "Battery low!" + echo low >"$lowinfo" + fi +} + +status="$(apm | grep -E "AC Line status:" | sed -n -e 's/^.*AC Line status: //p')" +capacity="$(apm | grep -E "Remaining battery life:" | head -1 | sed -n -e 's/^.*Remaining battery life: //p' | sed 's/.$//')" + +# Get the low battery status from file ~/.cache/battery-low-status +lowinfo="$HOME/.cache/battery-low-status" +[ ! -e "$lowinfo" ] && touch "$lowinfo" + + +case $1 in + left-click) + ;; + *) + # Set charging icon and capacity icon + [ "$status" = "on-line" ] && charging_icon=" " || charging_icon="" + [ "$capacity" -gt 100 ] && capacity=100 + if [ "$capacity" -lt 15 ]; then capacity_icon=' ' + elif [ "$capacity" -lt 40 ]; then capacity_icon=' ' + elif [ "$capacity" -lt 60 ]; then capacity_icon=' ' + elif [ "$capacity" -lt 90 ]; then capacity_icon=' ' + else capacity_icon=' ' + fi + + # Report low battery + [ "$capacity" -le 20 ] && notify_low + + # Reset low battery information in these cases + { [ "$capacity" -gt 20 ] || [ "$status" = "Charging" ]; } && [ -n "$(cat "$lowinfo")" ] && echo "" >"$lowinfo" + + printf "%s%s%d%%\n" "$charging_icon" "$capacity_icon" "$capacity" + ;; +esac + + diff --git a/.config/eww/scripts/brightnesscontrol b/.config/eww/scripts/brightnesscontrol new file mode 100755 index 0000000..1e8ea9f --- /dev/null +++ b/.config/eww/scripts/brightnesscontrol @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +# You can call this script like this: +# brightnessControl up +# brightnessControl down + +# Script inspired by these wonderful people: +# https://github.com/dastorm/volume-notification-dunst/blob/master/volume.sh +# https://gist.github.com/sebastiencs/5d7227f388d93374cebdf72e783fbd6a + +function send_notification { + icon="/usr/share/icons/Adwaita/symbolic/status/daytime-sunrise-symbolic.svg" + brightness=$(backlight -q) + # Make the bar with the special character ─ (it's not dash -) + # https://en.wikipedia.org/wiki/Box-drawing_character + bar=$(seq -s "─" 0 $((brightness / 10 )) | sed 's/[0-9]//g') + # Send the notification + fyi -i "$icon" --hint=string:x-canonical-private-synchronous:brightness -u normal "$bar $brightness" +} + +case $1 in + up) + backlight + 4 + backlight > ~/.cache/brightness + send_notification + # canberra-gtk-play -i audio-volume-change + ;; + down) + backlight - 4 + backlight > ~/.cache/brightness + send_notification + # canberra-gtk-play -i audio-volume-change + ;; + *) + brightness=$(backlight -q) + icon="" + printf "%s" "$icon $brightness" "%" + ;; +esac diff --git a/.config/eww/scripts/calendar.sh b/.config/eww/scripts/calendar.sh new file mode 100755 index 0000000..a9e3502 --- /dev/null +++ b/.config/eww/scripts/calendar.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# Calendar script + +function ShowCalendar() { + fyi -a "Calendar" --hint string:x-canonical-private-synchronous:calendar " 📅 Calendar" "$(cal | sed "s/\<$(date +%-d)\>/<span color='#fabd2f'><b>$(date +%-d)<\/b><\/span>/")" +} + +function EditCalendar() { + echo +} + +case "$1" in + show) + ShowCalendar + ;; + + edit) + EditCalendar + ;; + + *) + echo $"Usage: ${0##*/} {show|edit}" + exit 1 + +esac diff --git a/.config/eww/scripts/date-time.sh b/.config/eww/scripts/date-time.sh new file mode 100755 index 0000000..9835842 --- /dev/null +++ b/.config/eww/scripts/date-time.sh @@ -0,0 +1,12 @@ +#!/bin/sh +DaySuffix() { + case `date +%-d` in + 1|21|31) echo "st";; + 2|22) echo "nd";; + 3|23) echo "rd";; + *) echo "th";; + esac +} +date=$(date "+%A %-d`DaySuffix` %B %Y") +icon="" +printf "%s" "$date " diff --git a/.config/eww/scripts/idleinhibit.sh b/.config/eww/scripts/idleinhibit.sh new file mode 100755 index 0000000..f606ad5 --- /dev/null +++ b/.config/eww/scripts/idleinhibit.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Swayidle toggle +function toggle { + if pgrep "swayidle" > /dev/null + then + pkill swayidle + notify-send --hint=string:x-canonical-private-synchronous:idleinhibit -u normal " Swayidle Inactive" +else + read -r wallpaper<~/.cache/wallpaper + export wallpaper=$( echo $wallpaper) + swayidle -w \ + timeout 300 'swaylock -f -i $wallpaper' \ + timeout 600 'wlopm --off \*;swaylock -F -i $wallpaper' resume 'wlopm --on \*' \ + before-sleep 'swaylock -f -i $wallpaper' & + notify-send --hint=string:x-canonical-private-synchronous:idleinhibit -u normal " Swayidle Active" +fi +} + +case $1 in + toggle) + toggle + ;; + *) + if pgrep "swayidle" > /dev/null + then + icon="" + else + icon="" + fi + printf "%s" "$icon " + ;; +esac diff --git a/.config/eww/scripts/keyboardlayout.sh b/.config/eww/scripts/keyboardlayout.sh new file mode 100755 index 0000000..aa98833 --- /dev/null +++ b/.config/eww/scripts/keyboardlayout.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Get long name +# echo "$(hyprctl devices | grep -A 2 "at-translated-set-2-keyboard" | awk 'NR==3 {print $3" "$4}')" + +# Get short name +echo "$(hyprctl devices | grep -A 2 "at-translated-set-2-keyboard" | awk 'NR==3 {print $4}'| grep -Po '(?<=\().*(?=\))' )" + diff --git a/.config/eww/scripts/monitor.sh b/.config/eww/scripts/monitor.sh new file mode 100755 index 0000000..a211054 --- /dev/null +++ b/.config/eww/scripts/monitor.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +function handle { + if [[ ${1:0:12} == "monitoradded" ]]; then + ~/.config/eww/scripts/start.sh + elif [[ ${1:0:14} == "monitorremoved" ]]; then + ~/.config/eww/scripts/start.sh + fi +} + +socat - UNIX-CONNECT:/tmp/hypr/$(echo $HYPRLAND_INSTANCE_SIGNATURE)/.socket2.sock | while read line; do handle $line; done diff --git a/.config/eww/scripts/network.sh b/.config/eww/scripts/network.sh new file mode 100755 index 0000000..29396aa --- /dev/null +++ b/.config/eww/scripts/network.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# This script requires dnsutils aka bind to fetch the WAN IP address + +# Shows the connections names +# nmcli connection show --active | grep 'ethernet' | awk '{ print $1 }' FS=' ' +# nmcli connection show --active | grep 'wifi' | awk '{ print $1 }' FS=' ' + +# Show ethernet interface name +# nmcli connection show --active | grep 'ethernet' | awk '{ print $6 }' FS=' ' + +# Show wifi interface name +# nmcli connection show --active | grep 'wifi' | awk '{ print $4 }' FS=' ' + +function ShowInfo { + if [ "$(nmcli connection show --active | grep -oh "\w*ethernet\w*")" == "ethernet" ]; then + wan="$(dig @resolver4.opendns.com myip.opendns.com +short)" + connection="$(nmcli connection show --active | grep 'ethernet' | awk '{ print $6 }' FS=' '): $(nmcli connection show --active | grep 'ethernet' | awk '{ printf "%s\nLAN IP:",$1 }' FS=' ') $(nmcli -t -f IP4.ADDRESS dev show $(nmcli connection show --active | grep 'ethernet' | awk '{ print $6 }' FS=' ') | awk '{printf "%s\nWAN IP: '$wan'", $2}' FS='[:/]')" + elif [ "$(nmcli connection show --active | grep -oh "\w*wifi\w*")" == "wifi" ]; then + wan="$(dig @resolver4.opendns.com myip.opendns.com +short)" + connection="$(nmcli connection show --active | grep 'wifi' | awk '{ print $4 }' FS=' '): $(nmcli connection show --active | grep 'wifi' | awk '{ printf "%s\nLAN IP:",$1 }' FS=' ') $(nmcli -t -f IP4.ADDRESS dev show $(nmcli connection show --active | grep 'wifi' | awk '{ print $4 }' FS=' ') | awk '{printf "%s/nWAN IP: '$wan'", $2}' FS='[:/]')" + else + connection="No active connection." + fi + fyi -i "network-idle" --hint string:x-canonical-private-synchronous:network-status "$connection" +} + +function IconUpdate() { + if [ "$(nmcli connection show --active | grep -oh "\w*ethernet\w*")" == "ethernet" ]; then + icon="" + elif [ "$(nmcli connection show --active | grep -oh "\w*wifi\w*")" == "wifi" ]; then + icon="" + else + icon="" + fi + printf "%s" "$icon" +} + +if [ "$1" = "ShowInfo" ]; then + ShowInfo +else + IconUpdate +fi diff --git a/.config/eww/scripts/scratchpad-indicator.sh b/.config/eww/scripts/scratchpad-indicator.sh new file mode 100755 index 0000000..8fd06f4 --- /dev/null +++ b/.config/eww/scripts/scratchpad-indicator.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Scratchpad indicator for Sway + +output="$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?)|recurse(.floating_nodes[]?)|select(.name == "__i3_scratch").floating_nodes[]|"`<b>"+.name+"`</b> - "+.app_id+" "+(.id|tostring)')" +number="$(swaymsg -r -t get_tree | jq -r 'recurse(.nodes[]) | first(select(.name=="__i3_scratch")) | .floating_nodes | length')" + +if [ "$number" -gt 0 ]; then + text=" $number" +else + text="" +fi + +output="$(echo "$output" | sed -r 's/[&]+/and/g')" # Replace unprintable & character with the word 'and' +tooltip="\n" +tooltip+="$(echo "$output" | sed -z 's/\n/\\n/g')" +tooltip=${tooltip::-2} + +function ShowInfo() { + if [ "$number" -eq 0 ]; then + exit + else + tooltip="$(echo -e $tooltip)" + notify-send --hint=string:x-canonical-private-synchronous:scratchpad -u normal " Scratchpad" "$tooltip" + fi +} + +function Update() { + printf "%s" "$text" +} + +if [ "$1" = "ShowInfo" ]; then + ShowInfo +else + Update +fi diff --git a/.config/eww/scripts/start.sh b/.config/eww/scripts/start.sh new file mode 100755 index 0000000..ec305b9 --- /dev/null +++ b/.config/eww/scripts/start.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +focusactivetag() { + export arg="$1" + # Focus the lowest active tag + num=$(river-bedload -print outputs | jq -r '.['$arg'] | select(.).focused_tags') + b=0 + while [[ $num -gt 0 ]] + do + let temp=$num%2 + if [[ $temp -eq 1 ]] + then + let count=$count+1 + fi + let num=$num/2 + let b=b+1 + if [[ $temp -eq 1 ]] + then + riverctl set-focused-tags $((1 << ($b - 1))) + return + fi +done +return +} + +# kill any running instances if they exist +eww kill + +# Start Eww daemon +# eww daemon + +# start a bar for each monitor +monitors=$(wlr-randr | grep "^[^ ]" | awk '{ print$1 }' | wc -l | xargs) +total=$(wlr-randr | grep "^[^ ]" | awk '{ print$1 }' | wc -l | xargs) +monitors=$(($monitors-1)) +# for ((i = 0 ; i < $monitors ; i++)); do +for ((i = $monitors ; i >= 0 ; i-=1)); do + eww open bar${i} + riverctl focus-output $(wlr-randr | grep "^[^ ]" | awk '{ print$1 }' | awk 'FNR == '$i+1' {print}') + focusactivetag $i +done diff --git a/.config/eww/scripts/void-updates.sh b/.config/eww/scripts/void-updates.sh new file mode 100755 index 0000000..b004735 --- /dev/null +++ b/.config/eww/scripts/void-updates.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +function CheckUpdates() { +xbps-install -Mun 1> /tmp/void-updates +updates="$(cat /tmp/void-updates | awk '{ print $1 }')" +number=$(cat /tmp/void-updates | wc -l) + +if [ "$number" -gt 0 ]; then + text=" $number" +else + text="" +fi + +echo "$text" +} + +function RefreshUpdates() { + value="$(CheckUpdates)" + eww update void-updates="$value" +} + +function Update() { + foot bash -c 'sudo xbps-install -Suv' + RefreshUpdates +} + +case "$1" in + Refresh) + RefreshUpdates + exit 0 + ;; + Update) + Update + exit 0 + ;; + *) + CheckUpdates + exit 0 +esac diff --git a/.config/eww/scripts/volumecontrol b/.config/eww/scripts/volumecontrol new file mode 100755 index 0000000..7f058c9 --- /dev/null +++ b/.config/eww/scripts/volumecontrol @@ -0,0 +1,123 @@ +#!/usr/bin/env bash + +# You can call this script like this: +# volumecontrol up +# volumecontrol down +# volumecontrol mute + +function get_volume { + # amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1 + # pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\d+(?=%)' | head -n 1 + pactl get-sink-volume @DEFAULT_SINK@ | grep '%' | cut -d '%' -f 1 | cut -d ' ' -f 6 +} + +function is_mute { + # amixer get Master | grep '%' | grep -oE '[^ ]+$' | grep off > /dev/null + pactl get-sink-mute @DEFAULT_SINK@ | grep 'Mute: yes' >> /dev/null +} + +function send_notification { + volume=$(get_volume) + # Make the bar with the special character ─ (it's not dash -) + # https://en.wikipedia.org/wiki/Box-drawing_character + if [[ $volume == "100" ]]; then + icon="" + elif [[ $volume -ge "89" && $volume -le "100" ]]; then + icon="" + elif [[ $volume -ge "79" && $volume -le "90" ]]; then + icon="" + elif [[ $volume -ge "69" && $volume -le "80" ]]; then + icon="" + elif [[ $volume -ge "59" && $volume -le "70" ]]; then + icon="" + elif [[ $volume -ge "49" && $volume -le "60" ]]; then + icon="" + elif [[ $volume -ge "39" && $volume -le "50" ]]; then + icon="" + elif [[ $volume -ge "29" && $volume -le "40" ]]; then + icon="" + elif [[ $volume -ge "19" && $volume -le "30" ]]; then + icon="" + elif [[ $volume -ge "9" && $volume -le "20" ]]; then + icon="" + elif [[ $volume -gt "0" && $volume -le "10" ]]; then + icon="" + elif [[ $volume -eq "0" ]]; then + icon="" + # volume="M " + fi +bar=$(seq -s "─" $(($volume/5)) | sed 's/[0-9]//g') +# Send the notification +fyi --hint=string:x-canonical-private-synchronous:volumecontrol -u normal "$icon $bar $volume" +} + +case $1 in + up) + # Set the volume on (if it was muted) + # amixer set Master on > /dev/null + pactl set-sink-mute @DEFAULT_SINK@ 0 + # Up the volume (+ 2%) + # amixer sset Master 2%+ > /dev/null + pactl set-sink-volume @DEFAULT_SINK@ +2% + send_notification + # canberra-gtk-play -i audio-volume-change + ;; + down) + # amixer set Master on > /dev/null + pactl set-sink-mute @DEFAULT_SINK@ 0 + # amixer sset Master 2%- > /dev/null + pactl set-sink-volume @DEFAULT_SINK@ -2% + send_notification + # canberra-gtk-play -i audio-volume-change + ;; + mute) + # Toggle mute + # amixer set Master 1+ toggle > /dev/null + pactl set-sink-mute @DEFAULT_SINK@ toggle + if is_mute ; then + icon="" + fyi --hint=string:x-canonical-private-synchronous:volumecontrol -u normal "$icon Audio Muted" + else + send_notification + # canberra-gtk-play -i audio-volume-change + fi + ;; + *) + volume="$(get_volume)" + + if [[ $volume == "100" ]]; then + icon="" + elif [[ $volume -ge "89" && $volume -le "100" ]]; then + icon="" + elif [[ $volume -ge "79" && $volume -le "90" ]]; then + icon="" + elif [[ $volume -ge "69" && $volume -le "80" ]]; then + icon="" + elif [[ $volume -ge "59" && $volume -le "70" ]]; then + icon="" + elif [[ $volume -ge "49" && $volume -le "60" ]]; then + icon="" + elif [[ $volume -ge "39" && $volume -le "50" ]]; then + icon="" + elif [[ $volume -ge "29" && $volume -le "40" ]]; then + icon="" + elif [[ $volume -ge "19" && $volume -le "30" ]]; then + icon="" + elif [[ $volume -ge "9" && $volume -le "20" ]]; then + icon="" + elif [[ $volume -gt "0" && $volume -le "10" ]]; then + icon="" + elif [[ $volume -eq "0" ]]; then + icon="" + volume="M " + fi + + +if is_mute; then + icon="" + volume="M " +fi + +printf "%s" "$icon $volume%" + ;; +esac diff --git a/.config/eww/scripts/workspace.sh b/.config/eww/scripts/workspace.sh new file mode 100755 index 0000000..7e48bfa --- /dev/null +++ b/.config/eww/scripts/workspace.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +active() { +num=$(river-bedload -print outputs | jq -r '.['$arg'] | select(.).view_tags') +b=0 +while [[ $num -gt 0 ]] +do + let temp=$num%2 + if [[ $temp -eq 1 ]] + then + let count=$count+1 + fi + let num=$num/2 + let b=b+1 + if [[ $temp -eq 1 ]] + then + echo $b + fi +done +return +} + +#define icons for workspaces 1-9 +ic=(0 1 2 3 4 5 6 7 8 9) + +workspaces() { +export arg="$1" + unset -v \ + o1 o2 o3 o4 o5 o6 o7 o8 o9 \ + f1 f2 f3 f4 f5 f6 f7 f8 f9 + +if [[ $arg = 0 && $(river-bedload -print outputs | jq -r '.[''] | select(.).name' | wc -l | xargs) -gt 1 ]] +then + arg=1 +else + arg=0 +fi + +ows="$(active)" +for num in $ows; do + export o"$num"="$num" +done + +# Get Focused workspace for current monitor ID +num=$(river-bedload -print focused | jq -r '.['$arg'] | select(.).focused_id') +export f"$num"="$num" + +echo "(box :class \"workspace\" :orientation \"h\" :space-evenly \"false\" \ + (button :onclick \"riverctl set-focused-tags $((1 << (1 - 1)))\" :class \"w0$o1$f1\" \"${ic[1]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (2 - 1)))\" :class \"w0$o2$f2\" \"${ic[2]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (3 - 1)))\" :class \"w0$o3$f3\" \"${ic[3]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (4 - 1)))\" :class \"w0$o4$f4\" \"${ic[4]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (5 - 1)))\" :class \"w0$o5$f5\" \"${ic[5]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (6 - 1)))\" :class \"w0$o6$f6\" \"${ic[6]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (7 - 1)))\" :class \"w0$o7$f7\" \"${ic[7]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (8 - 1)))\" :class \"w0$o8$f8\" \"${ic[8]}\") \ + (button :onclick \"riverctl set-focused-tags $((1 << (9 - 1)))\" :class \"w0$o9$f9\" \"${ic[9]}\") \ + )" +} + +workspaces $1 +river-bedload -watch active | while read -r; do +workspaces $1 +done diff --git a/.config/foot/foot.ini b/.config/foot/foot.ini new file mode 100755 index 0000000..9bcd0f5 --- /dev/null +++ b/.config/foot/foot.ini @@ -0,0 +1,220 @@ +# -*- conf -*- + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot (or xterm-256color if built with -Dterminfo=disabled) +# login-shell=no + +# app-id=foot +# title=foot +# locked-title=no + +font=GoMono Nerd Font Mono:size=10 +font-bold=GoMono Nerd Font Mono:style=Bold:size=10 +font-italic=GoMono Nerd Font Mono:style=Italic:size=10 + +# font=monospace:size=8 +# font-bold=<bold variant of regular font> +# font-italic=<italic variant of regular font> +# font-bold-italic=<bold+italic variant of regular font> +# line-height=<font metrics> +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset=<font metrics> +# underline-thickness=<font underline thickness> +# box-drawings-uses-font-glyphs=no +dpi-aware=no + +# initial-window-size-pixels=700x500 # Or, +# initial-window-size-chars=<COLSxROWS> +# initial-window-mode=windowed +# pad=0x0 # optionally append 'center' +# resize-delay-ms=100 + +# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body} + +# bold-text-in-bright=no +# word-delimiters=,│`|:"'()[]{}<> +# selection-target=primary +# workers=<number of logical CPUs> +# utempter=/usr/lib/utempter/utempter + +[environment] +# name=value + +[bell] +# urgent=no +# notify=no +# command= +# command-focused=no + +[scrollback] +# lines=1000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format= + +[url] +# launch=xdg-open ${url} +# label-letters=sadfjklewcmpgh +# osc8-underline=url-mode +# protocols=http, https, ftp, ftps, file, gemini, gopher +# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[] + +[cursor] +# style=block +# color=<inverse foreground/background> +# blink=no +# beam-thickness=1.5 +# underline-thickness=<font underline thickness> + +[mouse] +# hide-when-typing=no +# alternate-scroll-mode=yes + +[colors] +alpha=0.8 +# background=002b36 +# foreground=839496 + +background=000000 +foreground=ebdbb2 +regular0=282828 +regular1=cc241d +regular2=98971a +regular3=d79921 +regular4=458588 +regular5=b16286 +regular6=689d6a +regular7=a89984 +bright0=928374 +bright1=fb4934 +bright2=b8bb26 +bright3=fabd2f +bright4=83a598 +bright5=d3869b +bright6=8ec07c +bright7=ebdbb2 + +## Normal/regular colors (color palette 0-7) +# regular0=073642 # black +# regular1=dc322f # red +# regular2=859900 # green +# regular3=b58900 # yellow +# regular4=268bd2 # blue +# regular5=d33682 # magenta +# regular6=2aa198 # cyan +# regular7=eee8d5 # white + +## Bright colors (color palette 8-15) +# bright0=08404f # bright black +# bright1=e35f5c # bright red +# bright2=9fb700 # bright green +# bright3=d9a400 # bright yellow +# bright4=4ba1de # bright blue +# bright5=dc619d # bright magenta +# bright6=32c1b6 # bright cyan +# bright7=ffffff # bright white + +## dimmed colors (see foot.ini(5) man page) +# dim0=<not set> +# ... +# dim7=<not-set> + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Misc colors +# selection-foreground=<inverse foreground/background> +# selection-background=<inverse foreground/background> +# jump-labels=<regular0> <regular3> # black-on-yellow +# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue +# search-box-no-match=<regular0> <regular1> # black-on-red +# search-box-match=<regular0> <regular3> # black-on-yellow +# urls=<regular3> + +[csd] +# preferred=server +# size=26 +# font=<primary font> +# color=<foreground color> +# hide-when-typing=no +# border-width=0 +# border-color=<csd.color> +# button-width=26 +# button-color=<background color> +# button-minimize-color=<regular4> +# button-maximize-color=<regular2> +# button-close-color=<regular1> + +[key-bindings] +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# clipboard-copy=Control+Shift+c XF86Copy +# clipboard-paste=Control+Shift+v XF86Paste +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# show-urls-launch=Control+Shift+u +# show-urls-copy=none +# show-urls-persistent=none +# prompt-prev=Control+Shift+z +# prompt-next=Control+Shift+x +# unicode-input=none +# noop=none + +[search-bindings] +# cancel=Control+g Control+c Escape +# commit=Return +# find-prev=Control+r +# find-next=Control+s +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# extend-to-word-boundary=Control+w +# extend-to-next-whitespace=Control+Shift+w +# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste +# primary-paste=Shift+Insert +# unicode-input=none + +[url-bindings] +# cancel=Control+g Control+c Control+d Escape +# toggle-url-visible=t + +[text-bindings] +# \x03=Mod4+c # Map Super+c -> Ctrl+c + +[mouse-bindings] +# selection-override-modifiers=Shift +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-row=BTN_LEFT-3 + +# vim: ft=dosini diff --git a/.config/fuzzel/fuzzel.ini b/.config/fuzzel/fuzzel.ini new file mode 100755 index 0000000..2515701 --- /dev/null +++ b/.config/fuzzel/fuzzel.ini @@ -0,0 +1,49 @@ +# output=<not set> +font=GoMono Nerd Font:size=10 +dpi-aware=no +# prompt=> +icon-theme=hicolor +icons-enabled=yes +# fields=filename,name,generic +# password-character=* +match-mode=fzf +# sort-result=yes +# match-counter=no +# show-actions=no +# terminal=$TERMINAL -e # Note: you cannot actually use environment variables here +# launch-prefix=<not set> + +# Setting this to false can be useful on compositors where enabling +# "focus-follows-mouse" causes fuzzel to exit as soon as the mouse +# is moved over another window. Sway (<= 1.7) exhibits this +# behavior, for example. +# Default: _yes_ +exit-on-keyboard-focus-loss=no + +# lines=15 +width=35 +horizontal-pad=10 +vertical-pad=10 +inner-pad=10 + +# image-size-ratio=0.5 + +# line-height=<use font metrics> +# letter-spacing=0 +line-height=18 +[colors] +background=000000AA +text=efefefef +match=fabd2fff +selection-match=fabd2fff +selection=666666ff +selection-text=efefefef +border=33eeffee + +[border] +width=2 +radius=0 + +[dmenu] +# mode=text # text|index +# exit-immediately-if-empty=no diff --git a/.config/gtk-3.0/gtk.css b/.config/gtk-3.0/gtk.css new file mode 100644 index 0000000..94a8418 --- /dev/null +++ b/.config/gtk-3.0/gtk.css @@ -0,0 +1,16 @@ +/* No (default) titlebar on wayland */ +headerbar.titlebar.default-decoration { + background: transparent; + padding: 0; + margin: -100px 0 -17px 0; + border: 0; + min-height: 0; + font-size: 0; + box-shadow: none; +} + +/* rm -rf window shadows */ +window.csd, /* gtk4? */ +window.csd decoration { /* gtk3 */ + box-shadow: none; +} diff --git a/.config/helix/config.toml b/.config/helix/config.toml new file mode 100644 index 0000000..454b1ab --- /dev/null +++ b/.config/helix/config.toml @@ -0,0 +1,63 @@ +theme = "gruvbox-transparent" + +[editor] +line-number = "absolute" +mouse = false +bufferline = "always" +cursorline = true +popup-border = "all" +color-modes = true +true-color = true + +[editor.cursor-shape] +insert = "bar" +normal = "block" +select = "underline" + +[editor.file-picker] +hidden = false + +[editor.indent-guides] +character = "╎" +render = true +skip-levels = 1 + +[editor.statusline] +left = ["mode", "spinner", "version-control", "file-name", "read-only-indicator", "file-modification-indicator"] +center = [] +right = ["diagnostics", "selections", "file-encoding", "register", "file-type", "position-percentage", "position"] +separator = "│" +mode.normal = "NORMAL" +mode.insert = "INSERT" +mode.select = "SELECT" + +[editor.lsp] +display-messages = true +display-inlay-hints = true + +[keys.normal] +# Move line or selection up/down +A-k = [ + "extend_to_line_bounds", + "delete_selection", + "move_line_up", + "paste_before" +] + +A-j = [ + "extend_to_line_bounds", + "delete_selection", + "move_line_down", + "paste_before" +] + +[keys.normal.space.space] +h = ':set gutters ["diagnostics","spacer","diff"]' +s = ':set gutters ["diagnostics","spacer","line-numbers","spacer","diff"]' + +# Config Mode +[keys.normal."C-backspace"] +o = ":config-open" +r = ":config-reload" +l = ":o ~/.config/helix/languages.toml" +g = ":toggle-option indent-guides.render" diff --git a/.config/helix/languages.toml b/.config/helix/languages.toml new file mode 100644 index 0000000..84d7e45 --- /dev/null +++ b/.config/helix/languages.toml @@ -0,0 +1,44 @@ +# introduce new language server +[language-server.scls] +command = "simple-completion-language-server" + +[language-server.scls.config] +max_completion_items = 20 # set max completion results len for each group: words, snippets, unicode-input +snippets_first = true # completions will return before snippets by default +feature_words = true # enable completion by word +feature_snippets = true # enable snippets +feature_unicode_input = true # enable "unicode input" +feature_paths = true # enable path completion + + +# write logs to /tmp/completion.log +[language-server.scls.environment] +RUST_LOG = "info,simple-completion-langauge-server=info" +LOG_FILE = "/tmp/completion.log" + +# append langage server to existed languages +[[language]] +name = "bash" +language-servers = [ "scls", "bash-language-server" ] + +[[language]] +name = "lua" +language-servers = [ "scls", "lua-language-server" ] + +[[language]] +name = "python" +language-servers = [ "scls", "pylsp" ] + +[[language]] +name = "toml" +language-servers = [ "scls" ] + +# introduce a new language to enable completion on any doc by forcing set language with :set-language stub +[[language]] +name = "stub" +scope = "text.stub" +file-types = [] +shebangs = [] +roots = [] +auto-format = false +language-servers = [ "scls" ] diff --git a/.config/helix/themes/gruvbox-transparent.toml b/.config/helix/themes/gruvbox-transparent.toml new file mode 100644 index 0000000..21f8992 --- /dev/null +++ b/.config/helix/themes/gruvbox-transparent.toml @@ -0,0 +1,117 @@ +# Author : Justine Smithies <justine@smithies.me.uk> # The theme uses the gruvbox dark palette with standard contrast and transparent background +# if the terminal supports it: github.com/morhetz/gruvbox + +"attribute" = "aqua1" +"keyword" = { fg = "red1" } +"keyword.directive" = "red0" +"namespace" = "aqua1" +"punctuation" = "orange1" +"punctuation.delimiter" = "orange1" +"operator" = "purple1" +"special" = "purple0" +"variable.other.member" = "blue1" +"variable" = "fg1" +"variable.builtin" = "orange1" +"variable.parameter" = "fg2" +"type" = "yellow1" +"type.builtin" = "yellow1" +"constructor" = { fg = "purple1", modifiers = ["bold"] } +"function" = { fg = "green1", modifiers = ["bold"] } +"function.macro" = "aqua1" +"function.builtin" = "yellow1" +"tag" = "red1" +"comment" = { fg = "gray1", modifiers = ["italic"] } +"constant" = { fg = "purple1" } +"constant.builtin" = { fg = "purple1", modifiers = ["bold"] } +"string" = "green1" +"constant.numeric" = "purple1" +"constant.character.escape" = { fg = "fg2", modifiers = ["bold"] } +"label" = "aqua1" +"module" = "aqua1" + +"diff.plus" = "green1" +"diff.delta" = "orange1" +"diff.minus" = "red1" + +"warning" = "yellow1" +"error" = "red1" +"info" = "aqua1" +"hint" = "blue1" + +"ui.background" = { } +"ui.linenr" = { fg = "bg4" } +"ui.linenr.selected" = { fg = "yellow1" } +"ui.cursorline" = { bg = "bg1" } +"ui.statusline" = { fg = "fg1", bg = "bg2" } +"ui.statusline.normal" = { fg = "black", bg = "green1" } +"ui.statusline.insert" = { fg = "fg1", bg = "blue0" } +"ui.statusline.select" = { fg = "fg1", bg = "orange0" } +"ui.statusline.inactive" = { fg = "fg4", bg = "bg1" } +"ui.bufferline" = { fg = "fg1", bg = "bg1" } +"ui.bufferline.active" = { fg = "bg0", bg = "yellow0" } +"ui.bufferline.background" = { bg = "bg2" } +"ui.popup" = { bg = "bg1" } +"ui.window" = { bg = "bg1" } +"ui.help" = { bg = "bg1", fg = "fg1" } +"ui.text" = { fg = "fg1" } +"ui.text.focus" = { fg = "fg1" } +"ui.selection" = { bg = "bg2" } +"ui.selection.primary" = { bg = "bg3" } +"ui.cursor.primary" = { bg = "fg4", fg = "bg1" } +"ui.cursor.match" = { bg = "bg3" } +"ui.menu" = { fg = "fg1", bg = "bg2" } +"ui.menu.selected" = { fg = "bg2", bg = "blue1", modifiers = ["bold"] } +"ui.virtual.whitespace" = "bg2" +"ui.virtual.ruler" = { bg = "bg1" } +"ui.virtual.inlay-hint" = { fg = "gray1" } +"ui.virtual.wrap" = { fg = "bg2" } +"ui.virtual.jump-label" = { fg = "purple0", modifiers = ["bold"] } + +"diagnostic.warning" = { underline = { color = "yellow1", style = "curl" } } +"diagnostic.error" = { underline = { color = "red1", style = "curl" } } +"diagnostic.info" = { underline = { color = "aqua1", style = "curl" } } +"diagnostic.hint" = { underline = { color = "blue1", style = "curl" } } +"diagnostic.unnecessary" = { modifiers = ["dim"] } +"diagnostic.deprecated" = { modifiers = ["crossed_out"] } + +"markup.heading" = "aqua1" +"markup.bold" = { modifiers = ["bold"] } +"markup.italic" = { modifiers = ["italic"] } +"markup.strikethrough" = { modifiers = ["crossed_out"] } +"markup.link.url" = { fg = "green1", modifiers = ["underlined"] } +"markup.link.text" = "red1" +"markup.raw" = "red1" + +[palette] +bg0 = "#282828" # main background +bg1 = "#3c3836" +bg2 = "#504945" +bg3 = "#665c54" +bg4 = "#7c6f64" + +fg0 = "#fbf1c7" +fg1 = "#ebdbb2" # main foreground +fg2 = "#d5c4a1" +fg3 = "#bdae93" +fg4 = "#a89984" # gray0 + +gray0 = "#a89984" +gray1 = "#928374" + +red0 = "#cc241d" # neutral +red1 = "#fb4934" # bright +green0 = "#98971a" +green1 = "#b8bb26" +yellow0 = "#d79921" +yellow1 = "#fabd2f" +blue0 = "#458588" +blue1 = "#83a598" +purple0 = "#b16286" +purple1 = "#d3869b" +aqua0 = "#689d6a" +aqua1 = "#8ec07c" +orange0 = "#d65d0e" +orange1 = "#fe8019" + +black = "#000000" + diff --git a/.config/imv/config b/.config/imv/config new file mode 100644 index 0000000..f870741 --- /dev/null +++ b/.config/imv/config @@ -0,0 +1,65 @@ +# Default config for imv + +[options] + +# Suppress built-in key bindings, and specify them explicitly in this +# config file. +suppress_default_binds = true +overlay_font = GoMono Nerd Font:10 + +[aliases] +# Define aliases here. Any arguments passed to an alias are appended to the +# command. +# alias = command to run + +[binds] +# Define some key bindings +q = quit +y = exec echo working! + +# Image navigation +<Left> = prev +<bracketleft> = prev +<Right> = next +<bracketright> = next +gg = goto 1 +<Shift+G> = goto -1 + +# Panning +j = pan 0 -50 +k = pan 0 50 +h = pan 50 0 +l = pan -50 0 + +# Zooming +<Up> = zoom 1 +<Shift+plus> = zoom 1 +i = zoom 1 +<Down> = zoom -1 +<minus> = zoom -1 +o = zoom -1 + +# Rotate Clockwise by 90 degrees +<Ctrl+r> = rotate by 90 + +# Other commands +x = close +f = fullscreen +d = overlay +p = exec echo $imv_current_file +c = center +s = scaling next +<Shift+S> = upscaling next +a = zoom actual +r = reset + +# Gif playback +<period> = next_frame +<space> = toggle_playing + +# Slideshow control +t = slideshow +1 +<Shift+T> = slideshow -1 + +# Set image as wallpaper for Sway +<Shift+W> = exec cp -f "$imv_current_file" ~/.cache/wallpaper && swaymsg output "*" background ~/.cache/wallpaper fill diff --git a/.config/kanshi/config b/.config/kanshi/config new file mode 100644 index 0000000..8b8b3cf --- /dev/null +++ b/.config/kanshi/config @@ -0,0 +1,10 @@ +profile Laptop { + output eDP-1 position 0,0 mode 1920x1080 + exec sh -c "$HOME/.config/eww/scripts/start.sh" +} + +profile Dock { + output HDMI-A-1 position 0,0 mode 1920x1080 + output eDP-1 position 1920,0 mode 1920x1080 + exec sh -c "$HOME/.config/eww/scripts/start.sh" +} diff --git a/.config/lf/colors b/.config/lf/colors new file mode 100644 index 0000000..b65d3f0 --- /dev/null +++ b/.config/lf/colors @@ -0,0 +1,174 @@ +# vim:ft=dircolors +# (This is not a dircolors file but it helps to highlight colors and comments) + +# default values from dircolors +# (entries with a leading # are not implemented in lf) +# #no 00 # NORMAL +# fi 00 # FILE +# #rs 0 # RESET +# di 01;34 # DIR +# ln 01;36 # LINK +# #mh 00 # MULTIHARDLINK +# pi 40;33 # FIFO +# so 01;35 # SOCK +# #do 01;35 # DOOR +# bd 40;33;01 # BLK +# cd 40;33;01 # CHR +# or 40;31;01 # ORPHAN +# #mi 00 # MISSING +# su 37;41 # SETUID +# sg 30;43 # SETGID +# #ca 30;41 # CAPABILITY +# tw 30;42 # STICKY_OTHER_WRITABLE +# ow 34;42 # OTHER_WRITABLE +# st 37;44 # STICKY +# ex 01;32 # EXEC + +# default values from lf (with matching order) +# ln 01;36 # LINK +# or 31;01 # ORPHAN +# tw 01;34 # STICKY_OTHER_WRITABLE +# ow 01;34 # OTHER_WRITABLE +# st 01;34 # STICKY +# di 01;34 # DIR +# pi 33 # FIFO +# so 01;35 # SOCK +# bd 33;01 # BLK +# cd 33;01 # CHR +# su 01;32 # SETUID +# sg 01;32 # SETGID +# ex 01;32 # EXEC +# fi 00 # FILE + +# file types (with matching order) +ln 01;36 # LINK +or 31;01 # ORPHAN +tw 34 # STICKY_OTHER_WRITABLE +ow 34 # OTHER_WRITABLE +st 01;34 # STICKY +di 01;34 # DIR +pi 33 # FIFO +so 01;35 # SOCK +bd 33;01 # BLK +cd 33;01 # CHR +su 01;32 # SETUID +sg 01;32 # SETGID +ex 01;32 # EXEC +fi 00 # FILE + +# archives or compressed (dircolors defaults) +*.tar 01;31 +*.tgz 01;31 +*.arc 01;31 +*.arj 01;31 +*.taz 01;31 +*.lha 01;31 +*.lz4 01;31 +*.lzh 01;31 +*.lzma 01;31 +*.tlz 01;31 +*.txz 01;31 +*.tzo 01;31 +*.t7z 01;31 +*.zip 01;31 +*.z 01;31 +*.dz 01;31 +*.gz 01;31 +*.lrz 01;31 +*.lz 01;31 +*.lzo 01;31 +*.xz 01;31 +*.zst 01;31 +*.tzst 01;31 +*.bz2 01;31 +*.bz 01;31 +*.tbz 01;31 +*.tbz2 01;31 +*.tz 01;31 +*.deb 01;31 +*.rpm 01;31 +*.jar 01;31 +*.war 01;31 +*.ear 01;31 +*.sar 01;31 +*.rar 01;31 +*.alz 01;31 +*.ace 01;31 +*.zoo 01;31 +*.cpio 01;31 +*.7z 01;31 +*.rz 01;31 +*.cab 01;31 +*.wim 01;31 +*.swm 01;31 +*.dwm 01;31 +*.esd 01;31 + +# image formats (dircolors defaults) +*.jpg 01;35 +*.jpeg 01;35 +*.mjpg 01;35 +*.mjpeg 01;35 +*.gif 01;35 +*.bmp 01;35 +*.pbm 01;35 +*.pgm 01;35 +*.ppm 01;35 +*.tga 01;35 +*.xbm 01;35 +*.xpm 01;35 +*.tif 01;35 +*.tiff 01;35 +*.png 01;35 +*.svg 01;35 +*.svgz 01;35 +*.mng 01;35 +*.pcx 01;35 +*.mov 01;35 +*.mpg 01;35 +*.mpeg 01;35 +*.m2v 01;35 +*.mkv 01;35 +*.webm 01;35 +*.ogm 01;35 +*.mp4 01;35 +*.m4v 01;35 +*.mp4v 01;35 +*.vob 01;35 +*.qt 01;35 +*.nuv 01;35 +*.wmv 01;35 +*.asf 01;35 +*.rm 01;35 +*.rmvb 01;35 +*.flc 01;35 +*.avi 01;35 +*.fli 01;35 +*.flv 01;35 +*.gl 01;35 +*.dl 01;35 +*.xcf 01;35 +*.xwd 01;35 +*.yuv 01;35 +*.cgm 01;35 +*.emf 01;35 +*.ogv 01;35 +*.ogx 01;35 + +# audio formats (dircolors defaults) +*.aac 00;36 +*.au 00;36 +*.flac 00;36 +*.m4a 00;36 +*.mid 00;36 +*.midi 00;36 +*.mka 00;36 +*.mp3 00;36 +*.mpc 00;36 +*.ogg 00;36 +*.ra 00;36 +*.wav 00;36 +*.oga 00;36 +*.opus 00;36 +*.spx 00;36 +*.xspf 00;36 diff --git a/.config/lf/icons b/.config/lf/icons new file mode 100644 index 0000000..68d53e3 --- /dev/null +++ b/.config/lf/icons @@ -0,0 +1,357 @@ +# vim:ft=conf + +# These examples require Nerd Fonts or a compatible font to be used. +# See https://www.nerdfonts.com for more information. + +# default values from lf (with matching order) +# ln l # LINK +# or l # ORPHAN +# tw t # STICKY_OTHER_WRITABLE +# ow d # OTHER_WRITABLE +# st t # STICKY +# di d # DIR +# pi p # FIFO +# so s # SOCK +# bd b # BLK +# cd c # CHR +# su u # SETUID +# sg g # SETGID +# ex x # EXEC +# fi - # FILE + +# file types (with matching order) +ln # LINK +or # ORPHAN +tw t # STICKY_OTHER_WRITABLE +ow # OTHER_WRITABLE +st t # STICKY +di # DIR +pi p # FIFO +so s # SOCK +bd b # BLK +cd c # CHR +su u # SETUID +sg g # SETGID +ex # EXEC +fi # FILE + +# file extensions (vim-devicons) +*.styl +*.sass +*.scss +*.htm +*.html +*.slim +*.haml +*.ejs +*.css +*.less +*.md +*.mdx +*.markdown +*.rmd +*.json +*.webmanifest +*.js +*.mjs +*.jsx +*.rb +*.gemspec +*.rake +*.php +*.py +*.pyc +*.pyo +*.pyd +*.coffee +*.mustache +*.hbs +*.conf +*.ini +*.yml +*.yaml +*.toml +*.bat +*.mk +*.jpg +*.jpeg +*.bmp +*.png +*.webp +*.gif +*.ico +*.twig +*.cpp +*.c++ +*.cxx +*.cc +*.cp +*.c +*.cs +*.h +*.hh +*.hpp +*.hxx +*.hs +*.lhs +*.nix +*.lua +*.java +*.sh +*.fish +*.bash +*.zsh +*.ksh +*.csh +*.awk +*.ps1 +*.ml λ +*.mli λ +*.diff +*.db +*.sql +*.dump +*.clj +*.cljc +*.cljs +*.edn +*.scala +*.go +*.dart +*.xul +*.sln +*.suo +*.pl +*.pm +*.t +*.rss +'*.f#' +*.fsscript +*.fsx +*.fs +*.fsi +*.rs +*.rlib +*.d +*.erl +*.hrl +*.ex +*.exs +*.eex +*.leex +*.heex +*.vim +*.ai +*.psd +*.psb +*.ts +*.tsx +*.jl +*.pp +*.vue ﵂ +*.elm +*.swift +*.xcplayground +*.tex ﭨ +*.r ﳒ +*.rproj 鉶 +*.sol ﲹ +*.pem + +# file names (vim-devicons) (case-insensitive not supported in lf) +*gruntfile.coffee +*gruntfile.js +*gruntfile.ls +*gulpfile.coffee +*gulpfile.js +*gulpfile.ls +*mix.lock +*dropbox +*.ds_store +*.gitconfig +*.gitignore +*.gitattributes +*.gitlab-ci.yml +*.bashrc +*.zshrc +*.zshenv +*.zprofile +*.vimrc +*.gvimrc +*_vimrc +*_gvimrc +*.bashprofile +*favicon.ico +*license +*node_modules +*react.jsx +*procfile +*dockerfile +*docker-compose.yml +*rakefile +*config.ru +*gemfile +*makefile +*cmakelists.txt +*robots.txt ﮧ + +# file names (case-sensitive adaptations) +*Gruntfile.coffee +*Gruntfile.js +*Gruntfile.ls +*Gulpfile.coffee +*Gulpfile.js +*Gulpfile.ls +*Dropbox +*.DS_Store +*LICENSE +*React.jsx +*Procfile +*Dockerfile +*Docker-compose.yml +*Rakefile +*Gemfile +*Makefile +*CMakeLists.txt + +# file patterns (vim-devicons) (patterns not supported in lf) +# .*jquery.*\.js$ +# .*angular.*\.js$ +# .*backbone.*\.js$ +# .*require.*\.js$ +# .*materialize.*\.js$ +# .*materialize.*\.css$ +# .*mootools.*\.js$ +# .*vimrc.* +# Vagrantfile$ + +# file patterns (file name adaptations) +*jquery.min.js +*angular.min.js +*backbone.min.js +*require.min.js +*materialize.min.js +*materialize.min.css +*mootools.min.js +*vimrc +Vagrantfile + +# archives or compressed (extensions from dircolors defaults) +*.tar +*.tgz +*.arc +*.arj +*.taz +*.lha +*.lz4 +*.lzh +*.lzma +*.tlz +*.txz +*.tzo +*.t7z +*.zip +*.z +*.dz +*.gz +*.lrz +*.lz +*.lzo +*.xz +*.zst +*.tzst +*.bz2 +*.bz +*.tbz +*.tbz2 +*.tz +*.deb +*.rpm +*.jar +*.war +*.ear +*.sar +*.rar +*.alz +*.ace +*.zoo +*.cpio +*.7z +*.rz +*.cab +*.wim +*.swm +*.dwm +*.esd + +# image formats (extensions from dircolors defaults) +*.jpg +*.jpeg +*.mjpg +*.mjpeg +*.gif +*.bmp +*.pbm +*.pgm +*.ppm +*.tga +*.xbm +*.xpm +*.tif +*.tiff +*.png +*.svg +*.svgz +*.mng +*.pcx +*.mov +*.mpg +*.mpeg +*.m2v +*.mkv +*.webm +*.ogm +*.mp4 +*.m4v +*.mp4v +*.vob +*.qt +*.nuv +*.wmv +*.asf +*.rm +*.rmvb +*.flc +*.avi +*.fli +*.flv +*.gl +*.dl +*.xcf +*.xwd +*.yuv +*.cgm +*.emf +*.ogv +*.ogx + +# audio formats (extensions from dircolors defaults) +*.aac +*.au +*.flac +*.m4a +*.mid +*.midi +*.mka +*.mp3 +*.mpc +*.ogg +*.ra +*.wav +*.oga +*.opus +*.spx +*.xspf + +# other formats +*.pdf diff --git a/.config/lf/lfrc b/.config/lf/lfrc new file mode 100644 index 0000000..ebf11ba --- /dev/null +++ b/.config/lf/lfrc @@ -0,0 +1,61 @@ +# interpreter for shell commands +set shell bash + +# set '-eu' options for shell commands +# These options are used to have safer shell commands. Option '-e' is used to +# exit on error and option '-u' is used to give error for unset variables. +# Option '-f' disables pathname expansion which can be useful when $f, $fs, and +# $fx variables contain names with '*' or '?' characters. However, this option +# is used selectively within individual commands as it can be limiting at +# times. +set shellopts '-eu' + +# set internal field separator (IFS) to "\n" for shell commands +# This is useful to automatically split file names in $fs and $fx properly +# since default file separator used in these variables (i.e. 'filesep' option) +# is newline. You need to consider the values of these options and create your +# commands accordingly. +set ifs "\n" + +# leave some space at the top and the bottom of the screen +set scrolloff 10 + +# Use the `dim` attribute instead of underline for the cursor in the preview pane +set cursorpreviewfmt "\033[7;2m" + +# Show number of files in dirs instead of single size +set info size +set dircounts + +# Custom Additions +set drawbox true + +# Toggle hidden files +map . set hidden! + +# Set previewer and cleaner +set sixel +set previewer ~/.config/lf/previewer.sh + +# Set colours and icons +set icons + +# Custom Functions +cmd open ${{ + case $(file --mime-type $f -bL) in + image/*) setsid imv $f >/dev/null 2>&1 &;; + *pdf*) setsid zathura $fx >/dev/null 2>&1 & ;; + text/*|application/json) $EDITOR "$f";; + video/*) setsid mpv $f -quiet >/dev/null 2>&1 & ;; + *) for f in $fx; do setsid $OPENER $f 2>/dev/null & done ;; + esac +}} + +cmd setwallpaper ${{ + #cp -f "$f" ~/.cache/wallpaper; pkill swaybg > /dev/null 2>&1; nohup swaybg -m fill -i ~/.cache/wallpaper > /dev/null 2>&1 & + # cp -f "$f" ~/.cache/wallpaper && qtile cmd-obj -o cmd -f reload_config + echo "$f" > ~/.cache/wallpaper; sh ~/.config/hypr/scripts/wallpaper.sh > /dev/null 2>&1 & +}} + +# Key Mappings +map bg setwallpaper diff --git a/.config/lf/previewer.sh b/.config/lf/previewer.sh new file mode 100755 index 0000000..764758b --- /dev/null +++ b/.config/lf/previewer.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +if command -v bat >/dev/null 2>&1; then + pagercmd="bat --color=always --style=plain --pager=never" +else + pagercmd="less -FRiX" +fi + +case "$(printf "%s\n" "$(readlink -f "$1")" | awk '{print tolower($0)}')" in + *.tgz|*.tar.gz) tar tzf "$1";; + *.tar.bz2|*.tbz2) tar tjf "$1";; + *.tar.txz|*.txz) xz --list "$1";; + *.tar) tar tf "$1";; + *.zip|*.jar|*.war|*.ear|*.oxt|*.apkg|*.apk) unzip -l "$1";; + *.rar) unrar l "$1";; + *.7z) 7z l "$1";; + *.[1-8]) man "$1" | col -b ;; + *.epub|*.rtf|*.doc|*.docx|*.odt|*.ods|*.odp|*.sxw) + pandoc -s -t markdown -- "$1" | $pagercmd + exit 1 + ;; + *.jpg|*.jpeg|*.png|*.bmp|*.xpm|*.gif) + chafa -f sixel -s "$2x$3" --animate false "$1" --polite on + exit 1 + ;; + *.pdf) + CACHE=$(mktemp) + pdftoppm -png -f 1 -singlefile "$1" "$CACHE" + chafa -f sixel -s "$2x$3" --animate false "$CACHE.png" --polite on + rm "$CACHE" + ;; + *.avi|*.mp4|*.wmv|*.dat|*.3gp|*.ogv|*.mkv|*.mpg|*.mpeg|*.vob|*.fl[icv]|*.m2v|*.mov|*.webm|*.ts|*.mts|*.m4v|*.r[am]|*.qt|*.divx) + CACHE=$(mktemp) + ffmpegthumbnailer -i "$1" -o "$CACHE" -s 0 + chafa -f sixel -s "$2x$3" --animate false "$CACHE" --polite on + rm "$CACHE" + ;; + *) + bat --color=always --style=plain --pager=never "$1" + ;; +esac diff --git a/.config/mako/config b/.config/mako/config new file mode 100644 index 0000000..bea8a5e --- /dev/null +++ b/.config/mako/config @@ -0,0 +1,16 @@ +font=GoMono Nerd Font 10 +default-timeout=5000 +layer=overlay +width=300 +height=500 +anchor=top-right +margin=10 + +background-color=#000000AA +text-color=#FFFFFF +border-color=#33CCFF +progress-color=#458588 + + +[app-name="Calendar"] +width=198 diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf new file mode 100644 index 0000000..68024f6 --- /dev/null +++ b/.config/mpv/mpv.conf @@ -0,0 +1,140 @@ +# +# Example mpv configuration file +# +# Warning: +# +# The commented example options usually do _not_ set the default values. Call +# mpv with --list-options to see the default values for most options. There is +# no builtin or example mpv.conf with all the defaults. +# +# +# Configuration files are read system-wide from /usr/local/etc/mpv.conf +# and per-user from ~/.config/mpv/mpv.conf, where per-user settings override +# system-wide settings, all of which are overridden by the command line. +# +# Configuration file settings and the command line options use the same +# underlying mechanisms. Most options can be put into the configuration file +# by dropping the preceding '--'. See the man page for a complete list of +# options. +# +# Lines starting with '#' are comments and are ignored. +# +# See the CONFIGURATION FILES section in the man page +# for a detailed description of the syntax. +# +# Profiles should be placed at the bottom of the configuration file to ensure +# that settings wanted as defaults are not restricted to specific profiles. + +################## +# video settings # +################## + +# Start in fullscreen mode by default. +#fs=yes + +# force starting with centered window +# geometry=50%:50% + +# don't allow a new window to have a size larger than 90% of the screen size +autofit-larger=40%x40% + +# Do not close the window on exit. +#keep-open=yes + +# Do not wait with showing the video window until it has loaded. (This will +# resize the window once video is loaded. Also always shows a window with +# audio.) +#force-window=immediate + +# Disable the On Screen Controller (OSC). +#osc=no + +# Keep the player window on top of all other windows. +#ontop=yes + +# Specify high quality video rendering preset (for --vo=gpu only) +# Can cause performance problems with some drivers and GPUs. +profile=gpu-hq + +# Force video to lock on the display's refresh rate, and change video and audio +# speed to some degree to ensure synchronous playback - can cause problems +# with some drivers and desktop environments. +#video-sync=display-resample + +# Enable hardware decoding if available. Often, this does not work with all +# video outputs, but should work well with default settings on most systems. +# If performance or energy usage is an issue, forcing the vdpau or vaapi VOs +# may or may not help. +#hwdec=auto + +################## +# audio settings # +################## + +# Specify default audio device. You can list devices with: --audio-device=help +# The option takes the device string (the stuff between the '...'). +#audio-device=alsa/default + +# Do not filter audio to keep pitch when changing playback speed. +#audio-pitch-correction=no + +# Output 5.1 audio natively, and upmix/downmix audio with a different format. +#audio-channels=5.1 +# Disable any automatic remix, _if_ the audio output accepts the audio format. +# of the currently played file. See caveats mentioned in the manpage. +# (The default is "auto-safe", see manpage.) +#audio-channels=auto + +################## +# other settings # +################## + +# Pretend to be a web browser. Might fix playback with some streaming sites, +# but also will break with shoutcast streams. +#user-agent="Mozilla/5.0" + +# cache settings +# +# Use a large seekable RAM cache even for local input. +#cache=yes +# +# Use extra large RAM cache (needs cache=yes to make it useful). +#demuxer-max-bytes=500M +#demuxer-max-back-bytes=100M +# +# Disable the behavior that the player will pause if the cache goes below a +# certain fill size. +#cache-pause=no +# +# Store cache payload on the hard disk instead of in RAM. (This may negatively +# impact performance unless used for slow input such as network.) +#cache-dir=~/.cache/ +#cache-on-disk=yes + +# Display English subtitles if available. +#slang=en + +# Play Finnish audio if available, fall back to English otherwise. +#alang=fi,en + +# Change subtitle encoding. For Arabic subtitles use 'cp1256'. +# If the file seems to be valid UTF-8, prefer UTF-8. +# (You can add '+' in front of the codepage to force it.) +#sub-codepage=cp1256 + +# You can also include other configuration files. +#include=/path/to/the/file/you/want/to/include + +############ +# Profiles # +############ + +# The options declared as part of profiles override global default settings, +# but only take effect when the profile is active. + +# The following profile can be enabled on the command line with: --profile=eye-cancer + +#[eye-cancer] +#sharpen=5 + +script-opts=ytdl_hook-ytdl_path=/usr/local/bin/yt-dlp diff --git a/.config/newsboat/config b/.config/newsboat/config new file mode 100644 index 0000000..afa1438 --- /dev/null +++ b/.config/newsboat/config @@ -0,0 +1,42 @@ +# general settings +auto-reload yes +reload-time 30 +max-items 500 +reload-threads 11 + +#browser "firefox --no-remote -P default --class newsboat %u >/dev/null 2>&1 &" +browser linkhandler + +color listnormal cyan default +color listfocus blue yellow standout bold +color listnormal_unread green default +color listfocus_unread blue green standout bold +color info yellow blue bold +color article white default + +highlight article "(^Feed:.*|^Title:.*|^Author:.*)" cyan default bold +highlight article "(^Link:.*|^Date:.*)" default default +highlight article "https?://[^ ]+" green default + +highlight article "^(Title):.*$" blue default +highlight article "\\[[0-9][0-9]*\\]" magenta default bold +highlight article "\\[image\\ [0-9]+\\]" green default bold +highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold +highlight article ":.*\\(link\\)$" cyan default +highlight article ":.*\\(image\\)$" blue default +highlight article ":.*\\(embedded flash\\)$" magenta default + +highlight articlelist "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]+" white default +highlight articlelist "\\|[^\\|]+\\|" cyan default +highlight articlelist "\\(YouTube\\)" magenta default +highlight articlelist "\\(PeerTube\\)" magenta default +highlight articlelist "\\|r/" red default +highlight feedlist "\\(YouTube\\)" magenta default +highlight feedlist "\\(PeerTube\\)" magenta default +highlight feedlist " r/" red default +highlight feedlist "\\([0-9]+/[0-9]+\\)" white default + +highlight all "---.*---" yellow default bold +highlight feedlist "^.*\\(0/0\\)" black default invis + +articlelist-format "%4i %f %D %?T?|%-20T| ?%t" diff --git a/.config/river/autostart.sh b/.config/river/autostart.sh new file mode 100755 index 0000000..00ea0a5 --- /dev/null +++ b/.config/river/autostart.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# Authentication dialog + +pkill -f /usr/local/libexec/polkit-gnome-authentication-agent-1 +/usr/local/libexec/polkit-gnome-authentication-agent-1 & + +# Start xdg-desktop-portal-wlr + +pkill -f /usr/local/libexec/xdg-desktop-portal-wlr +/usr/local/libexec/xdg-desktop-portal-wlr & + +# Start Kanshi which also starts Yambar +pkill -f kanshi +kanshi & + +read -r wallpaper<~/.cache/wallpaper +pkill -f swaybg +swaybg -m fill -i "$wallpaper" & + +pkill -f mako +mako & + +pkill -f wlsunset +wlsunset -l 57.4 -L -1.9 & + +# Restore previous brightness +backlight $(grep 'brightness:' ~/.cache/brightness | awk '{print $2}') + +export wallpaper=$( echo $wallpaper) + +pkill -f swayidle +swayidle -w \ + timeout 300 'swaylock -f -i $wallpaper' \ + timeout 600 'wlopm --off \*;swaylock -F -i $wallpaper' resume 'wlopm --on \*' \ + before-sleep 'swaylock -f -i $wallpaper' & diff --git a/.config/river/init b/.config/river/init new file mode 100755 index 0000000..a63244d --- /dev/null +++ b/.config/river/init @@ -0,0 +1,213 @@ +#!/usr/bin/env bash + +# See the river(1), riverctl(1), and rivertile(1) man pages for complete +# documentation. + +# Appearance +riverctl background-color 0x002b36 +riverctl border-color-focused 0x33ccff +riverctl border-color-unfocused 0x595959 +riverctl border-width 2 + +# Pointer +riverctl focus-follows-cursor normal +riverctl set-cursor-warp on-focus-change +# Super + Left Mouse Button to move views +riverctl map-pointer normal Super BTN_LEFT move-view +# Super + Right Mouse Button to resize views +riverctl map-pointer normal Super BTN_RIGHT resize-view +# Super + Middle Mouse Button to toggle float +riverctl map-pointer normal Super BTN_MIDDLE toggle-float + +# Inputs +riverctl set-repeat 50 300 +riverctl hide-cursor timeout 5000 +riverctl hide-cursor when-typing enabled +riverctl keyboard-layout -options "grp:ctrl_space_toggle" "us,gb" + +# Keybinds +# Note: the "Super" modifier is also known as Logo, GUI, Windows, Mod4, etc. + +# Super+Shift+Return to start an instance of foot (https://codeberg.org/dnkl/foot) +riverctl map normal Super Return spawn foot + +# Super+Q to close the focused view +riverctl map normal Super Q close + +# Super+Shift+E to exit river +riverctl map normal Super+Shift E exit + +# Launcher +riverctl map normal Super D spawn "fuzzel" + +# Toggle bar +riverctl map normal Super B spawn "~/.config/eww/scripts/bar-toggle.sh" + +# Power Menu +riverctl map normal Control+Super P spawn "~/.local/bin/powermenu" + +# Emoji Menu +riverctl map normal Super E spawn "~/.local/bin/emoji-menu" + +# Take a screenshot of the active output +riverctl map normal None Print spawn '~/.config/river/scripts/screenshot.sh' + +# Take a screenshot of the selected region +riverctl map normal Super Print spawn '~/.config/river/scripts/screenshot.sh selected-region' + +# Take a screenshot and save it to the clipboard +riverctl map normal Super+Shift Print spawn '~/.config/river/scripts/screenshot.sh save-to-clipboard' + +# Super+Space to toggle float +riverctl map normal Super Space toggle-float + +# Super+F to toggle fullscreen +riverctl map normal Super F toggle-fullscreen + +# Super+J and Super+K to focus the next/previous view in the layout stack +riverctl map normal Super J focus-view next +riverctl map normal Super K focus-view previous + +# Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous +# view in the layout stack +riverctl map normal Super+Shift J swap next +riverctl map normal Super+Shift K swap previous + +# Super+Period and Super+Comma to focus the next/previous output +riverctl map normal Super Period focus-output next +riverctl map normal Super Comma focus-output previous + +# Super+Shift+{Period,Comma} to send the focused view to the next output on the same tag or the next outputs currently focused tag +riverctl map normal Super+Shift Period send-to-output next +riverctl map normal Super+Shift Comma send-to-output -current-tags next + +# Super+Return to bump the focused view to the top of the layout stack +# riverctl map normal Super Return zoom + +# Super+H and Super+L to decrease/increase the main ratio of rivertile(1) +riverctl map normal Super H send-layout-cmd rivertile "main-ratio -0.05" +riverctl map normal Super L send-layout-cmd rivertile "main-ratio +0.05" + +# Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivertile(1) +riverctl map normal Super+Shift H send-layout-cmd rivertile "main-count +1" +riverctl map normal Super+Shift L send-layout-cmd rivertile "main-count -1" + +# Super+Alt+{H,J,K,L} to move views +riverctl map normal Super+Alt H move left 100 +riverctl map normal Super+Alt J move down 100 +riverctl map normal Super+Alt K move up 100 +riverctl map normal Super+Alt L move right 100 + +# Super+Alt+Control+{H,J,K,L} to snap views to screen edges +riverctl map normal Super+Alt+Control H snap left +riverctl map normal Super+Alt+Control J snap down +riverctl map normal Super+Alt+Control K snap up +riverctl map normal Super+Alt+Control L snap right + +# Super+Alt+Shift+{H,J,K,L} to resize views +riverctl map normal Super+Alt+Shift H resize horizontal -100 +riverctl map normal Super+Alt+Shift J resize vertical 100 +riverctl map normal Super+Alt+Shift K resize vertical -100 +riverctl map normal Super+Alt+Shift L resize horizontal 100 + +# Tags +for i in $(seq 1 9) +do + tags=$((1 << ($i - 1))) + + # Super+[1-9] to focus tag [0-8] + riverctl map normal Super $i set-focused-tags $tags + + # Super+Shift+[1-9] to tag focused view with tag [0-8] + riverctl map normal Super+Shift $i set-view-tags $tags + + # Super+Control+[1-9] to toggle focus of tag [0-8] + riverctl map normal Super+Control $i toggle-focused-tags $tags + + # Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view + riverctl map normal Super+Shift+Control $i toggle-view-tags $tags +done + +# Super+0 to focus all tags +# Super+Shift+0 to tag focused view with all tags +all_tags=$(((1 << 32) - 1)) +riverctl map normal Super 0 set-focused-tags $all_tags +riverctl map normal Super+Shift 0 set-view-tags $all_tags + +# The scratchpad will live on an unused tag. Which tags are used depends on your +# config, but rivers default uses the first 9 tags. +scratch_tag=$((1 << 20 )) + +# Toggle the scratchpad with Super+P +riverctl map normal Super P toggle-focused-tags ${scratch_tag} + +# Send windows to the scratchpad with Super+Shift+P +riverctl map normal Super+Shift P set-view-tags ${scratch_tag} + +# Set spawn tagmask to ensure new windows don't have the scratchpad tag unless +# explicitly set. +all_but_scratch_tag=$(( ((1 << 32) - 1) ^ $scratch_tag )) +riverctl spawn-tagmask ${all_but_scratch_tag} + +# Layout +# Set the default layout generator to be rivertile and start it. +# River will send the process group of the init executable SIGTERM on exit. +riverctl default-layout rivertile +rivertile -view-padding 5 -outer-padding 5 -main-ratio 0.5 & +# Attach new windows at the bottom of the stack +riverctl default-attach-mode bottom +# Super+{Up,Right,Down,Left} to change layout orientation +riverctl map normal Super Up send-layout-cmd rivertile "main-location top" +riverctl map normal Super Right send-layout-cmd rivertile "main-location right" +riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom" +riverctl map normal Super Left send-layout-cmd rivertile "main-location left" + +# Declare a passthrough mode. This mode has only a single mapping to return to +# normal mode. This makes it useful for testing a nested wayland compositor +riverctl declare-mode passthrough + +# Super+F11 to enter passthrough mode +riverctl map normal Super F11 enter-mode passthrough + +# Super+F11 to return to normal mode +riverctl map passthrough Super F11 enter-mode normal + +# Various media key mapping examples for both normal and locked mode which do +# not have a modifier +for mode in normal locked +do + # Control volume + #riverctl map $mode None XF86AudioRaiseVolume spawn 'amixer sset Master 2%+' + riverctl map $mode None XF86AudioRaiseVolume spawn 'pactl set-sink-volume @DEFAULT_SINK@ +2%' + #riverctl map $mode None XF86AudioLowerVolume spawn 'amixer sset Master 2%-' + riverctl map $mode None XF86AudioLowerVolume spawn 'pactl set-sink-volume @DEFAULT_SINK@ -2%' + #riverctl map $mode None XF86AudioMute spawn 'amixer set Master 1+ toggle' + riverctl map $mode None XF86AudioMute spawn 'pactl set-sink-mute @DEFAULT_SINK@ toggle' + + # Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl) + # riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause' + # riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause' + # riverctl map $mode None XF86AudioPrev spawn 'playerctl previous' + # riverctl map $mode None XF86AudioNext spawn 'playerctl next' + + # Control screen backlight brightness with light (https://github.com/haikarainen/light) + riverctl map $mode None XF86MonBrightnessUp spawn 'brightnessctl -s > ~/.cache/brightness s +5' + riverctl map $mode None XF86MonBrightnessDown spawn 'brightnessctl -s > ~/.cache/brightness s 5-' +done + +# auto starting apps +bash $HOME/.config/river/autostart.sh + +# Make all views with an app-id that starts with "float" and title "foo" start floating. +riverctl rule-add -app-id 'float*' -title 'foo' float + +# Make all views with app-id "bar" and any title use client-side decorations +riverctl rule-add csd -app-id "bar" + +# Float mpv when it's started +riverctl rule-add -app-id 'mpv' float +riverctl rule-add -app-id 'libreoffice*' ssd +riverctl rule-add -app-id 'org.pwmt.zathura' ssd +riverctl rule-add -app-id 'imv' ssd +riverctl rule-add -app-id 'mpv' position 1200 650 +riverctl rule-add -app-id 'mpv' dimensions 640 360 diff --git a/.config/river/scripts/screenshot.sh b/.config/river/scripts/screenshot.sh new file mode 100755 index 0000000..c6ae433 --- /dev/null +++ b/.config/river/scripts/screenshot.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +case $1 in + selected-region) + # Take a screenshot of the selected region + grim -t png -g "$(slurp)" ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).png + ;; + save-to-clipboard) + # Take a screenshot and save it to the clipboard + grim -g "$(slurp -d)" - | wl-copy + ;; + *) + # Take a screenshot of the currently focused output and save it into screenshots + output="$(river-bedload -print outputs | jq -c '.[] | select(.focused) | .name' | awk -F'[""]' '{print $2}')" + grim -o $output -t png ~/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%m-%s).png + ;; +esac diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc new file mode 100644 index 0000000..bfc65e1 --- /dev/null +++ b/.config/zathura/zathurarc @@ -0,0 +1,39 @@ +set selection-clipboard clipboard + +# Gruvbox theme +# https://github.com/eastack/zathura-gruvbox/blob/master/zathura-gruvbox-dark +set notification-error-bg "#282828" # bg +set notification-error-fg "#fb4934" # bright:red +set notification-warning-bg "#282828" # bg +set notification-warning-fg "#fabd2f" # bright:yellow +set notification-bg "#282828" # bg +set notification-fg "#b8bb26" # bright:green + +set completion-bg "#504945" # bg2 +set completion-fg "#ebdbb2" # fg +set completion-group-bg "#3c3836" # bg1 +set completion-group-fg "#928374" # gray +set completion-highlight-bg "#83a598" # bright:blue +set completion-highlight-fg "#504945" # bg2 + +# Define the color in index mode +set index-bg "#504945" # bg2 +set index-fg "#ebdbb2" # fg +set index-active-bg "#83a598" # bright:blue +set index-active-fg "#504945" # bg2 + +set inputbar-bg "#282828" # bg +set inputbar-fg "#ebdbb2" # fg + +set statusbar-bg "#504945" # bg2 +set statusbar-fg "#ebdbb2" # fg + +set highlight-color "#fabd2f" # bright:yellow +set highlight-active-color "#fe8019" # bright:orange + +#set default-bg "#282828" # bg +set default-bg rgba(0,0,0,0.7) #bg +set default-fg "#ebdbb2" # fg +set render-loading true +set render-loading-bg "#282828" # bg +set render-loading-fg "#ebdbb2" # fg |