First commit

This commit is contained in:
CronyAkatsuki 2023-04-30 17:36:12 +02:00
commit 08c122f3fd
23 changed files with 1960 additions and 0 deletions

View file

@ -0,0 +1,72 @@
### Limit the application FPS. Comma-separated list of one or more FPS values (e.g. 0,30,60). 0 means unlimited (unless VSynced)
fps_limit=0,30,60
### Display the current GPU information
## Note: gpu_mem_clock also needs "vram" to be enabled
gpu_stats
gpu_temp
gpu_core_clock
gpu_mem_clock
gpu_power
gpu_text=GPU
gpu_load_change
gpu_load_value=60,90
gpu_load_color=39F900,FDFD09,B22222
### Display the current CPU information
cpu_stats
cpu_temp
# cpu_power
cpu_text=CPU
cpu_mhz
cpu_load_change
cpu_load_value=60,90
cpu_load_color=39F900,FDFD09,B22222
### Display IO read and write for the app (not system)
io_stats
io_read
io_write
### Display system vram / ram / swap space usage
vram
ram
swap
### Display FPS and frametime
fps
fps_sampling_period=1000
fps_color_change
fps_value=30,60
fps_color=B22222,FDFD09,39F900
frametime
# frame_count
### Display miscellaneous information
# engine_version
gpu_name
vulkan_driver
# wine
### Display GameMode / vkBasalt running status
gamemode
# vkbasalt
### Display current FPS limit
show_fps_limit
### Display the current resolution
resolution
### Change the corner roundness
round_corners=5
### Hud position offset
offset_x=15
offset_y=15
### Hud dimensions
width=275
# height=
# table_columns=3
# cellpadding_y=0

32
.config/X11/xinitrc Executable file
View file

@ -0,0 +1,32 @@
#!/bin/sh
# Enable Tear Free
xrandr --output eDP --set TearFree on
# Load xresources
xrdb --merge $HOME/.config/X11/xresources
# Disable mouse acceleration
xinput --set-prop 18 'libinput Accel Speed' 0
xinput --set-prop 18 'libinput Accel Profile Enabled' 0, 1
# Hide the mouse after 5 seconds
unclutter --timeout 5 &
# Fix mouse cursor
xsetroot -cursor_name left_ptr
# Replace caps lock with escape
setxkbmap -option caps:escape
# Use the xresources settings
xrdb -merge $HOME/.Xresources
# Recompile xmonad
xmonad --recompile
# Set wallpaper
xwallpaper --stretch $HOME/pics/wallpapers/cowppuccin.png
# Run xmonad with dbus
exec dbus-launch --exit-with-session xmonad

8
.config/X11/xresources Normal file
View file

@ -0,0 +1,8 @@
! 1.25 dpi
Xft.dpi: 120
! These might also be useful depending on your monitor and personal preference: Xft.autohint: 0 Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb

View file

@ -0,0 +1,116 @@
window:
padding:
x: 10
y: 10
dynamic_padding: true
startup_mode: Maximized
dynamic_title: true
opacity: 1
font:
normal:
family: IBMPlex Mono
style: Regular
bold:
family: IBMPlex Mono
style: Bold
italic:
family: IBMPlex Mono
style: Italic
bold_italic:
family: IBMPlex Mono
style: Bold Italic
size: 11
builtin_box_drawing: true
colors:
# Default colors
primary:
background: "#303446" # base
foreground: "#C6D0F5" # text
# Bright and dim foreground colors
dim_foreground: "#C6D0F5" # text
bright_foreground: "#C6D0F5" # text
# Cursor colors
cursor:
text: "#303446" # base
cursor: "#F2D5CF" # rosewater
vi_mode_cursor:
text: "#303446" # base
cursor: "#BABBF1" # lavender
# Search colors
search:
matches:
foreground: "#303446" # base
background: "#A5ADCE" # subtext0
focused_match:
foreground: "#303446" # base
background: "#A6D189" # green
footer_bar:
foreground: "#303446" # base
background: "#A5ADCE" # subtext0
# Keyboard regex hints
hints:
start:
foreground: "#303446" # base
background: "#E5C890" # yellow
end:
foreground: "#303446" # base
background: "#A5ADCE" # subtext0
# Selection colors
selection:
text: "#303446" # base
background: "#F2D5CF" # rosewater
# Normal colors
normal:
black: "#51576D" # surface1
red: "#E78284" # red
green: "#A6D189" # green
yellow: "#E5C890" # yellow
blue: "#8CAAEE" # blue
magenta: "#F4B8E4" # pink
cyan: "#81C8BE" # teal
white: "#B5BFE2" # subtext1
# Bright colors
bright:
black: "#626880" # surface2
red: "#E78284" # red
green: "#A6D189" # green
yellow: "#E5C890" # yellow
blue: "#8CAAEE" # blue
magenta: "#F4B8E4" # pink
cyan: "#81C8BE" # teal
white: "#A5ADCE" # subtext0
# Dim colors
dim:
black: "#51576D" # surface1
red: "#E78284" # red
green: "#A6D189" # green
yellow: "#E5C890" # yellow
blue: "#8CAAEE" # blue
magenta: "#F4B8E4" # pink
cyan: "#81C8BE" # teal
white: "#B5BFE2" # subtext1
indexed_colors:
- { index: 16, color: "#EF9F76" }
- { index: 17, color: "#F2D5CF" }

115
.config/dunst/dunstrc Normal file
View file

@ -0,0 +1,115 @@
[global]
monitor = 0
follow = none
width = (0,300)
height = (0,300)
origin = top-right
offset = 10x31
scale = 0
notification_limit = 0
progress_bar = true
progress_bar_height = 10
progress_bar_frame_width = 1
progress_bar_min_width = 150
progress_bar_max_width = 300
indicate_hidden = no
transparency = 0
separator_height = 1
padding = 12
horizontal_padding = 14
text_icon_padding = 20
frame_width = 2
frame_color = "#aac3bf"
separator_color = frame
sort = yes
font = JetBrainsMono Nerd Font 10
line_height = 0
markup = full
format = "<b>%s</b>\n%b"
alignment = left
vertical_alignment = center
show_age_threshold = 30
ellipsize = middle
ignore_newline = no
stack_duplicates = true
hide_duplicate_count = true
show_indicators = yes
icon_position = left
min_icon_size = 0
max_icon_size = 64
icon_path = /usr/share/icons/Papirus-Dark/16x16/actions:/usr/share/icons/Adwaita/16x16/devices/
sticky_history = no
history_length = 10
dmenu = /usr/bin/dmenu -p dunst:
browser = /usr/bin/xdg-open
always_run_script = true
title = Dunst
class = Dunst
corner_radius = 0
ignore_dbusclose = false
force_xwayland = false
[global]
frame_color = "#8CAAEE"
separator_color= frame
[urgency_low]
background = "#303446"
foreground = "#C6D0F5"
[urgency_normal]
background = "#303446"
foreground = "#C6D0F5"
[urgency_critical]
background = "#303446"
foreground = "#C6D0F5"
frame_color = "#EF9F76"

100
.config/gamemode.ini Normal file
View file

@ -0,0 +1,100 @@
[general]
; The reaper thread will check every 5 seconds for exited clients, for config file changes, and for the CPU/iGPU power balance
reaper_freq=5
; The desired governor is used when entering GameMode instead of "performance"
; desiredgov=schedutil
desiredgov=performance
; The default governor is used when leaving GameMode instead of restoring the original value
;defaultgov=powersave
; The iGPU desired governor is used when the integrated GPU is under heavy load
; igpu_desiredgov=powersave
; Threshold to use to decide when the integrated GPU is under heavy load.
; This is a ratio of iGPU Watts / CPU Watts which is used to determine when the
; integraged GPU is under heavy enough load to justify switching to
; igpu_desiredgov. Set this to -1 to disable all iGPU checking and always
; use desiredgov for games.
igpu_power_threshold=-1
; GameMode can change the scheduler policy to SCHED_ISO on kernels which support it (currently
; not supported by upstream kernels). Can be set to "auto", "on" or "off". "auto" will enable
; with 4 or more CPU cores. "on" will always enable. Defaults to "off".
softrealtime=auto
; GameMode can renice game processes. You can put any value between 0 and 20 here, the value
; will be negated and applied as a nice value (0 means no change). Defaults to 0.
renice=10
; By default, GameMode adjusts the iopriority of clients to BE/0, you can put any value
; between 0 and 7 here (with 0 being highest priority), or one of the special values
; "off" (to disable) or "reset" (to restore Linux default behavior based on CPU priority),
; currently, only the best-effort class is supported thus you cannot set it here
ioprio=0
; Sets whether gamemode will inhibit the screensaver when active
; Defaults to 1
inhibit_screensaver=1
[filter]
; If "whitelist" entry has a value(s)
; gamemode will reject anything not in the whitelist
;whitelist=RiseOfTheTombRaider
; Gamemode will always reject anything in the blacklist
;blacklist=HalfLife3
; glxgears
[gpu]
; Here Be Dragons!
; Warning: Use these settings at your own risk
; Any damage to hardware incurred due to this feature is your responsibility and yours alone
; It is also highly recommended you try these settings out first manually to find the sweet spots
; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks
;apply_gpu_optimisations=0
; The DRM device number on the system (usually 0), ie. the number in /sys/class/drm/card0/
;gpu_device=0
; Nvidia specific settings
; Requires the coolbits extension activated in nvidia-xconfig
; This corresponds to the desired GPUPowerMizerMode
; "Adaptive"=0 "Prefer Maximum Performance"=1 and "Auto"=2
; See NV_CTRL_GPU_POWER_MIZER_MODE and friends in https://github.com/NVIDIA/nvidia-settings/blob/master/src/libXNVCtrl/NVCtrl.h
;nv_powermizer_mode=1
; These will modify the core and mem clocks of the highest perf state in the Nvidia PowerMizer
; They are measured as Mhz offsets from the baseline, 0 will reset values to default, -1 or unset will not modify values
;nv_core_clock_mhz_offset=0
;nv_mem_clock_mhz_offset=0
; AMD specific settings
; Requires a relatively up to date AMDGPU kernel module
; See: https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring
; It is also highly recommended you use lm-sensors (or other available tools) to verify card temperatures
; This corresponds to power_dpm_force_performance_level, "manual" is not supported for now
;amd_performance_level=high
[supervisor]
; This section controls the new gamemode functions gamemode_request_start_for and gamemode_request_end_for
; The whilelist and blacklist control which supervisor programs are allowed to make the above requests
;supervisor_whitelist=
;supervisor_blacklist=
; In case you want to allow a supervisor to take full control of gamemode, this option can be set
; This will only allow gamemode clients to be registered by using the above functions by a supervisor client
;require_supervisor=0
[custom]
; Custom scripts (executed using the shell) when gamemode starts and ends
start=notify-send "Gamemode" "Started"
; wlr-randr --output eDP-1 --scale 1
; /home/me/bin/stop_ethmining.sh
end=notify-send "Gamemode" "Stoped"
; wlr-randr --output eDP-1 --scale 1.25
; /home/me/bin/start_ethmining.sh
; Timeout for scripts (seconds). Scripts will be killed if they do not complete within this time.
script_timeout=10

25
.config/mpv/mpv.conf Normal file
View file

@ -0,0 +1,25 @@
# multiple codecs with the easiest to run being prefered and vp9 disabled with limit to 1080p and 60 fps
ytdl-format="bestvideo[fps<=?60][height<=?1080][vcodec!=vp9]+bestaudio/best"
# fullscreen and show window immediatly
fs
force-window=immediate
# making playback be as smooth as possible f**k quility
scale=bilinear
cscale=bilinear
dscale=bilinear
scale-antiring=0
cscale-antiring=0
dither-depth=no
correct-downscaling=no
sigmoid-upscaling=no
deband=no
# hwdec=auto
# gpu-api=vulkan
# vo=gpu-next
# nice screenshots
screenshot-template="%F - [%P]v%#01n"
# Subtitles loading on crack
sub-file-paths=Subs;subs
sub-auto=all
slang=english,eng,en

38
.config/newsboat/config Normal file
View file

@ -0,0 +1,38 @@
# unbind keys
unbind-key ENTER
unbind-key j
unbind-key k
unbind-key J
unbind-key K
# bind keys - vim style
bind-key j down
bind-key k up
bind-key l open
bind-key h quit
bind-key g home
bind-key G end
bind-key a toggle-article-read
# bind-key D pb-download
# bind-key U show-urls
# bind-key x pb-delete
auto-reload yes
reload-threads 50
confirm-mark-feed-read yes
prepopulate-query-feeds yes
browser "dmenu-link-handler $U"
include ~/.config/newsboat/dark
urls-source "miniflux"
miniflux-url "https://feed.cronyakatsuki.xyz/"
miniflux-login "crony"
miniflux-passwordeval "news-pass"
miniflux-min-items 0
download-path "~/downs"
max-downloads 2
player "mpv"

11
.config/newsboat/urls Normal file
View file

@ -0,0 +1,11 @@
"query:Unread:unread = \"yes\""
"query:Arch Linux Unread:tags # \"Arch\" and unread = \"yes\"
"query:Blogs:tags # \"Blogs\" and unread = \"yes\"
"query:Software:tags # \"Software\" and unread = \"yes\"
"query:Podcast's:tags # \"Podcast's\" and unread = \"yes\"
"query:YouTube:tags # \"YouTube\" and unread = \"yes\"

13
.config/starship.toml Normal file
View file

@ -0,0 +1,13 @@
# Inserts a blank line between shell prompts
add_newline = false
# Replace the "" symbol in the prompt with "➜"
# [character] # The name of the module we are configuring is "character"
# success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green"
# Disable the package module, hiding it from the prompt completely
[package]
disabled = false
[cmd_duration]
min_time = 500

77
.config/sxhkd/general Executable file
View file

@ -0,0 +1,77 @@
#!/usr/bin/env sh
# power menu
super + shift + e
dmenu-power-menu
# Reload sxhkd
super + control + r
pkill -USR1 -x sxhkd
##---System Control---##
# Audio Control
{XF86AudioRaiseVolume,XF86AudioLowerVolume,XF86AudioMute}
sb-volume-update { up, down, mute }
# Brightness
{XF86MonBrightnessUp,XF86MonBrightnessDown}
sb-backlight-update { up, down }
# Player control keybindings
{XF86AudioPlay,XF86AudioPrev,XF86AudioNext}
dmenu-playerctl {play-pause,previous,next}
##---Aplication Launchers---##
# terminal
super + Return
$TERMINAL
# Browser run
# super + {_, shift + }b
super + b
librewolf
# {$BROWSER, librewolf -P unsecure}
# Gui Programs
super g; l
slock
# Terminal Programs with class
super + t; {n,v,f,y}
$TERMINAL --class {newsboat\,newsboat -e newsboat,\
videos\,videos -e lfrun ~/vids, lf\,lf -e lf-run, ytfzf\,ytfzf -e ytfzf}
##---Dmenu bindings---#
# Key chaining some certain scripts
super + p; {g,e,t,u,w,d,k,l,b}
{dmenu-games, dmenu-configs, dmenu-transmission, dmenu-usb-man,\
dmenu-wifi, dmenu-runner, dmenu-kill,\
dmenu-link-handler $(xclip -sel c -o), dmenu-browser}
# Regular binding some other one's
super + {d,F12,c}
{dmenu_run, dmenu-ryzenadj, clipmenu -l 10}
Print
dmenu-screenshot
##---Gaming bindings---##
super + shift + F12
gaming-time
##---Buku bindings---##
alt + b; {a,o,e,d}
{badd, dmenu-buku open, dmenu-buku edit, dmenu-buku delete}
##---Sripts---##
super + F1
sound-output-toggle
super + F2
recorder
super + F3
bash -c 'killall xdotool || while xdotool key --repeat 100 --delay 100 Enter; do :; done'

43
.config/task/taskrc Normal file
View file

@ -0,0 +1,43 @@
# [Created by task 2.6.2 12/5/2022 09:47:39]
# Taskwarrior program configuration file.
# For more documentation, see https://taskwarrior.org or try 'man task', 'man task-color',
# 'man task-sync' or 'man taskrc'
# Here is an example of entries that use the default, override and blank values
# variable=foo -- By specifying a value, this overrides the default
# variable= -- By specifying no value, this means no default
# #variable=foo -- By commenting out the line, or deleting it, this uses the default
# You can also refence environment variables:
# variable=$HOME/task
# variable=$VALUE
# Use the command 'task show' to see all defaults and overrides
# Files
# data.location=/home/crony/.task
# To use the default location of the XDG directories,
# move this configuration file from ~/.taskrc to ~/.config/task/taskrc and uncomment below
data.location=~/.local/share/task
hooks.location=~/.config/task/hooks
# Color theme (uncomment one to use)
#include light-16.theme
#include light-256.theme
#include dark-16.theme
#include dark-256.theme
#include dark-red-256.theme
#include dark-green-256.theme
include dark-blue-256.theme
#include dark-violets-256.theme
#include dark-yellow-green.theme
#include dark-gray-256.theme
#include dark-gray-blue-256.theme
#include solarized-dark-256.theme
#include solarized-light-256.theme
#include no-color.theme
news.version=2.6.0
recurrence.confirmation=no

8
.config/user-dirs.dirs Normal file
View file

@ -0,0 +1,8 @@
XDG_DESKTOP_DIR="$HOME/.local/share/desktop"
XDG_DOWNLOAD_DIR="$HOME/downs"
XDG_TEMPLATES_DIR="$HOME/.local/share/templates"
XDG_PUBLICSHARE_DIR="$HOME/.local/share/public"
XDG_DOCUMENTS_DIR="$HOME/docs"
XDG_MUSIC_DIR="$HOME/music"
XDG_PICTURES_DIR="$HOME/pics"
XDG_VIDEOS_DIR="$HOME/vids"

View file

@ -0,0 +1,52 @@
#!/bin/sh
# Copied from https://github.com/jaor/xmobar/issues/239#issuecomment-233206552
# Detects the width of running trayer-srg window (xprop name 'panel')
# and creates an XPM icon of that width, 1px height, and transparent.
# Outputs an <icon>-tag for use in xmobar to display the generated
# XPM icon.
#
# Run script from xmobar:
# `Run Com "/where/ever/trayer-padding-icon.sh" [] "trayerpad" 10`
# and use `%trayerpad%` in your template.
# Function to create a transparent Wx1 px XPM icon
create_xpm_icon () {
timestamp=$(date)
pixels=$(for i in `seq $1`; do echo -n "."; done)
cat << EOF > "$2"
/* XPM *
static char * trayer_pad_xpm[] = {
/* This XPM icon is used for padding in xmobar to */
/* leave room for trayer-srg. It is dynamically */
/* updated by by trayer-padding-icon.sh which is run */
/* by xmobar. */
/* Created: ${timestamp} */
/* <w/cols> <h/rows> <colors> <chars per pixel> */
"$1 1 1 1",
/* Colors (none: transparent) */
". c none",
/* Pixels */
"$pixels"
};
EOF
}
# Width of the trayer window
width=$(xprop -name panel | grep 'program specified minimum size' | cut -d ' ' -f 5)
# Icon file name
iconfile="/tmp/trayer-padding-${width}px.xpm"
# If the desired icon does not exist create it
if [ ! -f $iconfile ]; then
create_xpm_icon $width $iconfile
fi
if [ "$width" -gt "5" ]; then
# Output the icon tag for xmobar
echo "<fc=#eba0ac>•</fc><icon=${iconfile}/>"
else
echo "<icon=${iconfile}/>"
fi

20
.config/xmobar/xmobarrc Normal file
View file

@ -0,0 +1,20 @@
Config { lowerOnStart = True
, overrideRedirect = True
, font = "xft:IBMPlex Mono:size=10:antialias=true,IpaGothic:size=11:antialias,Symbols Nerd Font:size=10"
, bgColor = "#303446"
, fgColor = "#c6d0f5"
, position = TopSize L 100 27
, commands = [ Run Cpu
[ "--template", " <total>%"] 90
, Run Com "sb-cpu-temp" [] "cpu-temp" 100
, Run Com "sb-battery" [] "battery" 300
, Run Com "sb-ram" [] "memory" 150
, Run Com "sb-disk-space" [] "disk" 360000
, Run Com "sb-datetime" [] "date" 200
, Run Com "sb-wifi" [] "wifi" 50
, Run Com "/home/crony/.config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 100
, Run XMonadLog
]
, sepChar = "%"
, alignSep = "}{"
, template = " %XMonadLog% }{ %cpu-temp% <fc=#eba0ac>•</fc> %cpu% <fc=#eba0ac>•</fc> %memory% <fc=#eba0ac>•</fc> %disk% <fc=#eba0ac>•</fc> %wifi% <fc=#eba0ac>•</fc> %battery% <fc=#eba0ac>•</fc> %date% %trayerpad%" }

281
.config/xmonad/xmonad.hs Normal file
View file

@ -0,0 +1,281 @@
-- Base
import XMonad
import System.Exit
import qualified XMonad.StackSet as W
-- Actions
import XMonad.Actions.CycleWS (toggleWS')
import XMonad.Actions.MouseResize
-- Data
import qualified Data.Map as M
import Data.Maybe (isJust)
-- Hooks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.SetWMName
import XMonad.Hooks.InsertPosition
-- Layout modifiers
import XMonad.Layout.Renamed
import XMonad.Layout.Spacing
import XMonad.Layout.NoBorders
import XMonad.Layout.SimplestFloat
import XMonad.Layout.LayoutModifier
import XMonad.Layout.ResizableTile
import XMonad.Layout.WindowNavigation
import XMonad.Layout.PerWorkspace
import XMonad.Layout.WindowArranger (windowArrange, WindowArrangerMsg(..))
-- Utils
import XMonad.Util.Loggers
import XMonad.Util.NamedScratchpad
import XMonad.Util.SpawnOnce
import XMonad.Util.EZConfig
import XMonad.Util.Hacks
-- main loop
main :: IO ()
main = xmonad
. ewmhFullscreen
. ewmh
. withEasySB (statusBarProp "xmobar ~/.config/xmobar/xmobarrc" (pure myXmobarPP)) toggleStrutsKey
$ myConfig
where
toggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym)
toggleStrutsKey XConfig{ modMask = m } = (m, xK_F11)
-- My config
myConfig = def
{ modMask = myModMask
, layoutHook = myLayoutHook
, manageHook = myManageHook
, handleEventHook = trayerAboveXmobarEventHook
, focusFollowsMouse = myFocusFollowsMouse
, terminal = myTerminal
, borderWidth = myBorderWidth
, normalBorderColor = myNormalBorderColor
, focusedBorderColor = myFocusedBorderColor
, keys = myKeys
, workspaces = myWorkspaces
, startupHook = myStartupHook
}
-- My variables
myModMask = mod4Mask
myTerminal = "alacritty"
myBorderWidth = 2
myFocusFollowsMouse :: Bool
myFocusFollowsMouse = False
myNormalBorderColor = "#737994"
myFocusedBorderColor = "#c6d0f5"
myWorkspaces = ["","","","","","","","",""]
-- My startup hook
myStartupHook :: X ()
myStartupHook = do
spawn "killall trayer-srg" -- kill current trayer on each restart
spawnOnce "sxhkd -c $HOME/.config/sxhkd/general"
spawnOnce "gentoo-pipewire-launcher"
-- spawnOnce "transmission-daemon"
spawnOnce "syncthing"
-- spawnOnce "lxsession"
-- spawnOnce "picom"
-- spawnOnce "clipmenud"
spawnOnce "dunst"
-- spawnOnce "discord --start-minimized"
spawnOnce "keepassxc"
spawn ("sleep 2 && trayer-srg --edge top --align right --widthtype request --padding 6 --iconspacing 7 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --transparent true --alpha 0 --tint 0x303446 --height 27 -l")
setWMName "LG3D" -- Fix java programs
-- My scratchpads
myScratchPads :: [NamedScratchpad]
myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm
, NS "wiki" spawnWiki findWiki manageWiki
, NS "notes" spawnNotes findNotes manageNotes
]
where
spawnTerm = myTerminal ++ " --class scratchpad,scratchpad"
findTerm = className =? "scratchpad"
manageTerm = customFloating $ W.RationalRect l t w h
where
h = 0.8
w = 0.8
t = 0.9 -h
l = 0.9 -w
spawnWiki = myTerminal ++ " -class wiki,wiki -e wiki"
findWiki = className =? "wiki"
manageWiki = customFloating $ W.RationalRect l t w h
where
h = 0.8
w = 0.8
t = 0.9 -h
l = 0.9 -w
spawnNotes = myTerminal ++ " -class wiki,wiki -e notes"
findNotes = className =? "notes"
manageNotes = customFloating $ W.RationalRect l t w h
where
h = 0.8
w = 0.8
t = 0.9 -h
l = 0.9 -w
--Makes setting the spacingRaw simpler to write. The spacingRaw module adds a configurable amount of space around windows.
mySpacing :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a
mySpacing i = spacingRaw False (Border i i i i) True (Border i i i i) True
-- Below is a variation of the above except no borders are applied
-- if fewer than two windows. So a single window has no gaps.
mySpacing' :: Integer -> l a -> XMonad.Layout.LayoutModifier.ModifiedLayout Spacing l a
mySpacing' i = spacingRaw True (Border i i i i) True (Border i i i i) True
-- My layouts
tall = renamed [Replace "tall"]
$ withBorder myBorderWidth
$ windowNavigation
$ mySpacing 6
$ ResizableTall 1 (3/100) (1/2) []
monocle = renamed [Replace "monocle"]
$ withBorder myBorderWidth
$ mySpacing 6
$ windowNavigation
$ Full
floats = renamed [Replace "floats"]
$ withBorder myBorderWidth
$ simplestFloat
myLayoutHook = lessBorders OnlyScreenFloat
$ mouseResize
$ windowArrange
$ myDefaultLayout
where
myDefaultLayout = onWorkspaces [(myWorkspaces !! 0), (myWorkspaces !! 3), (myWorkspaces !! 4)] (monocle ||| floats ||| tall)
$ onWorkspace (myWorkspaces !! 5) (floats ||| tall ||| monocle)
$ tall
||| monocle
||| floats
-- My manage hook
myManageHook :: ManageHook
myManageHook = composeAll
[ className =? "LibreWolf" --> doShiftAndGo ( myWorkspaces !! 0)
, className =? "newsboat" --> doShiftAndGo ( myWorkspaces !! 3)
, className =? "videos" --> doShiftAndGo ( myWorkspaces !! 3)
, className =? "ytfzf" --> doShiftAndGo ( myWorkspaces !! 3)
, className =? "lf" --> doShiftAndGo ( myWorkspaces !! 3)
, className =? "thunderbird" --> doShiftAndGo ( myWorkspaces !! 4)
, className =? "Ferdium" --> doShiftAndGo ( myWorkspaces !! 4)
, className =? "discord" --> doShiftAndGo ( myWorkspaces !! 4)
, className =? "tutanota-desktop" --> doShiftAndGo ( myWorkspaces !! 4)
, className =? "Lutris" --> doShiftAndGo ( myWorkspaces !! 5) <+> doF W.swapUp
, className =? "Steam" --> doShiftAndGo ( myWorkspaces !! 5)
, className =? "heroic" --> doShiftAndGo ( myWorkspaces !! 5)
, isDialog --> doCenterFloat <+> doF W.swapUp
, className =? "Gimp" --> doFloat
, className =? "confirm" --> doFloat
, className =? "file_progress" --> doFloat
, className =? "dialog" --> doFloat
, className =? "download" --> doFloat
, className =? "error" --> doFloat
, className =? "notification" --> doFloat
, className =? "splash" --> doFloat
, className =? "toolbar" --> doFloat
, className =? "pinentry-gtk-2" --> doFloat
, className =? "Yad" --> doCenterFloat
, className =? "badd" --> doCenterFloat
, isFullscreen --> doFullFloat <+> doF W.swapUp
, namedScratchpadManageHook myScratchPads
]
where
doShiftAndGo ws = doF (W.greedyView ws) <+> doShift ws
-- My keybindings in a nice readable format
myKeys = \c -> mkKeymap c $
[ ("M-S-q", kill) -- kill active window
, ("M-<Space>", sendMessage NextLayout) -- cycle layout
, ("M-S-<Space>", withFocused toggleFloat) -- toggle floating state of a window
, ("M-j", windows W.focusDown) -- Move focus down
, ("M-k", windows W.focusUp) -- Move focus up
, ("M-S-<Return>", windows W.swapMaster) -- Move Focused window to master
, ("M-S-j", windows W.swapDown) --Move window down the stack
, ("M-S-k", windows W.swapUp) -- Move window up the stack
, ("M-h", sendMessage Shrink) -- Shrink master
, ("M-l", sendMessage Expand) -- Expand master
, ("M-,", sendMessage (IncMasterN 1)) -- Increase master count
, ("M-.", sendMessage (IncMasterN (-1))) -- Decrease msaster count
, ("M-C-e", io (exitWith ExitSuccess)) -- Quit xmonad
, ("M-S-r", spawn "xmonad --recompile && xmonad --restart") -- Restart xmonad
, ("M-<Tab>", toggleWS' ["NSP"]) -- Toogle last used workspace, ignoring named scratchpad
, ("M-s t", namedScratchpadAction myScratchPads "terminal") -- Toggle scratchpad
, ("M-s w", namedScratchpadAction myScratchPads "wiki") -- Toggle scratchpad
, ("M-s n", namedScratchpadAction myScratchPads "notes") -- Toggle scratchpad
, ("M-1", viewDesktop 0) -- Check workspace 1
, ("M-2", viewDesktop 1) -- Check workspace 2
, ("M-3", viewDesktop 2) -- Check workspace 3
, ("M-4", viewDesktop 3) -- Check workspace 4
, ("M-5", viewDesktop 4) -- Check workspace 5
, ("M-6", viewDesktop 5) -- Check workspace 6
, ("M-7", viewDesktop 6) -- Check workspace 7
, ("M-8", viewDesktop 7) -- Check workspace 8
, ("M-9", viewDesktop 8) -- Check workspace 9
, ("M-S-1", shiftWindow 0) -- Send window to workspace 1
, ("M-S-2", shiftWindow 1) -- Send window to workspace 2
, ("M-S-3", shiftWindow 2) -- Send window to workspace 3
, ("M-S-4", shiftWindow 3) -- Send window to workspace 4
, ("M-S-5", shiftWindow 4) -- Send window to workspace 5
, ("M-S-6", shiftWindow 5) -- Send window to workspace 6
, ("M-S-7", shiftWindow 6) -- Send window to workspace 7
, ("M-S-8", shiftWindow 7) -- Send window to workspace 8
, ("M-S-9", shiftWindow 8) -- Send window to workspace 9
, ("M-C-1", shiftAndView 0) -- Send window and check workspace 1
, ("M-C-2", shiftAndView 1) -- Send window and check workspace 2
, ("M-C-3", shiftAndView 2) -- Send window and check workspace 3
, ("M-C-4", shiftAndView 3) -- Send window and check workspace 4
, ("M-C-5", shiftAndView 4) -- Send window and check workspace 5
, ("M-C-6", shiftAndView 5) -- Send window and check workspace 6
, ("M-C-7", shiftAndView 6) -- Send window and check workspace 7
, ("M-C-8", shiftAndView 7) -- Send window and check workspace 8
, ("M-C-9", shiftAndView 8) -- Send window and check workspace 9
]
where
toggleFloat w = windows (\s -> if M.member w (W.floating s)
then W.sink w s
else (W.float w (W.RationalRect (1/6) (1/6) (2/3) (2/3)) s))
viewDesktop d = windows $ W.greedyView $ myWorkspaces !! d
shiftWindow w = windows $ W.shift $ myWorkspaces !! w
shiftAndView w = windows $ W.greedyView (myWorkspaces !! w) . W.shift (myWorkspaces !! w)
-- My xmobar workspace and other things config
myXmobarPP :: PP
myXmobarPP = filterOutWsPP ["NSP"]
$ def
{ ppSep = magenta ""
, ppWsSep = " "
, ppTitleSanitize = xmobarStrip
, ppCurrent = xmobarBorder "Bottom" "#89b4fa" 2
, ppHidden = white
, ppHiddenNoWindows = lowWhite
, ppUrgent = red . wrap (yellow "!") (yellow "!")
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where
formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 25
blue, lowWhite, magenta, red, white, yellow :: String -> String
magenta = xmobarColor "#eba0ac" ""
blue = xmobarColor "#cba6f7" ""
white = xmobarColor "#cdd6f4" ""
yellow = xmobarColor "#f9e2af" ""
red = xmobarColor "#f38ba8" ""
lowWhite = xmobarColor "#585b70" ""

14
.config/zsh/.zprofile Executable file
View file

@ -0,0 +1,14 @@
export QT_QPA_PLATFORMTHEME=qt5ct
# Path exprt (.zshenv method doesn't work with gentoo for no real reason)
typeset -U PATH path
path=("$HOME/.local/bin" "$HOME/bin/dmenu/" "$HOME/bin/gaming/" "$HOME/bin/statusbar/" "$HOME/bin/misc/" "$HOME/bin/wayland" "$HOME/bin/fzf" "$HOME/bin/bspwm" "$path[@]")
export PATH
export SXHKD_SHELL='/bin/sh'
[[ $(fgconsole 2>/dev/null) == 1 ]] && exec startx $HOME/.config/X11/xinitrc &> /dev/null
# [[ $(fgconsole 2>/dev/null) == 1 ]] && exec start-river &> /dev/null
# [[ $(fgconsole 2>/dev/null) == 1 ]] && exec start-hyprland &> /dev/null
eval "$(ssh-agent -s)" &> /dev/null

39
.config/zsh/.zshrc Executable file
View file

@ -0,0 +1,39 @@
#!/bin/sh
pfetch
eval "$(starship init zsh)"
[ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh"
zstyle ':completion:*' rehash true
# Plugins
plug "kutsan/zsh-system-clipboard"
plug "hlissner/zsh-autopair"
plug "zap-zsh/supercharge"
plug "zap-zsh/completions"
plug "zap-zsh/vim"
plug "zsh-users/zsh-autosuggestions"
plug "zsh-users/zsh-completions"
plug "zsh-users/zsh-syntax-highlighting"
# Plugin settings
if [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
ZSH_SYSTEM_CLIPBOARD_METHOD="xsc"
else
ZSH_SYSTEM_CLIPBOARD_METHOD="wlc"
fi
# Local source
plug "$XDG_CONFIG_HOME/zsh/aliases.zsh"
plug "$XDG_CONFIG_HOME/zsh/functions.zsh"
# History settings
setopt appendhistory
setopt INC_APPEND_HISTORY
export HISTTIMEFORMAT="[%F %T]"
# HISTSIZE=10000
# SAVEHIST=5000
HISTFILE="$XDG_STATE_HOME"/zsh/history

69
.config/zsh/aliases.zsh Executable file
View file

@ -0,0 +1,69 @@
#!/bin/sh
# Check ssd state
alias ssd-check="sudo smartctl -a /dev/nvme0n1 | grep -E -- 'Data Units Read:|Data Units Written:|Percentage Used:'"
# Adding colours to some of the regulas shit
alias grep='grep --color=auto'
alias ls='/usr/bin/exa -lab --icons --group-directories-first --git --no-time'
alias cp='cp -iv'
alias rm='rm -iv'
alias mkd='mkdir -pv'
alias tree='tree -C'
alias less='less -R'
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
# Git aliases
alias g='git'
alias gst='git status -s'
alias gc='git commit'
alias ga='git add'
alias gpl="git pull"
alias gpom="git pull origin master"
alias gpu="git push"
alias gpuom="git push origin master"
alias gd="git diff"
alias gch="git checkout"
alias gnb="git checkout -b"
alias gac="git add . && git commit"
alias grs="git restore --staged ."
alias gre="git restore"
alias gr="git remote"
alias gcl="git clone"
alias glg="git log --graph --abbrev-commit --decorate --format=format:'%C(bold green)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold yellow)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
alias gt="git ls-tree -r master --name-only"
alias grm="git remote"
alias gb="git branch"
alias gf="git fetch"
# Easier to type
alias vi='nvim'
# Humna readable + better output
alias df='df -h -x devtmpfs -x tmpfs -x usbfs -x loop'
alias free='free -m -h'
# speed up
alias spotdl='spotdl --output-format ogg -p "{artist}/{album}/{artists} - {title}.{ext}" --dt 8 --st 8'
# Just cause I can't remember the command at all
alias update-grub='doas grub-mkconfig -o /boot/grub/grub.cfg'
# Quickly see the hogger in the directory
alias dust='du -hd1 | sort -hr | sed "s/.\///g" | sed "/\.$/d"'
# Who want to remember this long ass commands
alias yta='yt-dlp -x -f bestaudio --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --audio-format vorbis -o "%(title)s.%(ext)s"'
alias ytvb='yt-dlp --merge-output-format mp4 -f "bestvideo+bestaudio[ext=m4a]/best" --embed-thumbnail --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --add-metadata -o "%(title)s.%(ext)s"'
alias ytvf='yt-dlp --merge-output-format mp4 --format best --embed-thumbnail --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --add-metadata -o "%(title)s.%(ext)s"'
# Nice
alias dl='aria2c -j 16 -s 16 -x 16 -k 5M --file-allocation=none'
# ;)
alias lf='lfrun $@'
alias b='buku --suggest'
# cryptography
alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'"

86
.config/zsh/functions.zsh Executable file
View file

@ -0,0 +1,86 @@
#!/bin/sh
# Cd into a directory using fzf
fcd () {
dir=$(fd -a --type d --hidden --exclude ".git|.github" | fzf --prompt "Choose directory: ")
[ -z $dir ] && return 1
cd $dir
}
# Remove choosed stuff
frm () {
remove=$(fd --hidden --maxdepth 1 | fzf -m --prompt "Choose to delete: ")
[ -z $remove ] && return 1
rm -rf $(printf '%s' $remove)
}
# Quicly choose stuff to add using fzf
fga () {
git add $(git status -s | awk '{ print $2 }' | fzf -m)
}
# Open a script in path with vim quicly
vish () {
nvim $(which $1)
}
# Create a directory and change into it
md () {
mkdir -p "$@" && cd "$@"
}
# Move a file and create a link in it's place
mvln () {
from=$(readlink -f $1)
to=$(readlink -f $2)
mv $from $to
ln -s $to $from
}
# Find my script and let me edit them
se() {
fd . ~/bin -L --type f --color=never | fzf --prompt "Choose script to edit: " \
--preview 'bat --color=always --style=plain --pager=never {}' | xargs -r $EDITOR
}
# List my config and open the dir in a editor
ce() {
fd . ~/.config -L --maxdepth 1 --color=never | fzf --prompt \
"Choose config to edit: " --preview 'tree -a -C {}' | xargs -r $EDITOR
}
# List files in a directory and edit choosen one
vf(){
fd -L --maxdepth 1 --type f --color=never --hidden | fzf --prompt "Choose script to edit: " \
--preview 'bat --color=always --style=plain --pager=never {}' | xargs -r $EDITOR
}
# history search
h() {
print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed -E 's/ *[0-9]*\*? *//' | sed -E 's/\\/\\\\/g')
}
# Copy current working directory
cpdir() {
pwd | tr -d "\r\n" | xclip -sel c
}
# Copy content of a file.
cf() {
cat $1 | xclip -sel c
}
# Open a bookmark from buku in browser
fb() {
buku --nostdin -p -f5 | fzf | cut -f1 | xargs -r buku --nostdin -o
}
# Extract all archive in current path and remove the archive
erm() {
for file in *.zip; do
printf '%s\n' "Extracting $file"
unzip $file
rm -f $file
printf '%s\n' ""
done
}