WM : config added.

This commit is contained in:
2022-09-17 02:09:55 +09:00
parent 2a1efb0e2a
commit 71ad797056
47 changed files with 2514 additions and 617 deletions

89
.config/bspwm/autostart Executable file
View File

@ -0,0 +1,89 @@
#!/usr/bin/env bash
killall bspc
# Splashscreen
pgrep sxhkd || mpv --fullscreen --no-input-default-bindings --no-config --on-all-workspaces ~/Videos/Renders/splash.mp4
# Compositor
picom -b --config $HOME/.xmonad/scripts/picom.conf &
# cursor
xsetroot -cursor_name left_ptr &
# apply colorscheme to spotify
#~/.ricing/wal-spotify.sh > /dev/null&
# Source the colorscheme
#echo alpha="ff" >> "${HOME}/.cache/wal/colors.sh"
#source "${HOME}/.cache/wal/colors.sh"
# Walllpaper
~/scripts/random_wallpaper.sh
# Authentication agent
#/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1&
# mapcheck
#killall osucheck.sh
#killall inotifywait
#~/.osuthings/osucheck.sh "/home/$USER/.osutmp"&
#~/.osuthings/osucheck.sh "/home/$USER/Downloads"&
# Tablet drivers
#otd&
# Statusbar
#eww -c ~/.config/eww/eww-bar open bar
eww -c ~/.config/eww/mybar open bar_right
eww -c ~/.config/eww/mybar open bar_center
eww -c ~/.config/eww/mybar open bar_left
#killall polybar
#polybar -c ~/.config/eww/mybar/polybar_tray.ini tray&
#Applets
#killall blueman-applet
#killall pa-applet
#killall nm-applet
#killall flameshot
#blueman-applet&
#pa-applet --disable-key-grabbing --disable-notifications&
#nm-applet&
#flameshot&
# daemons
#killall dunst
#dunst -lf $foreground \
# -lb $color0$alpha \
# -lfr $color9\
# -nf $foreground \
# -nb $color0$alpha \
# -nfr $color9 \
# -cf $foreground \
# -cb $color0$alpha \
# -cfr $color9 > /dev/null 2>&1 &
#thunar --daemon&
# Master layout
#for (( i=1; i < 10; i++));do
# #bsp-layout set tiled $i
# true
#done
# Sounds
#~/.bscripts/sounds.sh&
# idle
#killall idle.sh
#pgrep idle.sh || ~/.bscripts/idle.sh > /dev/null 2> /dev/null&
# borders
#.bscripts/borders.sh&
# Emacs Daemon
emacs --daemon
# Launch keybinding daemon
killall sxhkd
sxhkd -c ~/.config/bspwm/sxhkdrc > /dev/null 2> /dev/null&

72
.config/bspwm/bspwmrc Executable file
View File

@ -0,0 +1,72 @@
#!/bin/sh
# wgtk stuff
#wpg -R wallpaper.png
#wpg -s wallpaper.png
#source "${HOME}/.cache/wal/colors.sh"
# Set environment
export BSPWM_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/bspwm"
bspc monitor -d 1 2 3 4 5
bspc config border_width 5
bspc config window_gap 20
#bspc config border_radius 2
bspc config focus_follows_pointer true
bspc config gapless_monocle true
#bspc config pointer_follows_focus true
#bspc config single_monocle true
bspc config top_monocle_padding 20
bspc config left_monocle_padding 20
bspc config right_monocle_padding 20
bspc config bottom_monocle_padding 20
#bspc config ignore_ewmh_fullscreen enter
bspc rule --add Blueman-manager state=floating rectangle=610x610+650+235
bspc rule --add Surf layer=above border=off rectangle=415x1100+0+0
bspc rule --add Surfdload state=floating layer=above border=off rectangle=415x75+0+0 sticky=on focus=off
bspc rule --add Brave-browser rectangle=1130x800+395+140
bspc rule --add Polkit-gnome-authentication-agent-1 rectangle=810x280+555+399
bspc rule --add Polybar layer=below manage=off
bspc rule --add kozu state=floating rectangle=1910x200+0+870 layer=above
bspc rule --add cava state=floating manage=off rectangle=1920x1050+0+50 border=off sticky=on locked=on layer=below focus=off
#bspc rule --add Pqiv manage=off border=off #rectangle=110x50+260+20
bspc rule --add Nautilus state=floating
bspc rule --add mpv state=floating border=off
bspc rule --add Rofi manage=off
bspc rule --add Pavucontrol state=floating rectangle=610x610+650+235
bspc rule --add Yad state=floating
bspc rule --add Thunar rectangle=650x500+635+290
bspc rule --add flameshot state=floating border=off
# Colors
bspc config focused_border_color "$color9"
bspc config active_border_color "$color9"
bspc config normal_border_color "$color1"
bspc config urgent_border_color "$color1"
bspc config presel_feedback_color "$color1"
bspc config focused_locked_border_color "$color1"
bspc config active_locked_border_color "$color1"
bspc config normal_locked_border_color "$color1"
bspc config focused_sticky_border_color "$color1"
bspc config active_sticky_border_color "$color1"
bspc config normal_sticky_border_color "$color1"
bspc config focused_private_border_color "$color1"
bspc config active_private_border_color "$color1"
bspc config normal_private_border_color "$color1"
# Load session
# shellcheck source=/dev/null
#. "$BSPWM_CONFIG/restore.cfg"
#if [ -e "$BSPWM_STATE" ] ; then
# bspc wm --load-state "$BSPWM_STATE"
# bspc wm --adopt-orphans
# rm "$BSPWM_STATE"
#fi
#Move thumbnails
#xdotool search "pqiv: /tmp/thumbnail.png" windowmove 256 20
# Autostart
"$BSPWM_CONFIG/autostart" &

202
.config/bspwm/sxhkdrc Normal file
View File

@ -0,0 +1,202 @@
#Config file for simple X hotkey daemon
#"Pausing" sxhkd
super+Return
alacritty
#Apps and programs
super+e
emacsclient -c -a 'emacs'
super+b
qutebrowser
super+f
firefox
# workspace
super + {1,2,3,4,5}
bspc desktop -f {1,2,3,4,5}
super + shift + {1-5}
bspc node -d '^{1-5}'
#control+alt+w
# brave
#control+alt+t
# kitty
##control+alt+g
## lutris
#control+alt+f
# thunar
#super+shift+c
# /home/kz87/.bscripts/wc.sh
#
##rofi things
##Launch apps
#super+shift+e
# ~/.bscripts/rofi.sh drun
#
##Window switcher
#alt+Tab
# ~/.bscripts/rofi.sh window
#
##Configuration launcher
#super+shift+s
# ~/.bscripts/rofi.sh config
#
##Resolution switcher
##control+shift+p
# #bash -c "~/.bscripts/rofi.sh resolution"
#
##Screenshot
#Print
# ~/.bscripts/ss.sh
##Delayed screenshot
#super+Print
# sleep 3 && ~/.bscripts/ss.sh
#
##Color picker
#control+alt+c
# colorpicker --short --one-shot | xclip -selection "clipboard"
#
##Suspend the pc
#super+o
# ~/.bscripts/lock.sh
#
##Osu stuff
#control+alt+o
# xsetwacom --set "HUION 420 Pen stylus" Area 1000 0 5000 3700
#shift+control+o
# xsetwacom set "HUION 420 Pen stylus" ResetArea
##super+x
## ~/.osuthings/surfdirect.sh raise
##super+z
## ~/.osuthings/surfdirect.sh lower
#
##Window and workspace shenanigans
#super+c
# wmctrl -c `xdotool getwindowfocus` -i
#alt+F4
# xdotool getwindowfocus windowclose
#control+period
# ~/.bscripts/wpm_reports.sh move +1
#control+comma
# ~/.bscripts/wpm_reports.sh move -1
#control+alt+period
# ~/.bscripts/wpm_reports.sh select +1
#control+alt+comma
# ~/.bscripts/wpm_reports.sh select -1
#super+{1,2,3,4,5}
# ~/.bscripts/wpm_reports.sh jump {0,1,2,3,4}
#
##Weeb
#control+alt+b
# ~/.mangaread
#
##Display stuff
#super+control+p
# xrandr --output HDMI1 --auto --left-of eDP1
#super+shift+p
# xrandr -s 0
#
## Toggle picom
super+p
[[ `pgrep -c picom` -eq 0 ]] && picom -b --config $HOME/.xmonad/scripts/picom.conf || killall picom
##Keyboard layouts
#super+space
# ~/.config/eww/mybar/scripts/kb_layouts cycle es us
#
##Media controls
#alt+period
# ~/.bscripts/volume.sh up #&& pkill -RTMIN+2 i3blocks
#alt+comma
# ~/.bscripts/volume.sh down #&& pkill -RTMIN+2 i3blocks
#alt+m
# ~/.bscripts/volume.sh mute
#XF86AudioRaiseVolume
# ~/.bscripts/volume.sh up #&& pkill -RTMIN+2 i3blocks
#XF86AudioLowerVolume
# ~/.bscripts/volume.sh down#&& pkill -RTMIN+2 i3blocks
#XF86AudioMute
# ~/.bscripts/volume.sh mute #&& pkill -RTMIN+2 i3blocks
#alt+shift+period
# ~/.bscripts/brightness.sh up
#alt+shift+comma
# ~/.bscripts/brightness.sh down
#Pause
# playerctl play-pause
#XF86AudioPlay
# playerctl play-pause
#XF86AudioPause
# playerctl play-pause
#XF86AudioNext
# playerctl next
#XF86AudioPrev
# playerctl previous
#
##Open-close eww
#control+alt+e
# ~/.config/eww/dashboard/launch_dashboard
#super+m
# ~/.config/eww/mybar/scripts/popup_music
#
##bspwm stuff
#super+s
# bspc desktop focused --layout next && polybar-msg hook layout 1
#super+shift+q
# ~/.bscripts/rofi.sh outopts
#XF86PowerOff
# ~/.bscripts/rofi.sh outopts
##super+shift+r
## bspc wm -r
#control+alt+space
# ~/.bscripts/toggle_float.sh
#super+shift+{k,j,h,l}
# play -v 0.4 ~/Documents/Sounds/tile.wav& ~/.bscripts/bsmove.sh {north,south,west,east}
#super+{k,j,h,l}
# ~/.bscripts/bselect.sh {north,south,west,east}
#
#super+alt+l
# bspc node focused -z right 15 0
#super+alt+h
# bspc node focused -z left -15 0
#super+alt+k
# bspc node focused -z top 0 -15
#super+alt+j
# bspc node focused -z bottom 0 15
#super+{d,a}
# play -v 0.4 ~/Documents/Sounds/tile.wav& bspc node @/ -C {forward,backward}
#alt+{d,a}
# play -v 0.4 ~/Documents/Sounds/tile.wav& bspc node first_ancestor -R {90,270}
#super+e
# play -v 0.4 ~/Documents/Sounds/tile.wav& bspc node first_ancestor --balance
#
#control+shift+h
# bspc node focused -z right -15 0
#control+shift+l
# bspc node focused -z left 15 0
#control+shift+j
# bspc node focused -z top 0 15
#control+shift+k
# bspc node focused -z bottom 0 -15
#
super+space
if [ -z "$(bspc query -N -n focused.fullscreen)" ]; then \
bspc node focused -t fullscreen; \
else \
bspc node focused -t tiled; \
fi;
#super+KP_Add
# bspc config window_gap $(( 5 + `bspc config window_gap` ))
#super+KP_Subtract
# bspc config window_gap $(( -5 + `bspc config window_gap` ))
#
#control+alt+{k,j,h,l}
# bspc node --presel-dir ~{north,south,west,east}
#
#control+alt+a
# if [[ ! -z "$(bspc query -N -n focused.normal)" ]]; then \
# bspc node focused -l above; \
# elif [[ ! -z "$(bspc query -N -n focused.above)" ]]; then \
# bspc node focused -l below; \
# else \
# bspc node focused -l normal; \
# fi;
#

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -0,0 +1,55 @@
* {
all: unset; //Unsets everything so you can style everything from scratch
}
//Global Styles
.bar {
background-color: #3a3a3a;
color: #b0b4bc;
padding: 10px;
}
// Styles on classes (see eww.yuck for more information)
.sidestuff slider {
all: unset;
color: #ffd5cd;
}
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
min-height: 3px;
min-width: 50px;
margin-left: 10px;
margin-right: 20px;
}
.label-ram {
font-size: large;
}
.workspaces button:hover {
color: #D35D6E;
}

View File

@ -0,0 +1,75 @@
(defwidget bar []
(centerbox :orientation "h"
(workspaces)
(music)
(sidestuff)))
(defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
(metric :label "🔊"
:value volume
:onchange "amixer -D pulse sset Master {}%")
(metric :label ""
:value {EWW_RAM.used_mem_perc}
:onchange "")
(metric :label "💾"
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange "")
time))
(defwidget workspaces []
(box :class "workspaces"
:orientation "h"
:space-evenly true
:halign "start"
:spacing 10
(button :onclick "wmctrl -s 0" 1)
(button :onclick "wmctrl -s 1" 2)
(button :onclick "wmctrl -s 2" 3)
(button :onclick "wmctrl -s 3" 4)
(button :onclick "wmctrl -s 4" 5)
(button :onclick "wmctrl -s 5" 6)
(button :onclick "wmctrl -s 6" 7)
(button :onclick "wmctrl -s 7" 8)
(button :onclick "wmctrl -s 8" 9)))
(defwidget music []
(box :class "music"
:orientation "h"
:space-evenly false
:halign "center"
{music != "" ? "🎵${music}" : ""}))
(defwidget metric [label value onchange]
(box :orientation "h"
:class "metric"
:space-evenly false
(box :class "label" label)
(scale :min 0
:max 101
:active {onchange != ""}
:value value
:onchange onchange)))
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ artist }} - {{ title }}' || true")
(defpoll volume :interval "1s"
"scripts/getvol")
(defpoll time :interval "10s"
"date '+%H:%M %b %d, %Y'")
(defwindow bar
:monitor 0
:windowtype "dock"
:geometry (geometry :x "0%"
:y "0%"
:width "90%"
:height "10px"
:anchor "top center")
:reserve (struts :side "top" :distance "4%")
(bar))

View File

@ -0,0 +1,2 @@
#!/bin/sh
printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}')

View File

@ -0,0 +1,2 @@
#!/bin/sh
amixer -D pulse sget Master | grep 'Left:' | awk -F'[][]' '{ print $2 }' | tr -d '%' | head -1

107
.config/eww/mybar/eww.scss Normal file
View File

@ -0,0 +1,107 @@
// EWW.SCSS
// GLOBALS
*{
all: unset;
font-family: "Ubuntu Mono";
font-weight: 400;
}
.bars {
background-image: url("images/background.png");
background-color: #120010;
border: 3px solid #ff1475;
border-radius: 20px;
}
// LEFT MODULES
// Workspaces
.workspaces {
margin-left: 5px;
margin-top: -2px;
}
.workspace_buttons {
font-family: Hack;
font-size: 15px;
margin: 0 2 0 1;
color: #e6dafc;
}
// CENTER MODULES
.center_icons {
margin-right: 3px;
margin-left: 15px;
}
.center_labels {
font-size: 15px;
margin-bottom: -3px;
margin-top: 1px;
color: #e6dafc;
}
.center_revealers {
border-radius: 5px;
background-color: rgba(18,0,16, 1);
min-height: 32px;
border: solid 2px #ffff01;
color: #3081c6;
}
.center_info scale trough highlight {
all: unset;
background: #FFCD01;
border-radius: 10px;
border: solid 2px #ffff01;
}
.center_info scale trough {
all: unset;
background-color: rgba(230,218,252, 0.4);
border-radius: 10px;
min-width: 110px;
min-height: 10px;
}
// RIGHT MODULES
.power_button {
color: #ff4c5f;
font-size: 20px;
margin: -10 15 -10 15;
}
.time_box {
margin-top: -10px;
margin-bottom: -10px;
}
.time {
color: #e6dafc;
font-size: 25px;
margin-bottom: -20px;
margin-top: -20px;
}
.date {
color: #e6dafc;
font-size: 25px;
margin-top: 8px;
}
.kb_box {
color: #e6dafc;
font-size: 15px;
margin-left: 2px;
margin-right: 10px;
}
.kb_button_us {
font-size: 15px;
margin-bottom: -3px;
}
.kb_button_es {
font-size: 15px;
margin-top: -2px;
}
.cal {
font-size: 16px;
background-color: #120010;
background-image: url("images/background.png");
color: #e6dafc;
border: 5px solid #ff1475;
border-radius: 0 0 20 20;
padding: 10px;
}

813
.config/eww/mybar/eww.yuck Normal file
View File

@ -0,0 +1,813 @@
;; VARS
(defvar eww "eww -c $HOME/.config/eww/mybar")
(defvar music_reveal false)
(defvar cover "images/music.png")
(defvar cpu_reveal false)
(defvar disk_reveal false)
(defvar temperature_reveal false)
(defvar ram_reveal false)
(defvar date_reveal false)
(defvar battery_reveal false)
(defvar left_bg "#120010")
(defvar center_bg "#120010")
(defvar right_bg "#120010")
(defvar media_bar_class "bar_normal")
(defvar media_bar_class_popup "bar_normal_popup")
(defvar battery_image "images/battery_normal.png")
(defvar us_color "rgba(230,218,252,1)")
(defvar es_color "rgba(230,218,252,0.4)")
(defvar day "0")
(defvar month "0")
(defvar year "0")
(defvar wp1 "●")
(defvar wp2 "○")
(defvar wp3 "○")
(defvar wp4 "○")
(defvar wp5 "○")
(defvar layout_button "")
(defvar media_status "")
(defvar artist "No artist")
(defvar artist_parsed "No artist")
(defvar title "No title")
(defvar title_parsed "No title")
(defvar length 100)
(defvar position 0)
(deflisten launch1 "scripts/workspaces")
(deflisten launch2 "scripts/layout")
(deflisten launch3 "scripts/media_info")
(defpoll cpu_percent :interval "1s" "scripts/cpu_info")
(defpoll disk_all :interval "10s" "scripts/disk_info --all")
(defpoll disk_used :interval "10s" "scripts/disk_info --used")
(defpoll disk_free :interval "10s" "scripts/disk_info --free")
(defpoll temperature :interval "2s" "scripts/temperature_info")
(defpoll ram_used :interval "2s" "scripts/ram_info --used")
(defpoll ram_all :interval "2s" "scripts/ram_info --all")
(defpoll ram_parsed :interval "2s" "scripts/ram_info --parsed")
(defpoll battery_percent :interval "3s" "scripts/battery_info --percentage")
(defpoll battery_time :interval "3s" "scripts/battery_info --time")
(defpoll hour :interval "1s" "scripts/time_info --hour")
(defpoll minutes :interval "1s" "scripts/time_info --minutes")
(defpoll type :interval "1s" "scripts/time_info --type")
(defpoll date :interval "1s" "scripts/time_info --date")
;; WINDOWS
;; Left bar
(defwindow bar_left
:geometry
(geometry
:x "10px"
:y "10px"
:width "150px"
:height "25px")
:stacking "bg"
:reserve
(struts
:distance "70px"
:side "top")
:windowtype "dock"
:wm-ignore "false"
(widgets_left))
;; Central bar
(defwindow bar_center
:geometry
(geometry
:x "180px"
:y "10px"
:width "930px"
:height "50px")
:stacking "bg"
:reserve
(struts
:distance "70px"
:side "top")
:windowtype "dock"
:wm-ignore "false"
(widgets_center))
;; Right bar
(defwindow bar_right
:geometry
(geometry
:x "1130px"
:y "10px"
:width "455px"
:height "50px")
:stacking "bg"
:reserve
(struts
:distance "70px"
:side "top")
:windowtype "dock"
:wm-ignore "false"
(widgets_right))
;; Calendar window
(defwindow calendar
:geometry
(geometry
:x "1465px"
:y "65px"
:width "415px"
:height "100px")
:stacking "fg"
:windowtype "dock"
:wm-ignore "false"
(box
:class "cal"
:orientation "h"
:valign "fill"
:halign "fill"
(calendar
:day day
:month month
:year year
:show-details "true"
:show-heading "true"
:show-day-names "true")))
;; Music window
(defwindow music
:geometry
(geometry
:x "40px"
:y "65px"
:width "415px"
:height "200px")
:stacking "fg"
:windowtype "dock"
:wm-ignore "false"
(box
:orientation "v"
:valign "fill"
:halign "fill"
:space-evenly "false"
:class "music_box_popup"
(box
:orientation "h"
:valign "fill"
:halign "fill"
:space-evenly "false"
(box
:valign "center"
:halign "start"
(image
:halign "start"
:class "media_art_popup"
:tooltip "${title} by ${artist}"
:path cover
:image-height 130
:image-width 130))
(box
:valign "center"
:halign "fill"
:orientation "v"
:class "media_data_popup"
:spacing 20
(label
:class "media_title_popup"
:markup title_parsed
:halign "center")
(label
:class "media_artist_popup"
:markup artist_parsed
:halign "center")
(box
:orientation "h"
:halign "fill"
:valign "fill"
:class "media_buttons_box_popup"
(eventbox
:cursor "pointer"
(button
:onclick "scripts/media_control --prev"
:class "nextprev_popup"
:tooltip "Previous"
""))
(eventbox
:cursor "pointer"
(button
:onclick "scripts/media_control --move -5"
:class "move_popup"
:tooltip "-5 seconds"
""))
(eventbox
:cursor "pointer"
(button
:onclick "scripts/media_control --toggle"
:class "playpause_popup"
:tooltip "Play/Pause"
media_status))
(eventbox
:cursor "pointer"
(button
:onclick "scripts/media_control --move +5"
:class "move_popup"
:tooltip "+5 seconds"
""))
(eventbox
:cursor "pointer"
(button
:onclick "scripts/media_control --next"
:class "nextprev_popup"
:tooltip "Next"
""))
)))
(eventbox
:cursor "pointer"
:onhover "${eww} update media_bar_class_popup=\"bar_highlighted_popup\""
:onhoverlost "${eww} update media_bar_class_popup=\"bar_normal_popup\""
(box
:orienttion "h"
:valign "fill"
:halign "fill"
:class media_bar_class_popup
(scale
:min 0
:max length
:value position
:orientation "h"
:onchange "scripts/media_control --seek {}"
)))
))
;; WIDGETS
;; Left widgets
(defwidget widgets_left []
(eventbox
:onhover "${eww} update left_bg=\"#43013b\""
:onhoverlost "${eww} update left_bg=\"#120010\""
(box
:spacing 0
:space-evenly "false"
:class "bars"
:orientation "h"
:valign "fill"
:hexpand "false"
:style "background-color: ${left_bg}"
(workspaces)
(layout))))
(defwidget workspaces []
(box
:orientation "h"
:halign "start"
:class "workspaces"
(box
:orientation "h"
:spacing 5
:space-evenly "false"
:class "${launch1}, ${launch2}, ${launch3}"
(eventbox
:cursor "pointer"
(button
:tooltip "Switch to workspace 1"
:onclick "bspc desktop -f 1"
(label
:markup wp1
:class "workspace_buttons")))
(eventbox
:cursor "pointer"
(button
:tooltip "Switch to workspace 2"
:onclick "bspc desktop -f 2"
(label
:markup wp2
:class "workspace_buttons")))
(eventbox
:cursor "pointer"
(button
:tooltip "Switch to workspace 3"
:onclick "bspc desktop -f 3"
(label
:markup wp3
:class "workspace_buttons")))
(eventbox
:cursor "pointer"
(button
:tooltip "Switch to workspace 4"
:onclick "bspc desktop -f 4"
(label
:markup wp4
:class "workspace_buttons")))
(eventbox
:cursor "pointer"
(button
:tooltip "Switch to workspace 5"
:onclick "bspc desktop -f 5"
(label
:markup wp5
:class "workspace_buttons")))
)))
(defwidget layout []
(box
:orientation "h"
:halign "start"
(box
:orientation "h"
:space-evenly "false"
(eventbox
:cursor "pointer"
(button
:tooltip "Change current layout"
:onclick "bspc desktop focused --layout next"
(label
:class "layout"
:text layout_button)))
)))
(defwidget music []
(eventbox
:onhover "${eww} update music_reveal=true"
:onhoverlost "${eww} update music_reveal=false"
(box
:class "music_box"
:orientation "h"
:spacing 0
:space-evenly "false"
:halign "start"
(eventbox
:cursor "pointer"
(box
:space_evenly "false"
:halign "start"
:tooltip "${title} by ${artist}"
(button
:onclick "scripts/popup_music"
(image
:class "media_art"
:path cover
:image-height 40
:image-width 40))))
(box
:class "media_data"
:orientation "v"
:space-evenly "false"
:vexpand "false"
:hexpand "false"
:valign "end"
:halign "start"
(label
:class "media_title"
:halign "center"
:markup title_parsed
:limit-width 15
:wrap "true"
:show_truncated "true")
(revealer
:reveal music_reveal
:transition "slideup"
:duration "350ms"
(box
:orientation "h"
:halign "center"
:space-evenly "false"
:class "media_buttons"
:space-evenly "false"
(eventbox
:cursor "pointer"
(button
:class "prev_button"
:onclick "scripts/media_control --prev"
:tooltip "Previous"
""))
(eventbox
:cursor "pointer"
(button
:class "toggle_button"
:onclick "scripts/media_control --toggle"
:tooltip "Play/Pause"
"${media_status}"))
(eventbox
:cursor "pointer"
(button
:class "next_button"
:onclick "scripts/media_control --next"
:tooltip "Next"
""))))
(box
:space-evenly "false"
:class media_bar_class
:halign "center"
:vexpand "false"
:hexpand "false"
(eventbox
;;:cursor "pointer"
;; :onhover "${eww} update media_bar_class=bar_highlighted"
;; :onhoverlost "${eww} update media_bar_class=bar_normal"
(scale
:active "false"
:min 0
:max length
:value position
:orientation "h"
:tooltip "Seek"
;; :onchange "scripts/media_control --seek {}"
)))))))
;; Central widgets
(defwidget widgets_center []
(eventbox
:onhover "${eww} update center_bg=\"#43013b\""
:onhoverlost "${eww} update center_bg=\"#120010\""
(box
:spacing 0
:space-evenly "true"
:class "bars"
:orientation "h"
:valign "fill"
:halign "fill"
:hexpand "false"
:style "background-color: ${center_bg}"
(box
:space-evenly "true"
:orientation "h"
:valign "center"
:halign "fill"
(cpu_status)
(ram_status)
(temperature_status)
(disk_status)
(battery_status)
))))
(defwidget cpu_status []
(eventbox
:onhover "${eww} update cpu_reveal=\"true\""
:onhoverlost "${eww} update cpu_reveal=\"false\""
:tooltip "CPU usage"
(box
:orientation "h"
:space-evenly "false"
:class "cpu_box"
:vexpand "false"
:hexpand "false"
(image
:class "center_icons"
:path "images/cpu.png"
:image-width 30
:image-height 30)
(box
:orientation "v"
:space-evenly "false"
:vexpand "false"
:hexpand "false"
:valign "center"
:class "center_boxes"
(revealer
:reveal "${!cpu_reveal}"
:transition "slidedown"
:duration "350ms"
(box
:orientation "v"
:class "center_info"
:valign "start"
(label
:class "center_labels"
:text "${cpu_percent}%"
:halign "center")
(scale
:min 0
:max 100
:value cpu_percent
:orientation "h")))
(revealer
:reveal cpu_reveal
:transition "slideup"
:duration "350ms"
:valign "center"
(box
:valign "center"
:class "center_revealers"
(graph
:thickness 3
:value cpu_percent
:time-range "20s"
:min 0
:max 100
:dynamic "true"
:line-style "round"))
)))))
(defwidget disk_status []
(eventbox
:onhover "${eww} update disk_reveal=\"true\""
:onhoverlost "${eww} update disk_reveal=\"false\""
:tooltip "Disk usage"
(box
:orientation "h"
:space-evenly "false"
:class "disk_box"
:vexpand "false"
:hexpand "false"
(image
:class "center_icons"
:path "images/disk.png"
:image-width 30
:image-height 30)
(box
:orientation "v"
:space-evenly "false"
:vexpand "false"
:hexpand "false"
:valign "center"
:class "center_boxes"
(revealer
:reveal "${!disk_reveal}"
:transition "slidedown"
:duration "350ms"
(box
:orientation "v"
:class "center_info"
:valign "start"
(label
:class "center_labels"
:text "${disk_used}G/${disk_all}G"
:halign "center")
(scale
:min 0
:max disk_all
:value disk_used
:orientation "h")))
(revealer
:reveal disk_reveal
:transition "slideup"
:duration "350ms"
:valign "center"
(box
:valign "center"
:halign "fill"
:class "center_revealers"
(label
:halign "center"
:text "${disk_free}G free"))
)))))
(defwidget temperature_status []
(eventbox
:onhover "${eww} update temperature_reveal=\"true\""
:onhoverlost "${eww} update temperature_reveal=\"false\""
:tooltip "Internal temperature"
(box
:orientation "h"
:space-evenly "false"
:class "temperature_box"
:vexpand "false"
:hexpand "false"
(image
:class "center_icons"
:path "images/temperature.png"
:image-width 30
:image-height 30)
(box
:orientation "v"
:space-evenly "false"
:vexpand "false"
:hexpand "false"
:valign "center"
:class "center_boxes"
(revealer
:reveal "${!temperature_reveal}"
:transition "slidedown"
:duration "350ms"
(box
:orientation "v"
:class "center_info"
:valign "start"
(label
:class "center_labels"
:text "${temperature}°C"
:halign "center")
(scale
:min 0
:max 100
:value temperature
:orientation "h")))
(revealer
:reveal temperature_reveal
:transition "slideup"
:duration "350ms"
:valign "center"
(box
:valign "center"
:class "center_revealers"
(graph
:thickness 3
:value temperature
:time-range "20s"
:min 0
:max 100
:dynamic "true"
:line-style "round"))
)))))
(defwidget ram_status []
(eventbox
:onhover "${eww} update ram_reveal=\"true\""
:onhoverlost "${eww} update ram_reveal=\"false\""
:tooltip "RAM usage"
(box
:orientation "h"
:space-evenly "false"
:class "ram_box"
:vexpand "false"
:hexpand "false"
(image
:class "center_icons"
:path "images/ram.png"
:image-width 30
:image-height 30)
(box
:orientation "v"
:space-evenly "false"
:vexpand "false"
:hexpand "false"
:valign "center"
:class "center_boxes"
(revealer
:reveal "${!ram_reveal}"
:transition "slidedown"
:duration "350ms"
(box
:orientation "v"
:class "center_info"
:valign "start"
(label
:class "center_labels"
:text "${ram_parsed}"
:halign "center")
(scale
:min 0
:max ram_all
:value ram_used
:orientation "h")))
(revealer
:reveal ram_reveal
:transition "slideup"
:duration "350ms"
:valign "center"
(box
:valign "center"
:class "center_revealers"
(graph
:thickness 3
:value ram_used
:time-range "20s"
:min 0
:max ram_all
:dynamic "true"
:line-style "round"))
)))))
(defwidget battery_status []
(eventbox
:onhover "${eww} update battery_reveal=\"true\""
:onhoverlost "${eww} update battery_reveal=\"false\""
:tooltip "Battery"
(box
:orientation "h"
:space-evenly "false"
:class "battery_box"
:vexpand "false"
:hexpand "false"
(image
:class "center_icons"
:path battery_image
:image-width 30
:image-height 30)
(box
:orientation "v"
:space-evenly "false"
:vexpand "false"
:hexpand "false"
:valign "center"
:class "center_boxes"
(revealer
:reveal "${!battery_reveal}"
:transition "slidedown"
:duration "350ms"
(box
:orientation "v"
:class "center_info"
:valign "start"
(label
:class "center_labels"
:text "${battery_percent}%"
:halign "center")
(scale
:min 0
:max 100
:value battery_percent
:orientation "h")))
(revealer
:reveal battery_reveal
:transition "slideup"
:duration "350ms"
:valign "center"
(box
:valign "center"
:class "center_revealers"
(label
:halign "center"
:text battery_time))
)))))
;; Right widgets
(defwidget widgets_right []
(eventbox
:onhover "${eww} update right_bg=\"#43013b\""
:onhoverlost "${eww} update right_bg=\"#120010\""
(box
:spacing 0
:space-evenly "false"
:class "bars"
:orientation "h"
:valign "fill"
:hexpand "false"
:style "background-color: ${right_bg}"
(power_button)
(time)
(keyboard)
)))
(defwidget power_button []
(eventbox
:cursor "pointer"
:tooltip "Logout options"
(button
:class "power_button"
:valign "center"
:onclick "~/.bscripts/rofi.sh outopts"
"")))
(defwidget time []
(eventbox
:tooltip "Current time"
:onhover "${eww} update date_reveal=true"
:onhoverlost "${eww} update date_reveal=false"
:cursor "pointer"
(button
:onclick "scripts/popup_calendar"
(box
:class "time_box"
:space-evenly "false"
:orientation "h"
:valign "center"
:halign "fill"
(label
:valign "center"
:class "time"
:markup "<span font-weight=\"heavy\">${hour}</span><span font-weight=\"heavy\">:${minutes}</span><span font-size=\"xx-small\">${type}</span>" )
(revealer
:reveal date_reveal
:transition "slideright"
:duration "350ms"
:valign "fill"
(label
:valign "fill"
:class "date"
:markup "<span font-size=\"xx-small\">${date}</span>"
))))))
(defwidget keyboard []
(box
:class "kb_box"
:orientation "h"
:valign "fill"
:halign "center"
"|"
(box
:orientation "v"
:space-evenly "false"
:valign "fill"
:halign "center"
(eventbox
:cursor "pointer"
:tooltip "Change layout to US english"
(button
:class "kb_button_us"
:onclick "scripts/kb_layouts set us"
:style "color: ${us_color}"
:valign "center"
"US"))
(eventbox
:cursor "pointer"
:tooltip "Change layout to US spanish"
(button
:class "kb_button_es"
:onclick "scripts/kb_layouts set es"
:style "color: ${es_color}"
:valign "center"
"ES")
))))

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,17 @@
;tray
[bar/tray]
width = 10
height = 40
offset-x = 1865
offset-y = 25
tray-position = right
tray-detached = true
tray-offset-x = 20
background = ${xrdb:color8:#222}
modules-right = filler
[module/filler]
type = custom/text
format = " "

View File

@ -0,0 +1,100 @@
#!/bin/bash
notify()
{
case $1 in
charging)
if [[ $lstate -ne 3 ]]
then
echo 3 > /tmp/batstate
pop_report -d 800 -m "<span style=\"font-family: CartographCF;\">Charging</span><font size=\"-1\"> ﮣ</font>$icon" -t battery_charging -o "font-size: 70px" "font-family: CaskaydiaCoveNerdFont" "padding-right: 30px"
fi;
;;
high)
echo 2 > /tmp/batstate
;;
mid)
if [[ $lstate -gt 1 ]]
then
echo 1 > /tmp/batstate
~/.ricing/notify-send.sh "Warning: $bat_level% Battery left" -i "~/Pictures/Important/icons/other/battery_mid.png" -t 10000 --replace=550 -u critical
fi;
;;
low)
if [[ $lstate -gt 0 ]]
then
echo 0 > /tmp/batstate
pop_report -m "Battery is critically low" -d 5000 -t battery_low
fi;
;;
esac
}
# Set necessary info
eww="eww -c $HOME/.config/eww/mybar"
lstate=`cat /tmp/batstate`
acpi=`acpi -b`
bat_level_all=`echo "$acpi" | grep -v "unavailable" | grep -E -o "[0-9][0-9]?[0-9]?%"`
bat_level=`echo "$bat_level_all" | awk -F"%" 'BEGIN{tot=0;i=0} {i++; tot+=$1} END{printf("%d%%\n", tot/i)}'`
bat_level=`printf ${bat_level%?}`
discharging=`echo "$acpi" | grep -w 0: | grep -c Discharging`
time=`echo "$acpi" | awk '{printf $5}'`
time=${time::-3}
if [[ $discharging -eq 0 ]]
then
notify charging > /dev/null
$eww update battery_image="images/battery_charging.png"
else
if [[ $bat_level -le 10 ]]
then
$eww update battery_image="images/battery_10.png"
notify low > /dev/null
elif [[ $bat_level -le 20 ]]
then
$eww update battery_image="images/battery_20.png"
notify mid > /dev/null
elif [[ $bat_level -le 30 ]]
then
$eww update battery_image="images/battery_30.png"
notify high > /dev/null
elif [[ $bat_level -le 40 ]]
then
$eww update battery_image="images/battery_40.png"
notify high > /dev/null
elif [[ $bat_level -le 50 ]]
then
$eww update battery_image="images/battery_50.png"
notify high > /dev/null
elif [[ $bat_level -le 60 ]]
then
$eww update battery_image="images/battery_60.png"
notify high > /dev/null
elif [[ $bat_level -le 70 ]]
then
$eww update battery_image="images/battery_70.png"
notify high > /dev/null
elif [[ $bat_level -le 80 ]]
then
$eww update battery_image="images/battery_80.png"
notify high > /dev/null
elif [[ $bat_level -le 90 ]]
then
$eww update battery_image="images/battery_90.png"
notify high > /dev/null
else
$eww update battery_image="images/battery_100.png"
notify high > /dev/null
fi;
fi;
case $1 in
"--time")
[[ $time != "" && $time != "discharg" ]] && echo "$time" || echo "00:00"
;;
"--percentage")
echo "$bat_level"
;;
*)
true
;;
esac

View File

@ -0,0 +1,21 @@
#!/bin/sh
cpu_usage=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
cpu_whole=`printf ${cpu_usage%.*}`
if [[ $cpuwhole -ge 80 ]]
then
true
#update var
elif [[ $cpuwhole -ge 70 ]]
then
true
#update var
else
true
#update var
fi;
echo $cpu_usage

View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
raw=`df -h / | grep /dev/`
case $1 in
"--used" )
value=`echo $raw | awk '{printf $3}'`
;;
"--all" )
value=`echo $raw | awk '{printf $2}'`
;;
"--free" )
value=`echo $raw | awk '{printf $4}'`
;;
* )
true
;;
esac
value=${value::-1}
echo $value

View File

@ -0,0 +1,53 @@
#!/bin/bash
eww="eww -c $HOME/.config/eww/mybar"
set -e
get_kbdlayout() {
layout=$(setxkbmap -query | grep -oP 'layout:\s*\K([\w,]+)')
variant=$(setxkbmap -query | grep -oP 'variant:\s*\K(\w+)')
echo "$layout" "$variant"
}
set_kbdlayout() {
eval "array=($1)"
setxkbmap "${array[@]}"
if [[ "${array[@]}" == "us" ]]
then
$eww update us_color="rgba(230,218,252,1)"
$eww update es_color="rgba(230,218,252,0.4)"
else
$eww update us_color="rgba(230,218,252,0.4)"
$eww update es_color="rgba(230,218,252,1)"
fi;
}
cycle() {
current_layout=$(get_kbdlayout | xargs)
layouts=("$@" "$1") # add the first one at the end so that it cycles
index=0
while [ "${layouts[$index]}" != "$current_layout" ] && [ $index -lt "${#layouts[@]}" ]; do index=$[index +1]; done
next_index=$[index +1]
next_layout=${layouts[$next_index]}
set_kbdlayout "$next_layout"
upper=$(echo $next_layout | tr '[:lower:]' '[:upper:]')
pop_report -m $upper -t keyboard > /dev/null
}
subcommand="$1"
shift || (echo "Please specify one of: get, set <layout>, cycle <layout1> <layout2> ... <layoutN>, i3status" && exit)
case $subcommand in
"get")
echo -n $(get_kbdlayout)
;;
"set")
set_kbdlayout "$1"
;;
"cycle")
cycle "$@"
;;
esac

View File

@ -0,0 +1,25 @@
#!/bin/bash
eww="eww -c $HOME/.config/eww/mybar"
bspc subscribe desktop_focus desktop_layout | while read line; do
case `bspc query -T -d | jq -r .layout` in
tall)
echo "Tall"
;;
tiled)
$eww update layout_button=
;;
grid)
echo "Grid"
;;
monocle)
$eww update layout_button=
;;
even)
echo "Even"
;;
*)
echo "?"
;;
esac;
done

View File

@ -0,0 +1,76 @@
#!/usr/bin/env bash
# Selects player based on if they're playing or if they have a cover
# Note: Being played takes priority
select_player () {
playingplayer=""
coverplayer=""
totalplayer=""
for player in "$player"s
do
art=`playerctl --player="$player" metadata mpris:artUrl 2> /dev/null`
status=`playerctl --player="$player" status 2> /dev/null`
[[ $status == "Playing" ]] && playingplayer="$player"
[[ $art != "" ]] && coverplayer="$player"
[[ $status == "Playing" && $art != "" ]] && totalplayer="$player"
done;
player=""
[[ ! -z $coverplayer ]] && player=$coverplayer
[[ ! -z $playingplayer ]] && player=$playingplayer
[[ ! -z $totalplayer ]] && player=$totalplayer
}
# Get general info
eww="eww -c $HOME/.config/eww/mybar"
players=`playerctl -l`
select_player
status=`playerctl --player="$player" status`
[[ $status == "" ]] && exit
# Toggle play pause and update status accordingly
toggle () {
[[ $status == "Playing" ]] && $eww update media_status=""|| $eww update media_status=""
playerctl --player="$player" play-pause
}
# Seek to an specific time
seek () {
seekt="$1"
position=`playerctl --player=$player position`
if [[ $? -eq 0 ]] && [[ `python -c "print(round(abs($seekt-$position)))"` -gt 3 ]]
then
playerctl --player=$player position $seekt
fi;
}
# Rewind or fast forward 5 seconds
move () {
move="$1"
startpos=`playerctl --player=$player position`
length=`playerctl --player="$player" metadata mpris:length`
length=`python -c "print($length/1000000)"`
if [[ $? -eq 0 ]]
then
endpos=`python -c "print(min($length, max(0, $startpos $move)))"`
playerctl --player=$player position $endpos
fi;
}
case $1 in
--toggle )
toggle
;;
--seek )
seek $2
;;
--move )
move $2
;;
--next )
playerctl --player=$player next
;;
--prev )
playerctl --player=$player previous
;;
esac

View File

@ -0,0 +1,107 @@
#!/usr/bin/env bash
# Selects player based on if they're playing or if they have a cover
# Note: Being played takes priority
select_player () {
playingplayer=""
coverplayer=""
totalplayer=""
playerctl -l | while read -r player;
do
art=`playerctl --player="$player" metadata mpris:artUrl 2> /dev/null`
status=`playerctl --player="$player" status 2> /dev/null`
[[ $status == "Playing" ]] && playingplayer="$player"
[[ $art != "" ]] && coverplayer="$player"
[[ $status == "Playing" && $art != "" ]] && totalplayer="$player"
[[ ! -z $coverplayer ]] && player="$coverplayer"
[[ ! -z $playingplayer ]] && player="$playingplayer"
[[ ! -z $totalplayer ]] && player="$totalplayer"
echo "$player"
done;
}
update_cover () {
if [[ -z $newimg ]]
then
newimg="$imgdir/music.png"
cp "$newimg" "$imgdir/currmedia.png"
echo "Image is unknown, using template"
elif [[ `echo $newimg | grep -c "file://"` -gt 0 ]]
then
cp "`echo $newimg | sed 's/file:\/\///g'`" "$imgdir/currmedia.png"
echo "Image is a file, succesfully coppied"
else
curl "$newimg" -o "$imgdir/currmedia.png" -s
echo "Image is an url, succesfully downloaded"
fi;
$eww update cover="$imgdir/currmedia.png"
}
imgdir="$HOME/.config/eww/mybar/images"
lastimg="none"
eww="eww -c $HOME/.config/eww/mybar"
while true; do
if [[ ! -z `playerctl status` ]]
then
player=`select_player | tail -1`
status=""
status=`playerctl --player="$player" status`
echo "Selected $player as player"
# Update status button
if [[ $status == "Playing" ]]
then
$eww update media_status=""
else
$eww update media_status=""
fi;
# Update title and artist
title=`playerctl --player="$player" metadata xesam:title`
[[ -z $title ]] && title="No title"
title_parsed=`$HOME/.config/eww/mybar/scripts/parse_jp "$title"`
$eww update title="$title"
$eww update title_parsed="$title_parsed"
artist=`playerctl --player="$player" metadata xesam:artist`
[[ -z $artist ]] && artist="No artist"
artist_parsed=`$HOME/.config/eww/mybar/scripts/parse_jp "$artist"`
$eww update artist="$artist"
$eww update artist_parsed="$artist_parsed"
# Update length and position
position=`playerctl --player="$player" position`
[[ -z $position ]] && position=0
$eww update position="$position"
length=`playerctl --player="$player" metadata mpris:length`
length=`python -c "print($length/1000000)"`
[[ -z $length ]] && length=100
$eww update length="$length"
newimg=`playerctl --player="$player" metadata mpris:artUrl 2> /dev/null\
| sed "s/https:\/\/i.ytimg.com\/vi\//https:\/\/img.youtube.com\/vi\//g"\
| sed "s/hq/maxres/g"`
if [[ "$newimg" != "$lastimg" ]]
then
echo "New image $newimg detected"
lastimg=$newimg
update_cover&
fi;
else
# Update everything to default values
$eww update media_status=""
$eww update title_parsed="No title"
$eww update title="No title"
$eww update artist="No artist"
$eww update artist_parsed="No artist"
$eww update position=0
$eww update length=100
$eww update cover="images/music.png"
lastimg=""
fi;
sleep 1
echo ""
done;

View File

@ -0,0 +1,44 @@
#!/bin/python3
import sys
# -*- coding:utf-8 -*-
ranges = [
{"from": ord(u"\u3300"), "to": ord(u"\u33ff")}, # compatibility ideographs
{"from": ord(u"\ufe30"), "to": ord(u"\ufe4f")}, # compatibility ideographs
{"from": ord(u"\uf900"), "to": ord(u"\ufaff")}, # compatibility ideographs
{"from": ord(u"\U0002F800"), "to": ord(u"\U0002fa1f")}, # compatibility ideographs
{'from': ord(u'\u3040'), 'to': ord(u'\u309f')}, # Japanese Hiragana
{"from": ord(u"\u30a0"), "to": ord(u"\u30ff")}, # Japanese Katakana
{"from": ord(u"\u2e80"), "to": ord(u"\u2eff")}, # cjk radicals supplement
{"from": ord(u"\u4e00"), "to": ord(u"\u9fff")},
{"from": ord(u"\u3400"), "to": ord(u"\u4dbf")},
{"from": ord(u"\U00020000"), "to": ord(u"\U0002a6df")},
{"from": ord(u"\U0002a700"), "to": ord(u"\U0002b73f")},
{"from": ord(u"\U0002b740"), "to": ord(u"\U0002b81f")},
{"from": ord(u"\U0002b820"), "to": ord(u"\U0002ceaf")} # included as of Unicode 8.0
]
def is_cjk(char):
return any([range["from"] <= ord(char) <= range["to"] for range in ranges])
def cjk_substrings(string):
i = 0
while i<len(string):
if is_cjk(string[i]):
start = i
try:
while is_cjk(string[i]): i += 1
yield string[start:i]
except:
yield string[start:i]
i += 1
ogstring = str(sys.argv[1])
string = ogstring[0:20]
if len(ogstring) > len(string):
string = string + "…"
for sub in cjk_substrings(string):
string = string.replace(sub, "<span font-family= \"M PLUS 1\" font-size=\"x-small\" rise=\"3pt\" font-weight=\"bold\">" + sub + "</span>")
print(string)

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
eww="eww -c $HOME/.config/eww/mybar"
$eww close calendar || (\
$eww update day="`scripts/time_info --day`"; \
$eww update month="`scripts/time_info --month`"; \
$eww update year="`scripts/time_info --year`"; \
$eww open calendar )

View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
eww="eww -c $HOME/.config/eww/mybar"
$eww close music || (\
$eww open music )

View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
case $1 in
"--used")
free -m | grep Mem | awk '{printf $3/100}'
;;
"--all")
free -m | grep Mem | awk '{printf $2/100}'
;;
"--parsed")
free -h | grep Mem | awk '{printf $3 "/" $2}'
;;
*)
true
;;
esac

View File

@ -0,0 +1,4 @@
#!/bin/sh
temp=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '[0-9]*.[0-9]*°C' -o)
temp=${temp::-4}
echo "$temp"

View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
case $1 in
"--hour")
date "+%I"
;;
"--minutes")
date "+%M"
;;
"--type")
date "+%p"
;;
"--date")
date "+ %a, %b %d"
;;
"--day")
date "+%d"
;;
"--month")
$(( `date "+%m"` -1 ))
;;
"--year")
date "+%y"
;;
*)
true
;;
esac

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
total=`xdotool get_num_desktops`
icon1=○
icon2=◎
icon3=●
eww="eww -c $HOME/.config/eww/mybar/"
bspc subscribe desktop_focus node_add node_remove 2> /dev/null | while read line; do
currwp=$((`xdotool get_desktop`))
for (( i = 0; i < $total; i++));
do
if [[ $i -eq $currwp ]]
then
$eww update wp$i=$icon3
else
[[ `bspc query -N -d $i | wc -l` -gt 0 ]] && $eww update wp$i=$icon2 || $eww update wp$i=$icon1
fi;
done
echo cycle
done

View File

@ -14,24 +14,27 @@ xsetroot -cursor_name left_ptr &
# background
#feh --bg-fill /usr/share/backgrounds/arcolinux/arco-wallpaper.jpg &
dwall -p -s firewatch
#dwall -p -s firewatch
~/scripts/random_wallpaper.sh
# other apps
run variety &
#run variety &
run nm-applet &
run pamac-tray &
run xfce4-power-manager &
#run pamac-tray &
#run xfce4-power-manager &
run volumeicon &
run bitwarden-desktop &
numlockx on &
blueberry-tray &
#run bitwarden-desktop &
#numlockx on &
#blueberry-tray &
run lxsession &
fcitx &
picom -b --config $HOME/.xmonad/scripts/picom.conf &
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
/usr/lib/xfce4/notifyd/xfce4-notifyd &
#/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
#/usr/lib/xfce4/notifyd/xfce4-notifyd &
#seadrive-gui &
trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 0 --transparent true --alpha 0 --tint 0x282c34 --height 16 &
emacs --daemon &
sleep 2
trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 0 --transparent true --alpha 0 --tint 0x282c34 --height 16 &

View File

@ -1,7 +1,7 @@
-- Base
-- Base
import XMonad
import System.Directory
import System.IO (hPutStrLn)
import System.IO (hClose, hPutStr, hPutStrLn)
import System.Exit (exitSuccess)
import qualified XMonad.StackSet as W
@ -27,10 +27,13 @@ import qualified Data.Map as M
-- Hooks
import XMonad.Hooks.DynamicLog (dynamicLogWithPP, wrap, xmobarPP, xmobarColor, shorten, PP(..))
import XMonad.Hooks.EwmhDesktops -- for some fullscreen events, also for xcomposite in obs.
import XMonad.Hooks.ManageDocks (avoidStruts, docksEventHook, manageDocks, ToggleStruts(..))
import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat)
import XMonad.Hooks.ManageDocks (avoidStruts, docks, manageDocks, ToggleStruts(..))
import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat, doCenterFloat)
import XMonad.Hooks.ServerMode
import XMonad.Hooks.SetWMName
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.Hooks.WindowSwallowing
import XMonad.Hooks.WorkspaceHistory
-- Layouts
@ -45,7 +48,6 @@ import XMonad.Layout.ThreeColumns
-- Layouts modifiers
import XMonad.Layout.LayoutModifier
import XMonad.Layout.LimitWindows (limitWindows, increaseLimit, decreaseLimit)
import XMonad.Layout.Magnifier
import XMonad.Layout.MultiToggle (mkToggle, single, EOT(EOT), (??))
import XMonad.Layout.MultiToggle.Instances (StdTransformers(NBFULL, MIRROR, NOBORDERS))
import XMonad.Layout.NoBorders
@ -55,16 +57,56 @@ import XMonad.Layout.Simplest
import XMonad.Layout.Spacing
import XMonad.Layout.SubLayouts
import XMonad.Layout.WindowArranger (windowArrange, WindowArrangerMsg(..))
import XMonad.Layout.WindowNavigation
import qualified XMonad.Layout.ToggleLayouts as T (toggleLayouts, ToggleLayout(Toggle))
import qualified XMonad.Layout.MultiToggle as MT (Toggle(..))
-- Utilities
import XMonad.Util.Dmenu
import XMonad.Util.EZConfig (additionalKeysP)
import XMonad.Util.EZConfig (additionalKeysP, mkNamedKeymap)
import XMonad.Util.NamedActions
import XMonad.Util.NamedScratchpad
import XMonad.Util.Run (runProcessWithInput, safeSpawn, spawnPipe)
import XMonad.Util.SpawnOnce
-- ColorScheme module (SET ONLY ONE!)
-- Possible choice are:
-- DoomOne
-- Dracula
-- GruvboxDark
-- MonokaiPro
-- Nord
-- OceanicNext
-- Palenight
-- SolarizedDark
-- SolarizedLight
-- TomorrowNight
colorScheme = "doom-one"
colorBack = "#282c34"
colorFore = "#bbc2cf"
color01 = "#1c1f24"
color02 = "#ff6c6b"
color03 = "#98be65"
color04 = "#da8548"
color05 = "#51afef"
color06 = "#c678dd"
color07 = "#5699af"
color08 = "#202328"
color09 = "#5b6268"
color10 = "#da8548"
color11 = "#4db5bd"
color12 = "#ecbe7b"
color13 = "#3071db"
color14 = "#a9a1e1"
color15 = "#46d9ff"
color16 = "#dfdfdf"
colorTrayer :: String
colorTrayer = "--tint 0x282c34"
myFont :: String
myFont = "xft:NanumGothic:regular:size=9:antialias=true:hinting=true"
@ -130,83 +172,7 @@ myStartupHook = do
-- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh
setWMName "LG3D"
myColorizer :: Window -> Bool -> X (String, String)
myColorizer = colorRangeFromClassName
(0x28,0x2c,0x34) -- lowest inactive bg
(0x28,0x2c,0x34) -- highest inactive bg
(0xc7,0x92,0xea) -- active bg
(0xc0,0xa7,0x9a) -- inactive fg
(0x28,0x2c,0x34) -- active fg
-- gridSelect menu layout
mygridConfig :: p -> GSConfig Window
mygridConfig colorizer = (buildDefaultGSConfig myColorizer)
{ gs_cellheight = 40
, gs_cellwidth = 200
, gs_cellpadding = 6
, gs_originFractX = 0.5
, gs_originFractY = 0.5
, gs_font = myFont
}
spawnSelected' :: [(String, String)] -> X ()
spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn
where conf = def
{ gs_cellheight = 40
, gs_cellwidth = 200
, gs_cellpadding = 6
, gs_originFractX = 0.5
, gs_originFractY = 0.5
, gs_font = myFont
}
myAppGrid = [ --("Audacity", "audacity")
--, ("Deadbeef", "deadbeef")
("Vivaldi", "vivaldi-stable")
, ("Emacs", "emacsclient -c -a emacs")
, ("Firefox", "firefox")
, ("Vivaldi", "vivaldi-stable")
--, ("Geany", "geany")
--, ("Geary", "geary")
, ("Gimp", "gimp")
, ("Kdenlive", "kdenlive")
, ("LibreOffice Impress", "loimpress")
, ("LibreOffice Writer", "lowriter")
--, ("OBS", "obs")
, ("PCManFM", "pcmanfm")
]
myScratchPads :: [NamedScratchpad]
myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm
, NS "mocp" spawnMocp findMocp manageMocp
, NS "calculator" spawnCalc findCalc manageCalc
]
where
spawnTerm = myTerminal ++ " -t scratchpad"
findTerm = title =? "scratchpad"
manageTerm = customFloating $ W.RationalRect l t w h
where
h = 0.9
w = 0.9
t = 0.95 -h
l = 0.95 -w
spawnMocp = myTerminal ++ " -t mocp -e mocp"
findMocp = title =? "mocp"
manageMocp = customFloating $ W.RationalRect l t w h
where
h = 0.9
w = 0.9
t = 0.95 -h
l = 0.95 -w
spawnCalc = "qalculate-gtk"
findCalc = className =? "Qalculate-gtk"
manageCalc = customFloating $ W.RationalRect l t w h
where
h = 0.5
w = 0.4
t = 0.75 -h
l = 0.70 -w
-- Theme for showWName which prints current workspace when you change workspaces.
--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
@ -220,53 +186,52 @@ mySpacing' i = spacingRaw True (Border i i i i) True (Border i i i i) True
-- limitWindows n sets maximum number of windows displayed for layout.
-- mySpacing n sets the gap size around the windows.
tall = renamed [Replace "tall"]
$ limitWindows 5
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ limitWindows 12
$ mySpacing 8
$ ResizableTall 1 (3/100) (1/2) []
magnify = renamed [Replace "magnify"]
$ smartBorders
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ magnifier
$ limitWindows 12
$ mySpacing 8
$ ResizableTall 1 (3/100) (1/2) []
monocle = renamed [Replace "monocle"]
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ limitWindows 20 Full
$ Full
floats = renamed [Replace "floats"]
$ smartBorders
$ limitWindows 20 simplestFloat
$ simplestFloat
grid = renamed [Replace "grid"]
$ limitWindows 9
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ limitWindows 12
$ mySpacing 8
$ mkToggle (single MIRROR)
$ Grid (16/10)
spirals = renamed [Replace "spirals"]
$ limitWindows 9
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ mySpacing' 8
$ spiral (6/7)
threeCol = renamed [Replace "threeCol"]
$ limitWindows 7
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ limitWindows 7
$ ThreeCol 1 (3/100) (1/2)
threeRow = renamed [Replace "threeRow"]
$ limitWindows 7
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ limitWindows 7
-- Mirror takes a layout and rotates it by 90 degrees.
-- So we are applying Mirror to the ThreeCol layout.
$ Mirror
@ -282,38 +247,40 @@ wideAccordion = renamed [Replace "wideAccordion"]
-- setting colors for tabs layout and tabs sublayout.
myTabTheme = def { fontName = myFont
, activeColor = "#46d9ff"
, inactiveColor = "#313846"
, activeBorderColor = "#46d9ff"
, inactiveBorderColor = "#282c34"
, activeTextColor = "#282c34"
, inactiveTextColor = "#d0d0d0"
, activeColor = color15
, inactiveColor = color08
, activeBorderColor = color15
, inactiveBorderColor = colorBack
, activeTextColor = colorBack
, inactiveTextColor = color16
}
-- Theme for showWName which prints current workspace when you change workspaces.
myShowWNameTheme :: SWNConfig
myShowWNameTheme = def
{ swn_font = "xft:Ubuntu:bold:size=60"
, swn_fade = 1.0
, swn_bgcolor = "#1c1f24"
, swn_color = "#ffffff"
}
{ swn_font = "xft:Ubuntu:bold:size=60"
, swn_fade = 1.0
, swn_bgcolor = "#1c1f24"
, swn_color = "#ffffff"
}
-- The layout hook
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats
myLayoutHook = avoidStruts
$ mouseResize
$ windowArrange
$ T.toggleLayouts floats
$ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout
where
myDefaultLayout = withBorder myBorderWidth tall
||| magnify
||| noBorders monocle
||| floats
||| noBorders tabs
||| grid
||| spirals
||| threeCol
||| threeRow
||| tallAccordion
||| wideAccordion
where
myDefaultLayout = withBorder myBorderWidth tall
||| noBorders monocle
||| floats
||| noBorders tabs
||| grid
||| spirals
||| threeCol
||| threeRow
||| tallAccordion
||| wideAccordion
myWorkspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 "]
-- myWorkspaces = [" dev ", " www ", " sys ", " doc ", " vbox ", " chat ", " mus ", " vid ", " gfx "]
@ -347,7 +314,7 @@ myManageHook = composeAll
--, className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 )
, (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog
, (className =? "steam" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog
] <+> namedScratchpadManageHook myScratchPads
]
myKeys :: [(String, X ())]
myKeys =
@ -397,8 +364,8 @@ myKeys =
--, ("M-S-i", incScreenSpacing 4) -- Increase screen spacing
-- Grid Select (CTR-g followed by a key)
, ("M-g g", spawnSelected' myAppGrid) -- grid select favorite apps
, ("M-g t", goToSelected $ mygridConfig myColorizer) -- goto selected window
--, ("M-g g", spawnSelected' myAppGrid) -- grid select favorite apps
--, ("M-g t", goToSelected $ mygridConfig myColorizer) -- goto selected window
--, ("C-g b", bringSelected $ mygridConfig myColorizer) -- bring selected window
-- Windows navigation
@ -495,8 +462,7 @@ main = do
, handleEventHook = serverModeEventHookCmd
<+> serverModeEventHook
<+> serverModeEventHookF "XMONAD_PRINT" (io . putStrLn)
<+> docksEventHook
<+> fullscreenEventHook -- this does NOT work right if using multi-monitors!
-- <+> fullscreenEventHook -- this does NOT work right if using multi-monitors!
, modMask = myModMask
, terminal = myTerminal
, startupHook = myStartupHook
@ -505,7 +471,7 @@ main = do
, borderWidth = myBorderWidth
, normalBorderColor = myNormColor
, focusedBorderColor = myFocusColor
, logHook = dynamicLogWithPP $ namedScratchpadFilterOutWorkspacePP $ xmobarPP
, logHook = dynamicLogWithPP $ xmobarPP
-- the following variables beginning with 'pp' are settings for xmobar.
{ ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1
-- >> hPutStrLn xmproc1 x -- xmobar on monitor 2

View File

@ -3,546 +3,511 @@
* Xmonad
** Import
#+begin_src haskell :tangle ./xmonad.hs
-- Base
import XMonad
import System.Directory
import System.IO (hPutStrLn)
import System.Exit (exitSuccess)
import qualified XMonad.StackSet as W
-- Base
import XMonad
import System.Directory
import System.IO (hClose, hPutStr, hPutStrLn)
import System.Exit (exitSuccess)
import qualified XMonad.StackSet as W
-- Actions
import XMonad.Actions.CopyWindow (kill1)
import XMonad.Actions.CycleWS (Direction1D(..), moveTo, shiftTo, WSType(..), nextScreen, prevScreen)
import XMonad.Actions.GridSelect
import XMonad.Actions.MouseResize
import XMonad.Actions.Promote
import XMonad.Actions.RotSlaves (rotSlavesDown, rotAllDown)
import XMonad.Actions.WindowGo (runOrRaise)
import XMonad.Actions.WithAll (sinkAll, killAll)
import qualified XMonad.Actions.Search as S
-- Actions
import XMonad.Actions.CopyWindow (kill1)
import XMonad.Actions.CycleWS (Direction1D(..), moveTo, shiftTo, WSType(..), nextScreen, prevScreen)
import XMonad.Actions.GridSelect
import XMonad.Actions.MouseResize
import XMonad.Actions.Promote
import XMonad.Actions.RotSlaves (rotSlavesDown, rotAllDown)
import XMonad.Actions.WindowGo (runOrRaise)
import XMonad.Actions.WithAll (sinkAll, killAll)
import qualified XMonad.Actions.Search as S
-- Data
import Data.Char (isSpace, toUpper)
import Data.Maybe (fromJust)
import Data.Monoid
import Data.Maybe (isJust)
import Data.Tree
import qualified Data.Map as M
-- Data
import Data.Char (isSpace, toUpper)
import Data.Maybe (fromJust)
import Data.Monoid
import Data.Maybe (isJust)
import Data.Tree
import qualified Data.Map as M
-- Hooks
import XMonad.Hooks.DynamicLog (dynamicLogWithPP, wrap, xmobarPP, xmobarColor, shorten, PP(..))
import XMonad.Hooks.EwmhDesktops -- for some fullscreen events, also for xcomposite in obs.
import XMonad.Hooks.ManageDocks (avoidStruts, docksEventHook, manageDocks, ToggleStruts(..))
import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat)
import XMonad.Hooks.ServerMode
import XMonad.Hooks.SetWMName
import XMonad.Hooks.WorkspaceHistory
-- Hooks
import XMonad.Hooks.DynamicLog (dynamicLogWithPP, wrap, xmobarPP, xmobarColor, shorten, PP(..))
import XMonad.Hooks.EwmhDesktops -- for some fullscreen events, also for xcomposite in obs.
import XMonad.Hooks.ManageDocks (avoidStruts, docks, manageDocks, ToggleStruts(..))
import XMonad.Hooks.ManageHelpers (isFullscreen, doFullFloat, doCenterFloat)
import XMonad.Hooks.ServerMode
import XMonad.Hooks.SetWMName
import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP
import XMonad.Hooks.WindowSwallowing
import XMonad.Hooks.WorkspaceHistory
-- Layouts
import XMonad.Layout.Accordion
import XMonad.Layout.GridVariants (Grid(Grid))
import XMonad.Layout.SimplestFloat
import XMonad.Layout.Spiral
import XMonad.Layout.ResizableTile
import XMonad.Layout.Tabbed
import XMonad.Layout.ThreeColumns
-- Layouts
import XMonad.Layout.Accordion
import XMonad.Layout.GridVariants (Grid(Grid))
import XMonad.Layout.SimplestFloat
import XMonad.Layout.Spiral
import XMonad.Layout.ResizableTile
import XMonad.Layout.Tabbed
import XMonad.Layout.ThreeColumns
-- Layouts modifiers
import XMonad.Layout.LayoutModifier
import XMonad.Layout.LimitWindows (limitWindows, increaseLimit, decreaseLimit)
import XMonad.Layout.Magnifier
import XMonad.Layout.MultiToggle (mkToggle, single, EOT(EOT), (??))
import XMonad.Layout.MultiToggle.Instances (StdTransformers(NBFULL, MIRROR, NOBORDERS))
import XMonad.Layout.NoBorders
import XMonad.Layout.Renamed
import XMonad.Layout.ShowWName
import XMonad.Layout.Simplest
import XMonad.Layout.Spacing
import XMonad.Layout.SubLayouts
import XMonad.Layout.WindowArranger (windowArrange, WindowArrangerMsg(..))
import qualified XMonad.Layout.ToggleLayouts as T (toggleLayouts, ToggleLayout(Toggle))
import qualified XMonad.Layout.MultiToggle as MT (Toggle(..))
-- Layouts modifiers
import XMonad.Layout.LayoutModifier
import XMonad.Layout.LimitWindows (limitWindows, increaseLimit, decreaseLimit)
import XMonad.Layout.MultiToggle (mkToggle, single, EOT(EOT), (??))
import XMonad.Layout.MultiToggle.Instances (StdTransformers(NBFULL, MIRROR, NOBORDERS))
import XMonad.Layout.NoBorders
import XMonad.Layout.Renamed
import XMonad.Layout.ShowWName
import XMonad.Layout.Simplest
import XMonad.Layout.Spacing
import XMonad.Layout.SubLayouts
import XMonad.Layout.WindowArranger (windowArrange, WindowArrangerMsg(..))
import XMonad.Layout.WindowNavigation
import qualified XMonad.Layout.ToggleLayouts as T (toggleLayouts, ToggleLayout(Toggle))
import qualified XMonad.Layout.MultiToggle as MT (Toggle(..))
-- Utilities
import XMonad.Util.Dmenu
import XMonad.Util.EZConfig (additionalKeysP)
import XMonad.Util.NamedScratchpad
import XMonad.Util.Run (runProcessWithInput, safeSpawn, spawnPipe)
import XMonad.Util.SpawnOnce
-- Utilities
import XMonad.Util.Dmenu
import XMonad.Util.EZConfig (additionalKeysP, mkNamedKeymap)
import XMonad.Util.NamedActions
import XMonad.Util.NamedScratchpad
import XMonad.Util.Run (runProcessWithInput, safeSpawn, spawnPipe)
import XMonad.Util.SpawnOnce
-- ColorScheme module (SET ONLY ONE!)
-- Possible choice are:
-- DoomOne
-- Dracula
-- GruvboxDark
-- MonokaiPro
-- Nord
-- OceanicNext
-- Palenight
-- SolarizedDark
-- SolarizedLight
-- TomorrowNight
#+end_src
** Color Definition
#+begin_src haskell :tangle ./xmonad.hs
colorScheme = "doom-one"
colorBack = "#282c34"
colorFore = "#bbc2cf"
color01 = "#1c1f24"
color02 = "#ff6c6b"
color03 = "#98be65"
color04 = "#da8548"
color05 = "#51afef"
color06 = "#c678dd"
color07 = "#5699af"
color08 = "#202328"
color09 = "#5b6268"
color10 = "#da8548"
color11 = "#4db5bd"
color12 = "#ecbe7b"
color13 = "#3071db"
color14 = "#a9a1e1"
color15 = "#46d9ff"
color16 = "#dfdfdf"
colorTrayer :: String
colorTrayer = "--tint 0x282c34"
#+end_src
** Gobal Variable
#+begin_src haskell :tangle ./xmonad.hs
myFont :: String
myFont = "xft:NanumGothic:regular:size=9:antialias=true:hinting=true"
myFont :: String
myFont = "xft:NanumGothic:regular:size=9:antialias=true:hinting=true"
myEmojiFont :: String
myEmojiFont = "xft:Noto Fonts Emoji:regular:size=9:antialias=true:hinting=true"
myEmojiFont :: String
myEmojiFont = "xft:Noto Fonts Emoji:regular:size=9:antialias=true:hinting=true"
myModMask :: KeyMask
myModMask = mod4Mask -- Sets modkey to super/windows key
myModMask :: KeyMask
myModMask = mod4Mask -- Sets modkey to super/windows key
myTerminal :: String
myTerminal = "alacritty" -- Sets default terminal
myTerminal :: String
myTerminal = "alacritty" -- Sets default terminal
myBrowser :: String
myBrowser = "qutebrowser " -- Sets qutebrowser as browser
myBrowser :: String
myBrowser = "qutebrowser " -- Sets qutebrowser as browser
myEmacs :: String
myEmacs = "emacsclient -c -a 'emacs' " -- Makes emacs keybindings easier to type
myEmacs :: String
myEmacs = "emacsclient -c -a 'emacs' " -- Makes emacs keybindings easier to type
myEditor :: String
myEditor = "emacsclient -c -a 'emacs' " -- Sets emacs as editor
-- myEditor = myTerminal ++ " -e vim " -- Sets vim as editor
myEditor :: String
myEditor = "emacsclient -c -a 'emacs' " -- Sets emacs as editor
-- myEditor = myTerminal ++ " -e vim " -- Sets vim as editor
myBorderWidth :: Dimension
myBorderWidth = 2 -- Sets border width for windows
myBorderWidth :: Dimension
myBorderWidth = 2 -- Sets border width for windows
myNormColor :: String
myNormColor = "#282c34" -- Border color of normal windows
myNormColor :: String
myNormColor = "#282c34" -- Border color of normal windows
myFocusColor :: String
myFocusColor = "#46d9ff" -- Border color of focused windows
myFocusColor :: String
myFocusColor = "#46d9ff" -- Border color of focused windows
altMask :: KeyMask
altMask = mod1Mask -- Setting this for use in xprompts
altMask :: KeyMask
altMask = mod1Mask -- Setting this for use in xprompts
windowCount :: X (Maybe String)
windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace . W.current . windowset
windowCount :: X (Maybe String)
windowCount = gets $ Just . show . length . W.integrate' . W.stack . W.workspace . W.current . windowset
#+end_src
** StartupHook
#+begin_src haskell :tangle ./xmonad.hs
myStartupHook :: X ()
myStartupHook = do
--spawnOnce "xrandr --output DP-4 --primary --mode 2560x1440 --pos 0x0 --rotate normal --output HDMI-0 --mode 1920x1080 --pos 2560x0 --rotate normal"
spawn "$HOME/.xmonad/scripts/autostart.sh"
--spawnOnce "nm-applet &"
--spawnOnce "picom -b --config ~/.xmonad/picom.conf &"
--spawnOnce "picom --experimental-backends -b --config ~/.xmonad/picom.conf &"
--spawnOnce "dwall -s firewatch &"
--spawnOnce "fcitx &"
--spawnOnce "seafile-applet &"
--spawnOnce "seadrive-gui &"
--spawnOnce "blueberry-tray &"
--spawnOnce "volumeicon &"
--spawnOnce "enpass"
--spawnOnce "green-tunnel -s &"
--spawnOnce "trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 0 --transparent true --alpha 0 --tint 0x282c34 --height 24 &"
--spawnOnce "/usr/bin/emacs --daemon &"
-- spawnOnce "/usr/bin/emacs --daemon &" -- emacs daemon for the emacsclient
-- spawnOnce "kak -d -s mysession &" -- kakoune daemon for better performance
-- spawnOnce "urxvtd -q -o -f &" -- urxvt daemon for better performance
--spawnOnce "xargs xwallpaper --stretch < ~/.xwallpaper" -- set last saved with xwallpaper
-- spawnOnce "/bin/ls ~/wallpapers | shuf -n 1 | xargs xwallpaper --stretch" -- set random xwallpaper
-- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper
-- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper
-- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh
setWMName "LG3D"
myStartupHook :: X ()
myStartupHook = do
--spawnOnce "xrandr --output DP-4 --primary --mode 2560x1440 --pos 0x0 --rotate normal --output HDMI-0 --mode 1920x1080 --pos 2560x0 --rotate normal"
spawn "$HOME/.xmonad/scripts/autostart.sh"
--spawnOnce "nm-applet &"
--spawnOnce "picom -b --config ~/.xmonad/picom.conf &"
--spawnOnce "picom --experimental-backends -b --config ~/.xmonad/picom.conf &"
--spawnOnce "dwall -s firewatch &"
--spawnOnce "fcitx &"
--spawnOnce "seafile-applet &"
--spawnOnce "seadrive-gui &"
--spawnOnce "blueberry-tray &"
--spawnOnce "volumeicon &"
--spawnOnce "enpass"
--spawnOnce "green-tunnel -s &"
--spawnOnce "trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 0 --transparent true --alpha 0 --tint 0x282c34 --height 24 &"
--spawnOnce "/usr/bin/emacs --daemon &"
-- spawnOnce "/usr/bin/emacs --daemon &" -- emacs daemon for the emacsclient
-- spawnOnce "kak -d -s mysession &" -- kakoune daemon for better performance
-- spawnOnce "urxvtd -q -o -f &" -- urxvt daemon for better performance
--spawnOnce "xargs xwallpaper --stretch < ~/.xwallpaper" -- set last saved with xwallpaper
-- spawnOnce "/bin/ls ~/wallpapers | shuf -n 1 | xargs xwallpaper --stretch" -- set random xwallpaper
-- spawnOnce "~/.fehbg &" -- set last saved feh wallpaper
-- spawnOnce "feh --randomize --bg-fill ~/wallpapers/*" -- feh set random wallpaper
-- spawnOnce "nitrogen --restore &" -- if you prefer nitrogen to feh
setWMName "LG3D"
#+end_src
** Layout
#+begin_src haskell :tangle ./xmonad.hs
-- Theme for showWName which prints current workspace when you change workspaces.
--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
myColorizer :: Window -> Bool -> X (String, String)
myColorizer = colorRangeFromClassName
(0x28,0x2c,0x34) -- lowest inactive bg
(0x28,0x2c,0x34) -- highest inactive bg
(0xc7,0x92,0xea) -- active bg
(0xc0,0xa7,0x9a) -- inactive fg
(0x28,0x2c,0x34) -- active fg
-- 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
-- gridSelect menu layout
mygridConfig :: p -> GSConfig Window
mygridConfig colorizer = (buildDefaultGSConfig myColorizer)
{ gs_cellheight = 40
, gs_cellwidth = 200
, gs_cellpadding = 6
, gs_originFractX = 0.5
, gs_originFractY = 0.5
, gs_font = myFont
}
-- Defining a bunch of layouts, many that I don't use.
-- limitWindows n sets maximum number of windows displayed for layout.
-- mySpacing n sets the gap size around the windows.
tall = renamed [Replace "tall"]
$ limitWindows 5
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ mySpacing 8
$ ResizableTall 1 (3/100) (1/2) []
monocle = renamed [Replace "monocle"]
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ Full
floats = renamed [Replace "floats"]
$ smartBorders
$ simplestFloat
grid = renamed [Replace "grid"]
$ limitWindows 9
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ mySpacing 8
$ mkToggle (single MIRROR)
$ Grid (16/10)
spirals = renamed [Replace "spirals"]
$ limitWindows 9
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ mySpacing' 8
$ spiral (6/7)
threeCol = renamed [Replace "threeCol"]
$ limitWindows 7
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ ThreeCol 1 (3/100) (1/2)
threeRow = renamed [Replace "threeRow"]
$ limitWindows 7
$ smartBorders
$ windowNavigation
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
-- Mirror takes a layout and rotates it by 90 degrees.
-- So we are applying Mirror to the ThreeCol layout.
$ Mirror
$ ThreeCol 1 (3/100) (1/2)
tabs = renamed [Replace "tabs"]
-- I cannot add spacing to this layout because it will
-- add spacing between window and tabs which looks bad.
$ tabbed shrinkText myTabTheme
tallAccordion = renamed [Replace "tallAccordion"]
$ Accordion
wideAccordion = renamed [Replace "wideAccordion"]
$ Mirror Accordion
spawnSelected' :: [(String, String)] -> X ()
spawnSelected' lst = gridselect conf lst >>= flip whenJust spawn
where conf = def
{ gs_cellheight = 40
, gs_cellwidth = 200
, gs_cellpadding = 6
, gs_originFractX = 0.5
, gs_originFractY = 0.5
, gs_font = myFont
}
-- setting colors for tabs layout and tabs sublayout.
myTabTheme = def { fontName = myFont
, activeColor = color15
, inactiveColor = color08
, activeBorderColor = color15
, inactiveBorderColor = colorBack
, activeTextColor = colorBack
, inactiveTextColor = color16
}
myAppGrid = [ --("Audacity", "audacity")
--, ("Deadbeef", "deadbeef")
("Vivaldi", "vivaldi-stable")
, ("Emacs", "emacsclient -c -a emacs")
, ("Firefox", "firefox")
, ("Vivaldi", "vivaldi-stable")
--, ("Geany", "geany")
--, ("Geary", "geary")
, ("Gimp", "gimp")
, ("Kdenlive", "kdenlive")
, ("LibreOffice Impress", "loimpress")
, ("LibreOffice Writer", "lowriter")
--, ("OBS", "obs")
, ("PCManFM", "pcmanfm")
]
myScratchPads :: [NamedScratchpad]
myScratchPads = [ NS "terminal" spawnTerm findTerm manageTerm
, NS "mocp" spawnMocp findMocp manageMocp
, NS "calculator" spawnCalc findCalc manageCalc
]
where
spawnTerm = myTerminal ++ " -t scratchpad"
findTerm = title =? "scratchpad"
manageTerm = customFloating $ W.RationalRect l t w h
where
h = 0.9
w = 0.9
t = 0.95 -h
l = 0.95 -w
spawnMocp = myTerminal ++ " -t mocp -e mocp"
findMocp = title =? "mocp"
manageMocp = customFloating $ W.RationalRect l t w h
where
h = 0.9
w = 0.9
t = 0.95 -h
l = 0.95 -w
spawnCalc = "qalculate-gtk"
findCalc = className =? "Qalculate-gtk"
manageCalc = customFloating $ W.RationalRect l t w h
where
h = 0.5
w = 0.4
t = 0.75 -h
l = 0.70 -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
-- Defining a bunch of layouts, many that I don't use.
-- limitWindows n sets maximum number of windows displayed for layout.
-- mySpacing n sets the gap size around the windows.
tall = renamed [Replace "tall"]
$ smartBorders
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ limitWindows 12
$ mySpacing 8
$ ResizableTall 1 (3/100) (1/2) []
magnify = renamed [Replace "magnify"]
$ smartBorders
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ magnifier
$ limitWindows 12
$ mySpacing 8
$ ResizableTall 1 (3/100) (1/2) []
monocle = renamed [Replace "monocle"]
$ smartBorders
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ limitWindows 20 Full
floats = renamed [Replace "floats"]
$ smartBorders
$ limitWindows 20 simplestFloat
grid = renamed [Replace "grid"]
$ smartBorders
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ limitWindows 12
$ mySpacing 8
$ mkToggle (single MIRROR)
$ Grid (16/10)
spirals = renamed [Replace "spirals"]
$ smartBorders
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ mySpacing' 8
$ spiral (6/7)
threeCol = renamed [Replace "threeCol"]
$ smartBorders
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ limitWindows 7
$ ThreeCol 1 (3/100) (1/2)
threeRow = renamed [Replace "threeRow"]
$ smartBorders
$ addTabs shrinkText myTabTheme
$ subLayout [] (smartBorders Simplest)
$ limitWindows 7
-- Mirror takes a layout and rotates it by 90 degrees.
-- So we are applying Mirror to the ThreeCol layout.
$ Mirror
$ ThreeCol 1 (3/100) (1/2)
tabs = renamed [Replace "tabs"]
-- I cannot add spacing to this layout because it will
-- add spacing between window and tabs which looks bad.
$ tabbed shrinkText myTabTheme
tallAccordion = renamed [Replace "tallAccordion"]
$ Accordion
wideAccordion = renamed [Replace "wideAccordion"]
$ Mirror Accordion
-- setting colors for tabs layout and tabs sublayout.
myTabTheme = def { fontName = myFont
, activeColor = "#46d9ff"
, inactiveColor = "#313846"
, activeBorderColor = "#46d9ff"
, inactiveBorderColor = "#282c34"
, activeTextColor = "#282c34"
, inactiveTextColor = "#d0d0d0"
}
-- Theme for showWName which prints current workspace when you change workspaces.
myShowWNameTheme :: SWNConfig
myShowWNameTheme = def
{ swn_font = "xft:Ubuntu:bold:size=60"
, swn_fade = 1.0
, swn_bgcolor = "#1c1f24"
, swn_color = "#ffffff"
}
-- The layout hook
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats
$ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout
where
myDefaultLayout = withBorder myBorderWidth tall
||| magnify
||| noBorders monocle
||| floats
||| noBorders tabs
||| grid
||| spirals
||| threeCol
||| threeRow
||| tallAccordion
||| wideAccordion
-- Theme for showWName which prints current workspace when you change workspaces.
myShowWNameTheme :: SWNConfig
myShowWNameTheme = def
{ swn_font = "xft:Ubuntu:bold:size=60"
, swn_fade = 1.0
, swn_bgcolor = "#1c1f24"
, swn_color = "#ffffff"
}
-- The layout hook
myLayoutHook = avoidStruts
$ mouseResize
$ windowArrange
$ T.toggleLayouts floats
$ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout
where
myDefaultLayout = withBorder myBorderWidth tall
||| noBorders monocle
||| floats
||| noBorders tabs
||| grid
||| spirals
||| threeCol
||| threeRow
||| tallAccordion
||| wideAccordion
#+end_src
** Workspace
#+begin_src haskell :tangle ./xmonad.hs
myWorkspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 "]
-- myWorkspaces = [" dev ", " www ", " sys ", " doc ", " vbox ", " chat ", " mus ", " vid ", " gfx "]
myWorkspaceIndices = M.fromList $ zipWith (,) myWorkspaces [1..] -- (,) == \x y -> (x,y)
myWorkspaces = [" 1 ", " 2 ", " 3 ", " 4 ", " 5 ", " 6 ", " 7 ", " 8 ", " 9 "]
-- myWorkspaces = [" dev ", " www ", " sys ", " doc ", " vbox ", " chat ", " mus ", " vid ", " gfx "]
myWorkspaceIndices = M.fromList $ zipWith (,) myWorkspaces [1..] -- (,) == \x y -> (x,y)
clickable ws = "<action=xdotool key super+"++show i++">"++ws++"</action>"
where i = fromJust $ M.lookup ws myWorkspaceIndices
clickable ws = "<action=xdotool key super+"++show i++">"++ws++"</action>"
where i = fromJust $ M.lookup ws myWorkspaceIndices
myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet)
myManageHook = composeAll
-- 'doFloat' forces a window to float. Useful for dialog boxes and such.
-- using 'doShift ( myWorkspaces !! 7)' sends program to workspace 8!
-- I'm doing it this way because otherwise I would have to write out the full
-- name of my workspaces and the names would be very long if using clickable workspaces.
[ className =? "confirm" --> doFloat
, className =? "file_progress" --> doFloat
, className =? "dialog" --> doFloat
, className =? "download" --> doFloat
, className =? "error" --> doFloat
, className =? "Gimp" --> doFloat
, className =? "notification" --> doFloat
, className =? "pinentry-gtk-2" --> doFloat
, className =? "splash" --> doFloat
, className =? "toolbar" --> doFloat
--, title =? "Oracle VM VirtualBox Manager" --> doFloat
--, title =? "Mozilla Firefox" --> doShift ( myWorkspaces !! 1 )
--, className =? "brave-browser" --> doShift ( myWorkspaces !! 1 )
--, className =? "qutebrowser" --> doShift ( myWorkspaces !! 1 )
--, className =? "mpv" --> doShift ( myWorkspaces !! 7 )
--, className =? "Gimp" --> doShift ( myWorkspaces !! 8 )
--, className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 )
, (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog
, (className =? "steam" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog
] <+> namedScratchpadManageHook myScratchPads
myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet)
myManageHook = composeAll
-- 'doFloat' forces a window to float. Useful for dialog boxes and such.
-- using 'doShift ( myWorkspaces !! 7)' sends program to workspace 8!
-- I'm doing it this way because otherwise I would have to write out the full
-- name of my workspaces and the names would be very long if using clickable workspaces.
[ className =? "confirm" --> doFloat
, className =? "file_progress" --> doFloat
, className =? "dialog" --> doFloat
, className =? "download" --> doFloat
, className =? "error" --> doFloat
, className =? "Gimp" --> doFloat
, className =? "notification" --> doFloat
, className =? "pinentry-gtk-2" --> doFloat
, className =? "splash" --> doFloat
, className =? "toolbar" --> doFloat
--, title =? "Oracle VM VirtualBox Manager" --> doFloat
--, title =? "Mozilla Firefox" --> doShift ( myWorkspaces !! 1 )
--, className =? "brave-browser" --> doShift ( myWorkspaces !! 1 )
--, className =? "qutebrowser" --> doShift ( myWorkspaces !! 1 )
--, className =? "mpv" --> doShift ( myWorkspaces !! 7 )
--, className =? "Gimp" --> doShift ( myWorkspaces !! 8 )
--, className =? "VirtualBox Manager" --> doShift ( myWorkspaces !! 4 )
, (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog
, (className =? "steam" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog
]
#+end_src
** Key bindings
#+begin_src haskell :tangle ./xmonad.hs
myKeys :: [(String, X ())]
myKeys =
-- Xmonad
[ ("M-C-r", spawn "xmonad --recompile") -- Recompiles xmonad
, ("M-S-r", spawn "xmonad --restart") -- Restarts xmonad
, ("M-S-q", io exitSuccess) -- Quits xmonad
myKeys :: [(String, X ())]
myKeys =
-- Xmonad
[ ("M-C-r", spawn "xmonad --recompile") -- Recompiles xmonad
, ("M-S-r", spawn "xmonad --restart") -- Restarts xmonad
, ("M-S-q", io exitSuccess) -- Quits xmonad
-- Run Prompt
-- M-p was the default keybinding. I've changed it to M-S-RET because I will use
-- M-p as part of the keychord for the other dmenu script bindings.
, ("M-S-<Return>", spawn "dmenu_run -i -p \"Run: \"") -- Dmenu
-- Run Prompt
-- M-p was the default keybinding. I've changed it to M-S-RET because I will use
-- M-p as part of the keychord for the other dmenu script bindings.
, ("M-S-<Return>", spawn "dmenu_run -i -p \"Run: \"") -- Dmenu
-- Launch Apps
, ("M-f", spawn "firefox")
, ("M-v", spawn "vivaldi-stable")
, ("M-t", spawn "thunar")
, ("M-p", spawn "bitwarden-desktop")
--, ("M-e", spawn "emacs")
, ("M-e", spawn myEmacs)
, ("M-l", spawn "arcolinux-logout")
-- Launch Apps
, ("M-f", spawn "firefox")
, ("M-v", spawn "vivaldi-stable")
, ("M-t", spawn "thunar")
, ("M-p", spawn "bitwarden-desktop")
--, ("M-e", spawn "emacs")
, ("M-e", spawn myEmacs)
, ("M-l", spawn "arcolinux-logout")
-- Useful programs to have a keybinding for launch
, ("M-<Return>", spawn (myTerminal))
--, ("M-b", spawn (myBrowser ++ " www.youtube.com/c/DistroTube/"))
--, ("M-M1-h", spawn (myTerminal ++ " -e htop"))
-- Useful programs to have a keybinding for launch
, ("M-<Return>", spawn (myTerminal))
--, ("M-b", spawn (myBrowser ++ " www.youtube.com/c/DistroTube/"))
--, ("M-M1-h", spawn (myTerminal ++ " -e htop"))
-- Kill windows
, ("M-S-c", kill1) -- Kill the currently focused client
--, ("M-S-a", killAll) -- Kill all windows on current workspace
-- Kill windows
, ("M-S-c", kill1) -- Kill the currently focused client
--, ("M-S-a", killAll) -- Kill all windows on current workspace
-- Workspaces
--, ("M-.", nextScreen) -- Switch focus to next monitor
--, ("M-,", prevScreen) -- Switch focus to prev monitor
--, ("M-S-<KP_Add>", shiftTo Next nonNSP >> moveTo Next nonNSP) -- Shifts focused window to next ws
--, ("M-S-<KP_Subtract>", shiftTo Prev nonNSP >> moveTo Prev nonNSP) -- Shifts focused window to prev ws
-- Workspaces
--, ("M-.", nextScreen) -- Switch focus to next monitor
--, ("M-,", prevScreen) -- Switch focus to prev monitor
--, ("M-S-<KP_Add>", shiftTo Next nonNSP >> moveTo Next nonNSP) -- Shifts focused window to next ws
--, ("M-S-<KP_Subtract>", shiftTo Prev nonNSP >> moveTo Prev nonNSP) -- Shifts focused window to prev ws
-- Floating windows
--, ("M-f", sendMessage (T.Toggle "floats")) -- Toggles my 'floats' layout
--, ("M-t", withFocused $ windows . W.sink) -- Push floating window back to tile
--, ("M-S-t", sinkAll) -- Push ALL floating windows to tile
-- Floating windows
--, ("M-f", sendMessage (T.Toggle "floats")) -- Toggles my 'floats' layout
--, ("M-t", withFocused $ windows . W.sink) -- Push floating window back to tile
--, ("M-S-t", sinkAll) -- Push ALL floating windows to tile
-- Increase/decrease spacing (gaps)
--, ("M-d", decWindowSpacing 4) -- Decrease window spacing
--, ("M-i", incWindowSpacing 4) -- Increase window spacing
--, ("M-S-d", decScreenSpacing 4) -- Decrease screen spacing
--, ("M-S-i", incScreenSpacing 4) -- Increase screen spacing
-- Increase/decrease spacing (gaps)
--, ("M-d", decWindowSpacing 4) -- Decrease window spacing
--, ("M-i", incWindowSpacing 4) -- Increase window spacing
--, ("M-S-d", decScreenSpacing 4) -- Decrease screen spacing
--, ("M-S-i", incScreenSpacing 4) -- Increase screen spacing
-- Grid Select (CTR-g followed by a key)
, ("M-g g", spawnSelected' myAppGrid) -- grid select favorite apps
, ("M-g t", goToSelected $ mygridConfig myColorizer) -- goto selected window
--, ("C-g b", bringSelected $ mygridConfig myColorizer) -- bring selected window
-- Grid Select (CTR-g followed by a key)
--, ("M-g g", spawnSelected' myAppGrid) -- grid select favorite apps
--, ("M-g t", goToSelected $ mygridConfig myColorizer) -- goto selected window
--, ("C-g b", bringSelected $ mygridConfig myColorizer) -- bring selected window
-- Windows navigation
--, ("M-m", windows W.focusMaster) -- Move focus to the master window
, ("M-j", windows W.focusDown) -- Move focus to the next window
, ("M-k", windows W.focusUp) -- Move focus to the prev window
--, ("M-S-m", windows W.swapMaster) -- Swap the focused window and the master window
--, ("M-S-j", windows W.swapDown) -- Swap focused window with next window
--, ("M-S-k", windows W.swapUp) -- Swap focused window with prev window
--, ("M-<Backspace>", promote) -- Moves focused window to master, others maintain order
--, ("M-S-<Tab>", rotSlavesDown) -- Rotate all windows except master and keep focus in place
, ("M-C-<Tab>", rotAllDown) -- Rotate all the windows in the current stack
-- Windows navigation
--, ("M-m", windows W.focusMaster) -- Move focus to the master window
, ("M-j", windows W.focusDown) -- Move focus to the next window
, ("M-k", windows W.focusUp) -- Move focus to the prev window
--, ("M-S-m", windows W.swapMaster) -- Swap the focused window and the master window
--, ("M-S-j", windows W.swapDown) -- Swap focused window with next window
--, ("M-S-k", windows W.swapUp) -- Swap focused window with prev window
--, ("M-<Backspace>", promote) -- Moves focused window to master, others maintain order
--, ("M-S-<Tab>", rotSlavesDown) -- Rotate all windows except master and keep focus in place
, ("M-C-<Tab>", rotAllDown) -- Rotate all the windows in the current stack
-- Layouts
--, ("M-<Tab>", sendMessage NextLayout) -- Switch to next layout
--, ("M-C-M1-<Up>", sendMessage Arrange)
--, ("M-C-M1-<Down>", sendMessage DeArrange)
--, ("M-S-<Space>", sendMessage ToggleStruts) -- Toggles struts
--, ("M-S-n", sendMessage $ MT.Toggle NOBORDERS) -- Toggles noborder
, ("M-<Space>", sendMessage (MT.Toggle NBFULL) >> sendMessage ToggleStruts) -- Toggles noborder/full
-- Layouts
--, ("M-<Tab>", sendMessage NextLayout) -- Switch to next layout
--, ("M-C-M1-<Up>", sendMessage Arrange)
--, ("M-C-M1-<Down>", sendMessage DeArrange)
--, ("M-S-<Space>", sendMessage ToggleStruts) -- Toggles struts
--, ("M-S-n", sendMessage $ MT.Toggle NOBORDERS) -- Toggles noborder
, ("M-<Space>", sendMessage (MT.Toggle NBFULL) >> sendMessage ToggleStruts) -- Toggles noborder/full
-- Increase/decrease windows in the master pane or the stack
--, ("M-S-<Up>", sendMessage (IncMasterN 1)) -- Increase # of clients master pane
--, ("M-S-<Down>", sendMessage (IncMasterN (-1))) -- Decrease # of clients master pane
--, ("M-C-<Up>", increaseLimit) -- Increase # of windows
--, ("M-C-<Down>", decreaseLimit) -- Decrease # of windows
-- Increase/decrease windows in the master pane or the stack
--, ("M-S-<Up>", sendMessage (IncMasterN 1)) -- Increase # of clients master pane
--, ("M-S-<Down>", sendMessage (IncMasterN (-1))) -- Decrease # of clients master pane
--, ("M-C-<Up>", increaseLimit) -- Increase # of windows
--, ("M-C-<Down>", decreaseLimit) -- Decrease # of windows
-- Window resizing
--, ("M-h", sendMessage Shrink) -- Shrink horiz window width
--, ("M-l", sendMessage Expand) -- Expand horiz window width
--, ("M-M1-j", sendMessage MirrorShrink) -- Shrink vert window width
--, ("M-M1-k", sendMessage MirrorExpand) -- Expand vert window width
-- Window resizing
--, ("M-h", sendMessage Shrink) -- Shrink horiz window width
--, ("M-l", sendMessage Expand) -- Expand horiz window width
--, ("M-M1-j", sendMessage MirrorShrink) -- Shrink vert window width
--, ("M-M1-k", sendMessage MirrorExpand) -- Expand vert window width
-- Systemwise
, ("C-S-<Esc>", spawn $ "xfce4-taskmanager")
-- Sublayouts
-- This is used to push windows to tabbed sublayouts, or pull them out of it.
--, ("M-C-h", sendMessage $ pullGroup L)
--, ("M-C-l", sendMessage $ pullGroup R)
--, ("M-C-k", sendMessage $ pullGroup U)
--, ("M-C-j", sendMessage $ pullGroup D)
--, ("M-C-m", withFocused (sendMessage . MergeAll))
---- , ("M-C-u", withFocused (sendMessage . UnMerge))
--, ("M-C-/", withFocused (sendMessage . UnMergeAll))
--, ("M-C-.", onGroup W.focusUp') -- Switch focus to next tab
--, ("M-C-,", onGroup W.focusDown') -- Switch focus to prev tab
-- Systemwise
, ("C-S-<Esc>", spawn $ "xfce4-taskmanager")
-- Sublayouts
-- This is used to push windows to tabbed sublayouts, or pull them out of it.
--, ("M-C-h", sendMessage $ pullGroup L)
--, ("M-C-l", sendMessage $ pullGroup R)
--, ("M-C-k", sendMessage $ pullGroup U)
--, ("M-C-j", sendMessage $ pullGroup D)
--, ("M-C-m", withFocused (sendMessage . MergeAll))
---- , ("M-C-u", withFocused (sendMessage . UnMerge))
--, ("M-C-/", withFocused (sendMessage . UnMergeAll))
--, ("M-C-.", onGroup W.focusUp') -- Switch focus to next tab
--, ("M-C-,", onGroup W.focusDown') -- Switch focus to prev tab
-- Scratchpads
-- Toggle show/hide these programs. They run on a hidden workspace.
-- When you toggle them to show, it brings them to your current workspace.
-- Toggle them to hide and it sends them back to hidden workspace (NSP).
--, ("C-s t", namedScratchpadAction myScratchPads "terminal")
--, ("C-s m", namedScratchpadAction myScratchPads "mocp")
--, ("C-s c", namedScratchpadAction myScratchPads "calculator")
-- Scratchpads
-- Toggle show/hide these programs. They run on a hidden workspace.
-- When you toggle them to show, it brings them to your current workspace.
-- Toggle them to hide and it sends them back to hidden workspace (NSP).
--, ("C-s t", namedScratchpadAction myScratchPads "terminal")
--, ("C-s m", namedScratchpadAction myScratchPads "mocp")
--, ("C-s c", namedScratchpadAction myScratchPads "calculator")
-- Set wallpaper with 'feh'. Type 'SUPER+F1' to launch sxiv in the wallpapers directory.
-- Then in sxiv, type 'C-x w' to set the wallpaper that you choose.
--, ("M-<F1>", spawn "sxiv -r -q -t -o ~/wallpapers/*")
--, ("M-<F2>", spawn "/bin/ls ~/wallpapers | shuf -n 1 | xargs xwallpaper --stretch")
--, ("M-<F2>", spawn "feh --randomize --bg-fill ~/wallpapers/*")
-- Set wallpaper with 'feh'. Type 'SUPER+F1' to launch sxiv in the wallpapers directory.
-- Then in sxiv, type 'C-x w' to set the wallpaper that you choose.
--, ("M-<F1>", spawn "sxiv -r -q -t -o ~/wallpapers/*")
--, ("M-<F2>", spawn "/bin/ls ~/wallpapers | shuf -n 1 | xargs xwallpaper --stretch")
--, ("M-<F2>", spawn "feh --randomize --bg-fill ~/wallpapers/*")
-- Multimedia Keys
--, ("<XF86AudioPlay>", spawn (myTerminal ++ "mocp --play"))
--, ("<XF86AudioPrev>", spawn (myTerminal ++ "mocp --previous"))
--, ("<XF86AudioNext>", spawn (myTerminal ++ "mocp --next"))
--, ("<XF86AudioMute>", spawn "amixer set Master toggle")
--, ("<XF86AudioLowerVolume>", spawn "amixer set Master 5%- unmute")
--, ("<XF86AudioRaiseVolume>", spawn "amixer set Master 5%+ unmute")
--, ("<XF86HomePage>", spawn "firefox")
--, ("<XF86Search>", safeSpawn "firefox" ["https://www.duckduckgo.com/"])
--, ("<XF86Mail>", runOrRaise "thunderbird" (resource =? "thunderbird"))
--, ("<XF86Calculator>", runOrRaise "qalculate-gtk" (resource =? "qalculate-gtk"))
--, ("<XF86Eject>", spawn "toggleeject")
--, ("<Print>", spawn "scrotd 0")
]
-- The following lines are needed for named scratchpads.
where nonNSP = WSIs (return (\ws -> W.tag ws /= "NSP"))
nonEmptyNonNSP = WSIs (return (\ws -> isJust (W.stack ws) && W.tag ws /= "NSP"))
-- Multimedia Keys
--, ("<XF86AudioPlay>", spawn (myTerminal ++ "mocp --play"))
--, ("<XF86AudioPrev>", spawn (myTerminal ++ "mocp --previous"))
--, ("<XF86AudioNext>", spawn (myTerminal ++ "mocp --next"))
--, ("<XF86AudioMute>", spawn "amixer set Master toggle")
--, ("<XF86AudioLowerVolume>", spawn "amixer set Master 5%- unmute")
--, ("<XF86AudioRaiseVolume>", spawn "amixer set Master 5%+ unmute")
--, ("<XF86HomePage>", spawn "firefox")
--, ("<XF86Search>", safeSpawn "firefox" ["https://www.duckduckgo.com/"])
--, ("<XF86Mail>", runOrRaise "thunderbird" (resource =? "thunderbird"))
--, ("<XF86Calculator>", runOrRaise "qalculate-gtk" (resource =? "qalculate-gtk"))
--, ("<XF86Eject>", spawn "toggleeject")
--, ("<Print>", spawn "scrotd 0")
]
-- The following lines are needed for named scratchpads.
where nonNSP = WSIs (return (\ws -> W.tag ws /= "NSP"))
nonEmptyNonNSP = WSIs (return (\ws -> isJust (W.stack ws) && W.tag ws /= "NSP"))
#+end_src
** Main
#+begin_src haskell :tangle ./xmonad.hs
main :: IO ()
main = do
-- Launching three instances of xmobar on their monitors.
-- xmproc0 <- spawnPipe "xmobar -x 0 $HOME/.config/xmobar/xmobarrc_desktop_qhd"
-- xmproc1 <- spawnPipe "xmobar -x 1 $HOME/.config/xmobar/xmobarrc_desktop_fhd"
xmproc0 <- spawnPipe "xmobar -x 0 $HOME/.config/xmobar/xmobarrc_labtop_fhd"
-- the xmonad, ya know...what the WM is named after!
xmonad $ ewmh def
{ manageHook = ( isFullscreen --> doFullFloat ) <+> myManageHook <+> manageDocks
-- Run xmonad commands from command line with "xmonadctl command". Commands include:
-- shrink, expand, next-layout, default-layout, restart-wm, xterm, kill, refresh, run,
-- focus-up, focus-down, swap-up, swap-down, swap-master, sink, quit-wm. You can run
-- "xmonadctl 0" to generate full list of commands written to ~/.xsession-errors.
-- To compile xmonadctl: ghc -dynamic xmonadctl.hs
, handleEventHook = serverModeEventHookCmd
<+> serverModeEventHook
<+> serverModeEventHookF "XMONAD_PRINT" (io . putStrLn)
<+> docksEventHook
<+> fullscreenEventHook -- this does NOT work right if using multi-monitors!
, modMask = myModMask
, terminal = myTerminal
, startupHook = myStartupHook
, layoutHook = showWName' myShowWNameTheme $ myLayoutHook
, workspaces = myWorkspaces
, borderWidth = myBorderWidth
, normalBorderColor = myNormColor
, focusedBorderColor = myFocusColor
, logHook = dynamicLogWithPP $ namedScratchpadFilterOutWorkspacePP $ xmobarPP
-- the following variables beginning with 'pp' are settings for xmobar.
{ ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1
-- >> hPutStrLn xmproc1 x -- xmobar on monitor 2
-- >> hPutStrLn xmproc2 x -- xmobar on monitor 3
, ppCurrent = xmobarColor "#FFFFFF" "" . wrap "●" "" -- Current workspace
, ppVisible = xmobarColor "#c0a79a" "" . wrap "♼" "" . clickable -- Visible but not current workspace
, ppHidden = xmobarColor "#c0a79a" "" . wrap "○" "" . clickable -- Hidden workspaces
, ppHiddenNoWindows = xmobarColor "#c792ea" "" . \s -> "" -- Hidden workspaces (no windows)
, ppTitle = xmobarColor "#b3afc2" "" . shorten 60 -- Title of active window
, ppSep = "<fc=#666666> <fn=1>|</fn> </fc>" -- Separator character
, ppUrgent = xmobarColor "#C45500" "" . wrap "!" "!" -- Urgent workspace
, ppExtras = [windowCount] -- # of windows current workspace
, ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t] -- order of things in xmobar
}
} `additionalKeysP` myKeys
main :: IO ()
main = do
-- Launching three instances of xmobar on their monitors.
-- xmproc0 <- spawnPipe "xmobar -x 0 $HOME/.config/xmobar/xmobarrc_desktop_qhd"
-- xmproc1 <- spawnPipe "xmobar -x 1 $HOME/.config/xmobar/xmobarrc_desktop_fhd"
xmproc0 <- spawnPipe "xmobar -x 0 $HOME/.config/xmobar/xmobarrc_labtop_fhd"
-- the xmonad, ya know...what the WM is named after!
xmonad $ ewmh def
{ manageHook = ( isFullscreen --> doFullFloat ) <+> myManageHook <+> manageDocks
-- Run xmonad commands from command line with "xmonadctl command". Commands include:
-- shrink, expand, next-layout, default-layout, restart-wm, xterm, kill, refresh, run,
-- focus-up, focus-down, swap-up, swap-down, swap-master, sink, quit-wm. You can run
-- "xmonadctl 0" to generate full list of commands written to ~/.xsession-errors.
-- To compile xmonadctl: ghc -dynamic xmonadctl.hs
, handleEventHook = serverModeEventHookCmd
<+> serverModeEventHook
<+> serverModeEventHookF "XMONAD_PRINT" (io . putStrLn)
-- <+> fullscreenEventHook -- this does NOT work right if using multi-monitors!
, modMask = myModMask
, terminal = myTerminal
, startupHook = myStartupHook
, layoutHook = showWName' myShowWNameTheme $ myLayoutHook
, workspaces = myWorkspaces
, borderWidth = myBorderWidth
, normalBorderColor = myNormColor
, focusedBorderColor = myFocusColor
, logHook = dynamicLogWithPP $ xmobarPP
-- the following variables beginning with 'pp' are settings for xmobar.
{ ppOutput = \x -> hPutStrLn xmproc0 x -- xmobar on monitor 1
-- >> hPutStrLn xmproc1 x -- xmobar on monitor 2
-- >> hPutStrLn xmproc2 x -- xmobar on monitor 3
, ppCurrent = xmobarColor "#FFFFFF" "" . wrap "●" "" -- Current workspace
, ppVisible = xmobarColor "#c0a79a" "" . wrap "♼" "" . clickable -- Visible but not current workspace
, ppHidden = xmobarColor "#c0a79a" "" . wrap "○" "" . clickable -- Hidden workspaces
, ppHiddenNoWindows = xmobarColor "#c792ea" "" . \s -> "" -- Hidden workspaces (no windows)
, ppTitle = xmobarColor "#b3afc2" "" . shorten 60 -- Title of active window
, ppSep = "<fc=#666666> <fn=1>|</fn> </fc>" -- Separator character
, ppUrgent = xmobarColor "#C45500" "" . wrap "!" "!" -- Urgent workspace
, ppExtras = [windowCount] -- # of windows current workspace
, ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t] -- order of things in xmobar
}
} `additionalKeysP` myKeys
#+end_src