add bar config

main
hashirama 2024-03-02 17:22:03 -04:00
parent 70c1b057ab
commit bd7f479931
No known key found for this signature in database
GPG Key ID: 53E62470A86BC185
18 changed files with 901 additions and 13 deletions

259
.config/polybar/config.ini Normal file
View File

@ -0,0 +1,259 @@
[global/wm]
monitor-allow-redirect = true
[bar/top-monitor-1]
monitor = HDMI-A-0
font-0 = HanaMinA Regular:size=10;1
pseudo-transparency = true
background = #2e3440
foreground = #eceff4
modules-left = temperature
modules-center = title
modules-right = date
[module/date]
type = custom/script
exec = ~/.local/bin/date.sh
interval = 600
label = %output%
[module/memory]
type = internal/memory
; Seconds to sleep between updates
; Default: 1
interval = 3
; Default: 90
; New in version 3.6.0
warn-percentage = 95
; Available tags:
; <label> (default)
; <bar-used>
; <bar-free>
; <ramp-used>
; <ramp-free>
; <bar-swap-used>
; <bar-swap-free>
; <ramp-swap-used>
; <ramp-swap-free>
format = <label>
; Format used when RAM reaches warn-percentage
; If not defined, format is used instead.
; Available tags:
; <label-warn>
; <bar-used>
; <bar-free>
; <ramp-used>
; <ramp-free>
; <bar-swap-used>
; <bar-swap-free>
; <ramp-swap-used>
; <ramp-swap-free>
; New in version 3.6.0
;format-warn = <label-warn>
; Available tokens:
; %percentage_used% (default)
; %percentage_free%
; %used% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %free% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %total% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %gb_used%
; %gb_free%
; %gb_total%
; %mb_used%
; %mb_free%
; %mb_total%
; %percentage_swap_used%
; %percentage_swap_free%
; %swap_total% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %swap_free% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %swap_used% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %gb_swap_total%
; %gb_swap_free%
; %gb_swap_used%
; %mb_swap_total%
; %mb_swap_free%
; %mb_swap_used%
label = RAM %gb_used%
; Available tokens:
; %percentage_used% (default)
; %percentage_free%
; %used% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %free% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %total% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %gb_used%
; %gb_free%
; %gb_total%
; %mb_used%
; %mb_free%
; %mb_total%
; %percentage_swap_used%
; %percentage_swap_free%
; %swap_total% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %swap_free% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %swap_used% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %gb_swap_total%
; %gb_swap_free%
; %gb_swap_used%
; %mb_swap_total%
; %mb_swap_free%
; %mb_swap_used%
; New in version 3.6.0
label-warn = RAM %gb_used%/%gb_free%
; Only applies if <bar-used> is used
bar-used-indicator =
bar-used-width = 50
bar-used-foreground-0 = #55aa55
bar-used-foreground-1 = #557755
bar-used-foreground-2 = #f5a70a
bar-used-foreground-3 = #ff5555
bar-used-fill =
bar-used-empty =
bar-used-empty-foreground = #444444
; Only applies if <ramp-used> is used
ramp-used-0 =
ramp-used-1 =
ramp-used-2 =
ramp-used-3 =
ramp-used-4 =
ramp-used-5 =
ramp-used-6 =
ramp-used-7 =
; Only applies if <ramp-free> is used
ramp-free-0 =
ramp-free-1 =
ramp-free-2 =
ramp-free-3 =
ramp-free-4 =
ramp-free-5 =
ramp-free-6 =
ramp-free-7 =
[module/cpu]
type = internal/cpu
format = <label> <ramp-coreload>
label = %percentage%%
label-warn = CPU %percentage%%
ramp-coreload-spacing = 1
ramp-coreload-0 =
ramp-coreload-1 =
ramp-coreload-2 =
ramp-coreload-3 =
ramp-coreload-4 =
ramp-coreload-5 =
ramp-coreload-6 =
ramp-coreload-7 =
; Seconds to sleep between updates
; Default: 1
interval = 0.5
[module/temperature]
type = internal/temperature
; Seconds to sleep between updates
; Default: 1
interval = 0.5
; Thermal zone to use
; To list all the zone types, run
; $ for i in /sys/class/thermal/thermal_zone*; do echo "$i: $(<$i/type)"; done
; Default: 0
thermal-zone = 0
; Select thermal zone by name
; The name has to match the contents of /sys/class/thermal/thermal_zone*/type
; for the desired thermal zone.
; New in version 3.7.0
; Default: ""
zone-type = x86_pkg_temp
; Full path of temperature sysfs path
; Use `sensors` to find preferred temperature source, then run
; $ for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done
; to find path to desired file
; Default reverts to thermal zone setting
hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input
; Base temperature for where to start the ramp (in degrees celsius)
; Default: 0
base-temperature = 20
; Threshold temperature to display warning label (in degrees celsius)
; Default: 80
warn-temperature = 60
; Whether or not to show units next to the temperature tokens (°C, °F)
; Default: true
units = false
; Available tags:
; <label> (default)
; <ramp>
format = <ramp> <label>
; Available tags:
; <label-warn> (default)
; <ramp>
format-warn = <ramp> <label-warn>
; Available tokens:
; %temperature% (deprecated)
; %temperature-c% (default, temperature in °C)
; %temperature-f% (temperature in °F)
; %temperature-k% (temperature in Kelvin, new in version 3.7.0)
label = %temperature-c% °C
; Available tokens:
; %temperature% (deprecated)
; %temperature-c% (default, temperature in °C)
; %temperature-f% (temperature in °F)
; %temperature-k% (temperature in Kelvin, new in version 3.7.0)
label-warn = %temperature-c% °C
label-warn-foreground = #f00
; Requires the <ramp> tag
; The icon selection will range from `base-temperature` to `warn-temperature`,
; temperatures at and above `warn-temperature` will use the last icon
; and temperatures at and below `base-temperature` will use `ramp-0`.
; All other icons are distributed evenly between the two temperatures.
ramp-0 = A
ramp-1 = B
ramp-2 = C
ramp-foreground = #55
[module/title]
type = internal/xwindow
; Available tags:
; <label> (default)
format = <label>
format-background = #add8e6 ; Pale Cyan color
format-foreground = #000 ; Black text
format-padding = 4
; Available tokens:
; %title%
; %instance% (first part of the WM_CLASS atom, new in version 3.7.0)
; %class% (second part of the WM_CLASS atom, new in version 3.7.0)
; Default: %title%
label = %title%
label-maxlen = 50
; Used instead of label when there is no window title
; Available tokens:
; None
label-empty = Empty
label-empty-foreground = #707880

259
.config/polybar/config.ini~ Normal file
View File

@ -0,0 +1,259 @@
[global/wm]
monitor-allow-redirect = true
[bar/top-monitor-1]
monitor = HDMI-A-0
font-0 = HanaMinA Regular:size=10;1
pseudo-transparency = true
background = #2e3440
foreground = #eceff4
modules-left = temperature
modules-center = title
modules-right = date
[module/date]
type = custom/script
exec = ~/.local/bin/date.sh
interval = 600
label = %output%
[module/memory]
type = internal/memory
; Seconds to sleep between updates
; Default: 1
interval = 3
; Default: 90
; New in version 3.6.0
warn-percentage = 95
; Available tags:
; <label> (default)
; <bar-used>
; <bar-free>
; <ramp-used>
; <ramp-free>
; <bar-swap-used>
; <bar-swap-free>
; <ramp-swap-used>
; <ramp-swap-free>
format = <label>
; Format used when RAM reaches warn-percentage
; If not defined, format is used instead.
; Available tags:
; <label-warn>
; <bar-used>
; <bar-free>
; <ramp-used>
; <ramp-free>
; <bar-swap-used>
; <bar-swap-free>
; <ramp-swap-used>
; <ramp-swap-free>
; New in version 3.6.0
;format-warn = <label-warn>
; Available tokens:
; %percentage_used% (default)
; %percentage_free%
; %used% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %free% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %total% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %gb_used%
; %gb_free%
; %gb_total%
; %mb_used%
; %mb_free%
; %mb_total%
; %percentage_swap_used%
; %percentage_swap_free%
; %swap_total% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %swap_free% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %swap_used% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %gb_swap_total%
; %gb_swap_free%
; %gb_swap_used%
; %mb_swap_total%
; %mb_swap_free%
; %mb_swap_used%
label = RAM %gb_used%
; Available tokens:
; %percentage_used% (default)
; %percentage_free%
; %used% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %free% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %total% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %gb_used%
; %gb_free%
; %gb_total%
; %mb_used%
; %mb_free%
; %mb_total%
; %percentage_swap_used%
; %percentage_swap_free%
; %swap_total% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %swap_free% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %swap_used% (Switches between KiB, MiB, and GiB) (New in version 3.6.0)
; %gb_swap_total%
; %gb_swap_free%
; %gb_swap_used%
; %mb_swap_total%
; %mb_swap_free%
; %mb_swap_used%
; New in version 3.6.0
label-warn = RAM %gb_used%/%gb_free%
; Only applies if <bar-used> is used
bar-used-indicator =
bar-used-width = 50
bar-used-foreground-0 = #55aa55
bar-used-foreground-1 = #557755
bar-used-foreground-2 = #f5a70a
bar-used-foreground-3 = #ff5555
bar-used-fill =
bar-used-empty =
bar-used-empty-foreground = #444444
; Only applies if <ramp-used> is used
ramp-used-0 =
ramp-used-1 =
ramp-used-2 =
ramp-used-3 =
ramp-used-4 =
ramp-used-5 =
ramp-used-6 =
ramp-used-7 =
; Only applies if <ramp-free> is used
ramp-free-0 =
ramp-free-1 =
ramp-free-2 =
ramp-free-3 =
ramp-free-4 =
ramp-free-5 =
ramp-free-6 =
ramp-free-7 =
[module/cpu]
type = internal/cpu
format = <label> <ramp-coreload>
label = %percentage%%
label-warn = CPU %percentage%%
ramp-coreload-spacing = 1
ramp-coreload-0 =
ramp-coreload-1 =
ramp-coreload-2 =
ramp-coreload-3 =
ramp-coreload-4 =
ramp-coreload-5 =
ramp-coreload-6 =
ramp-coreload-7 =
; Seconds to sleep between updates
; Default: 1
interval = 0.5
[module/temperature]
type = internal/temperature
; Seconds to sleep between updates
; Default: 1
interval = 0.5
; Thermal zone to use
; To list all the zone types, run
; $ for i in /sys/class/thermal/thermal_zone*; do echo "$i: $(<$i/type)"; done
; Default: 0
thermal-zone = 0
; Select thermal zone by name
; The name has to match the contents of /sys/class/thermal/thermal_zone*/type
; for the desired thermal zone.
; New in version 3.7.0
; Default: ""
zone-type = x86_pkg_temp
; Full path of temperature sysfs path
; Use `sensors` to find preferred temperature source, then run
; $ for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done
; to find path to desired file
; Default reverts to thermal zone setting
hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input
; Base temperature for where to start the ramp (in degrees celsius)
; Default: 0
base-temperature = 20
; Threshold temperature to display warning label (in degrees celsius)
; Default: 80
warn-temperature = 60
; Whether or not to show units next to the temperature tokens (°C, °F)
; Default: true
units = false
; Available tags:
; <label> (default)
; <ramp>
format = <ramp> <label>
; Available tags:
; <label-warn> (default)
; <ramp>
format-warn = <ramp> <label-warn>
; Available tokens:
; %temperature% (deprecated)
; %temperature-c% (default, temperature in °C)
; %temperature-f% (temperature in °F)
; %temperature-k% (temperature in Kelvin, new in version 3.7.0)
label = %temperature-c% °C
; Available tokens:
; %temperature% (deprecated)
; %temperature-c% (default, temperature in °C)
; %temperature-f% (temperature in °F)
; %temperature-k% (temperature in Kelvin, new in version 3.7.0)
label-warn = %temperature-c% °C
label-warn-foreground = #f00
; Requires the <ramp> tag
; The icon selection will range from `base-temperature` to `warn-temperature`,
; temperatures at and above `warn-temperature` will use the last icon
; and temperatures at and below `base-temperature` will use `ramp-0`.
; All other icons are distributed evenly between the two temperatures.
ramp-0 = A
ramp-1 = B
ramp-2 = C
ramp-foreground = #55
[module/title]
type = internal/xwindow
; Available tags:
; <label> (default)
format = <label>
format-background = #f00
format-foreground = #000
format-padding = 4
; Available tokens:
; %title%
; %instance% (first part of the WM_CLASS atom, new in version 3.7.0)
; %class% (second part of the WM_CLASS atom, new in version 3.7.0)
; Default: %title%
label = %title%
label-maxlen = 50
; Used instead of label when there is no window title
; Available tokens:
; None
label-empty = Empty
label-empty-foreground = #707880

View File

@ -184,6 +184,7 @@
xmodmap
;; deps for xmonad
xmonad
xmobar
ghc ;; ridiculous, gcc and ghc are runtime dependencies , yet people didnt put in the package description
gcc
gcc-toolchain

13
misc/scripts/analyze_video.sh Executable file
View File

@ -0,0 +1,13 @@
EXEC_SHELL_PATH=$(command -v bash)
if [ "$#" -ne 1 ]; then
echo "Usage: $0 input_file"
exit 1
fi
file_path="$1"
file_size_mb=$(stat --format="%s" "$file_path" | awk '{printf "%.2f", $1 / 1024 / 1024}')
echo "File size: ${file_size_mb}MB"
ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "$file_path"

37
misc/scripts/compatibility.sh Executable file
View File

@ -0,0 +1,37 @@
EXEC_SHELL_PATH=$(command -v bash)
if [ "$#" -ne 1 ]; then
echo "Usage: $0 input_video"
exit 1
fi
input_file="$1"
output_folder="$HOME/Videos/converted_for_compatibility"
temp_folder="/dev/shm" # Use tmpfs to store files in RAM
temp_file="$temp_folder/temp-$(basename "$input_file")"
output_file="$output_folder/compatible-$(basename "$input_file")"
# Create the output folder if it doesn't exist
mkdir -p "$output_folder"
# Copy the input video to RAM
cp "$input_file" "$temp_file"
# Set the number of threads to 32 (adjust as needed)
threads=32
# Set the output resolution to 360p
output_resolution="640x360"
# Perform the encoding on the downscaled video in RAM
ffmpeg -i "$temp_file" -c:v libx264 -pix_fmt yuv420p -preset veryslow -crf 23 -s "$output_resolution" -threads "$threads" -y "$output_file"
# Check if the video got saved successfully
if [ $? -eq 0 ]; then
echo "Video conversion successful. Output file: $output_file"
else
echo "Error: Video conversion failed."
fi
# Clean up temporary file in RAM
rm -f "$temp_file"

23
misc/scripts/date.sh Executable file
View File

@ -0,0 +1,23 @@
# Get the current date in Japanese-style format without the day
japanese_date=$(date '+%Y年%m月%d日')
# Get the current day of the week in English
english_day=$(date '+%A')
# Convert English day name to Japanese day name
case $english_day in
Monday) japanese_day="月曜日" ;;
Tuesday) japanese_day="火曜日" ;;
Wednesday) japanese_day="水曜日" ;;
Thursday) japanese_day="木曜日" ;;
Friday) japanese_day="金曜日" ;;
Saturday) japanese_day="土曜日" ;;
Sunday) japanese_day="日曜日" ;;
*) japanese_day="Unknown" ;; # Handle unexpected values
esac
# Combine the Japanese-style date with the Japanese day name, adding spaces
japanese_date_with_day=" $japanese_date $japanese_day"
# Output the formatted date and day in Japanese
echo "📅 $japanese_date_with_day "

25
misc/scripts/decompress_7z.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
# Ensure that 7z is installed
if ! command -v 7z >/dev/null 2>&1; then
echo "Error: 7z not found. Please install 7z before running this script."
exit 1
fi
# Function to create directory with Unicode compatibility and strip file extension
create_directory() {
directory_name=$(basename "$1" | sed -E 's/\.(7z|zip)$//' | iconv -t utf-8)
mkdir -p "$directory_name"
}
# Loop through each compressed file in the current folder
for compressed_file in *.7z *.zip; do
# Create a directory for the compressed file
create_directory "$compressed_file"
# If you don't want to extract immediately, comment out the following line
7z x "$compressed_file" -o"$PWD/$directory_name"
done
echo "Extraction completed successfully."

5
misc/scripts/goldendict Executable file
View File

@ -0,0 +1,5 @@
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
goldendict

4
misc/scripts/lf/cleaner Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
if [ -n "$FIFO_UEBERZUG" ]; then
printf '{"action": "remove", "identifier": "PREVIEW"}\n' > "$FIFO_UEBERZUG"
fi

19
misc/scripts/lf/lfrun Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
set -e
cleanup() {
exec 3>&-
rm "$FIFO_UEBERZUG"
}
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
lf "$@"
else
[ ! -d "$HOME/.cache/lf" ] && mkdir --parents "$HOME/.cache/lf"
export FIFO_UEBERZUG="$HOME/.cache/lf/ueberzug-$$"
mkfifo "$FIFO_UEBERZUG"
ueberzug layer -s <"$FIFO_UEBERZUG" -p json &
exec 3>"$FIFO_UEBERZUG"
trap cleanup EXIT
lf "$@" 3>&-
fi

83
misc/scripts/lf/preview Executable file
View File

@ -0,0 +1,83 @@
#!/bin/sh
image() {
if [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$4" "$5" "$(($2-1))" "$(($3-1))" "$1" > "$FIFO_UEBERZUG"
exit 1
else
chafa "$1" -s "$4x"
fi
}
batorcat() {
file="$1"
shift
if command -v bat > /dev/null 2>&1
then
bat --color=always --style=plain --pager=never "$file" "$@"
else
cat "$file"
fi
}
CACHE="$HOME/.cache/lf/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}'))"
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) unzip -l "$1" ;;
*.rar) unrar l "$1" ;;
*.md) glow -s dark "$1" ;;
*.7z) 7z l "$1" ;;
*.[1-8]) man "$1" | col -b ;;
*.o) nm "$1";;
*.torrent) transmission-show "$1" ;;
*.iso) iso-info --no-header -l "$1" ;;
*.odt|*.ods|*.odp|*.sxw) odt2txt "$1" ;;
*.doc) catdoc "$1" ;;
*.docx) docx2txt "$1" - ;;
*.xml|*.html) w3m -dump "$1";;
*.xls|*.xlsx)
ssconvert --export-type=Gnumeric_stf:stf_csv "$1" "fd://1" | batorcat --language=csv
;;
*.wav|*.mp3|*.flac|*.m4a|*.wma|*.ape|*.ac3|*.og[agx]|*.spx|*.opus|*.as[fx]|*.mka)
exiftool "$1"
;;
*.pdf)
[ ! -f "${CACHE}.jpg" ] && \
pdftoppm -jpeg -f 1 -singlefile "$1" "$CACHE"
image "${CACHE}.jpg" "$2" "$3" "$4" "$5"
;;
*.epub)
[ ! -f "$CACHE" ] && \
epub-thumbnailer "$1" "$CACHE" 1024
image "$CACHE" "$2" "$3" "$4" "$5"
;;
*.cbz|*.cbr|*.cbt)
[ ! -f "$CACHE" ] && \
comicthumb "$1" "$CACHE" 1024
image "$CACHE" "$2" "$3" "$4" "$5"
;;
*.avi|*.mp4|*.wmv|*.dat|*.3gp|*.ogv|*.mkv|*.mpg|*.mpeg|*.vob|*.fl[icv]|*.m2v|*.mov|*.webm|*.ts|*.mts|*.m4v|*.r[am]|*.qt|*.divx)
[ ! -f "${CACHE}.jpg" ] && \
ffmpegthumbnailer -i "$1" -o "${CACHE}.jpg" -s 0 -q 5
image "${CACHE}.jpg" "$2" "$3" "$4" "$5"
;;
*.bmp|*.jpg|*.jpeg|*.png|*.xpm|*.webp|*.gif|*.jfif)
image "$1" "$2" "$3" "$4" "$5"
;;
*.svg)
[ ! -f "${CACHE}.jpg" ] && \
convert "$1" "${CACHE}.jpg"
image "${CACHE}.jpg" "$2" "$3" "$4" "$5"
;;
*.ino)
batorcat --language=cpp "$1"
;;
*)
batorcat "$1"
;;
esac
exit 0

19
misc/scripts/preview.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
set -e
cleanup() {
exec 3>&-
rm "$FIFO_UEBERZUG"
}
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
lf "$@"
else
[ ! -d "$HOME/.cache/lf" ] && mkdir --parents "$HOME/.cache/lf"
export FIFO_UEBERZUG="$HOME/.cache/lf/ueberzug-$$"
mkfifo "$FIFO_UEBERZUG"
ueberzug layer -s <"$FIFO_UEBERZUG" -p json &
exec 3>"$FIFO_UEBERZUG"
trap cleanup EXIT
lf "$@" 3>&-
fi

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,8 @@
$ ghc --make xmonad.hs -dynamic -fPIC -i -ilib -fforce-recomp -main-is main -v0 -outputdir /home/hashirama/.xmonad/build-x86_64-linux -o /home/hashirama/.xmonad/xmonad-x86_64-linux
xmonad.hs:58:1: warning: [-Wtabs]
Tab character found here, and in two further locations.
Please use spaces instead.
|
58 | spawnOnce "xrdb /home/hashirama/.Xresources"
| ^^^^^^^^

122
xmonad/.xmonad/xmonad.hs Normal file
View File

@ -0,0 +1,122 @@
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.StackSet as W -- float purposes
import XMonad.Actions.MouseResize
import XMonad.Util.EZConfig
import XMonad.Util.Loggers
import XMonad.Util.Ungrab
import XMonad.Layout.Magnifier
import XMonad.Layout.ThreeColumns
import XMonad.Layout.Spacing
import XMonad.Hooks.EwmhDesktops
import XMonad.Util.SpawnOnce (spawnOnce)
-- run or raise
import XMonad.Actions.WindowGo (runOrRaise)
import XMonad.ManageHook (className)
import XMonad.StackSet (RationalRect(..))
--
import XMonad.Layout.Decoration
import XMonad.Layout.Simplest
import XMonad.Layout.SimplestFloat
import XMonad.Layout.Spacing
main :: IO ()
main = xmonad
. ewmhFullscreen
. ewmh
. withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey
$ myConfig
myConfig = def
{ modMask = mod4Mask -- Rebind Mod to the Super key
, layoutHook = myLayout -- Use custom layouts
, terminal = "alacritty"
, focusedBorderColor = "#000000"
, manageHook = myManageHook -- Match on certain windows
, startupHook = do
-- other startup commands
spawnOnce "xrandr --output HDMI-A-0 --mode 1366x768"
spawnOnce "xrdb /home/hashirama/.Xresources"
spawnOnce "feh --bg-fill /home/hashirama/wallpaper.jpg"
spawnOnce "compton -b"
spawnOnce "polybar top-monitor-1"
}
`additionalKeysP`
[ ("M-d", spawn "rofi -show run")
, ("M-s", spawn "bash -c dictpopup")
, ("M-C-s", unGrab *> spawn "scrot -s" )
, ("M-e", runOrRaise "goldendict" (className =? "GoldenDict-ng"))
, ("M-p", runOrRaise "nyxt" (className =? "Nyxt"))
, ("M-t", withFocused $ windows . W.sink) -- Toggle float for the focused window
]
myManageHook :: ManageHook
myManageHook = composeAll
[ className =? "Gimp" --> doFloat
, isDialog --> doFloat
]
myTheme :: Theme
myTheme = def
{ decoHeight = 20
-- Add other theme properties as needed
}
myLayout = mouseResize $ spacingRaw True (Border 10 10 10 10) True (Border 10 10 10 10) True $
Tall 1 (3/100) (1/2) ||| Full
myXmobarPP :: PP
myXmobarPP = def
{ ppSep = cyan ""
, ppTitleSanitize = xmobarStrip
, ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2
, ppHidden = white . wrap " " ""
, ppHiddenNoWindows = lowWhite . wrap " " ""
, ppUrgent = red . wrap (yellow "!") (yellow "!")
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where
formatFocused = wrap (white "[") (white "]") . cyan . ppWindow
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . vividGreen . ppWindow
-- | Windows should have *some* title, which should not exceed a
-- sane length.
ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
cyan, vividGreen, lowWhite, red, white, yellow :: String -> String
cyan = xmobarColor "#8be9fd" ""
vividGreen = xmobarColor "#50fa7b" ""
white = xmobarColor "#f8f8f2" ""
yellow = xmobarColor "#f1fa8c" ""
red = xmobarColor "#ff5555" ""
lowWhite = xmobarColor "#bbbbbb" ""

View File

@ -21,13 +21,14 @@ import XMonad.Layout.Spacing
import XMonad.Hooks.EwmhDesktops
import XMonad.Util.SpawnOnce (spawnOnce)
-- run or raise
import XMonad.Actions.WindowGo (runOrRaise)
import XMonad.ManageHook (className)
import XMonad.StackSet (RationalRect(..))
--
import XMonad.Layout.Decoration (decoration, DefaultShrinker(..), Theme(..), shrinkText)
import XMonad.Layout.Decoration
import XMonad.Layout.Simplest
import XMonad.Layout.SimplestFloat
import XMonad.Layout.Spacing
@ -49,12 +50,16 @@ myConfig = def
{ modMask = mod4Mask -- Rebind Mod to the Super key
, layoutHook = myLayout -- Use custom layouts
, terminal = "alacritty"
, focusedBorderColor = myFocusedBorderColor,
, manageHook = myManageHook -- Match on certain windows
, startupHook = do
-- other startup commands
spawnOnce "xrandr --output HDMI-A-0 --mode 1366x768"
spawnOnce "xrdb /home/hashirama/.Xresources"
spawnOnce "feh --bg-fill /home/hashirama/wallpaper.jpg"
spawnOnce "compton -b"
spawnOnce "polybar top-monitor-1"
}
`additionalKeysP`
[ ("M-d", spawn "rofi -show run")
@ -73,12 +78,17 @@ myManageHook = composeAll
]
myFocusedBorderColor = "#000000"
myTheme :: Theme
myTheme = def
{ decoHeight = 20 -- Adjust the height of the title bar as needed
{ decoHeight = 20
-- Add other theme properties as needed
}
myLayout = mouseResize $ spacingRaw True (Border 10 10 10 10) True (Border 10 10 10 10) True $
Tall 1 (3/100) (1/2) ||| Full
@ -87,7 +97,7 @@ myLayout = mouseResize $ spacingRaw True (Border 10 10 10 10) True (Border 10 10
myXmobarPP :: PP
myXmobarPP = def
{ ppSep = magenta ""
{ ppSep = cyan ""
, ppTitleSanitize = xmobarStrip
, ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2
, ppHidden = white . wrap " " ""
@ -97,18 +107,19 @@ myXmobarPP = def
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where
formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
formatFocused = wrap (white "[") (white "]") . cyan . ppWindow
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . vividGreen . ppWindow
-- | Windows should have *some* title, which should not not exceed a
-- | Windows should have *some* title, which should not exceed a
-- sane length.
ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
blue, lowWhite, magenta, red, white, yellow :: String -> String
magenta = xmobarColor "#ff79c6" ""
blue = xmobarColor "#bd93f9" ""
white = xmobarColor "#f8f8f2" ""
yellow = xmobarColor "#f1fa8c" ""
red = xmobarColor "#ff5555" ""
lowWhite = xmobarColor "#bbbbbb" ""
cyan, vividGreen, lowWhite, red, white, yellow :: String -> String
cyan = xmobarColor "#8be9fd" ""
vividGreen = xmobarColor "#50fa7b" ""
white = xmobarColor "#f8f8f2" ""
yellow = xmobarColor "#f1fa8c" ""
red = xmobarColor "#ff5555" ""
lowWhite = xmobarColor "#bbbbbb" ""