home:natto:xmonad: fix fullscreen

This commit is contained in:
2021-06-16 09:29:52 +05:30
parent ba8dbff511
commit d32d386248
13 changed files with 214 additions and 37 deletions

View File

@@ -2,16 +2,18 @@
echo "You're about to switch your home-manager configuration as '$USER'"
read -p "Continue (y/n)?" conf
read -p "Do you want to use doas instead of sudo? (y/n)" conf2
elev="sudo"
if [ ${conf2,,} == "y" ]; then
elev="doas"
fi
if [ ${conf,,} == "n" ]; then
echo "If this is not you, then log into your profile first!"
exit 1
else
read -p "Do you want to use sudo instead of doas? (y/n)" conf2
elev="doas"
if [ ${conf2,,} == "y" ]; then
elev="sudo"
fi
$elev nix build .\#hm-configs.$USER.activationPackage -o hm-result
./hm-result/activate
$elev unlink hm-result

66
home/config/dunst/dunstrc Normal file
View File

@@ -0,0 +1,66 @@
[global]
monitor = 0
follow = mouse
geometry = "250x20-50+20"
# Turn on the progess bar
progress_bar = true
progress_bar_height = 3
progress_bar_frame_width = 1
progress_bar_min_width = 125
progress_bar_max_width = 250
indicate_hidden = yes
shrink = no
transparency = 0.8
separator_height = 2
padding = 5
text_icon_padding = 4
frame_width = 3
frame_color = "#ebdbb2"
separator_color = frame
sort = yes
idle_threshold = 120
font = Fira Mono 10
markup = full
format = "<b>%a<b> - %s\n%b"
alignment = left
vertical_alignment = center
show_age_threshold = 60
word_wrap = yes
ellipsize = middle
ignore_newline = no
stack_duplicates = true
hide_duplicate_count = false
show_indicators = yes
icon_position = left
min_icon_size = 0
max_icon_size = 32
icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
sticky_history = yes
history_length = 20
dmenu = /usr/bin/dmenu -p dunst:
browser = /usr/bin/firefox -new-tab
always_run_script = true
title = Dunst
class = Dunst
startup_notification = false
verbosity = mesg
corner_radius = 1
ignore_dbusclose = false
[urgency_low]
background = "#222222"
foreground = "#888888"
timeout = 10
[urgency_normal]
background = "#285577"
foreground = "#ffffff"
timeout = 10
[urgency_critical]
background = "#900000"
foreground = "#ffffff"
frame_color = "#ff0000"
timeout = 10

View File

@@ -0,0 +1,61 @@
/* XPM */
static char *bigger[] = {
/* columns rows colors chars-per-pixel */
"25 22 33 1 ",
" c None",
". c #5277C3",
"X c #5278C3",
"o c #5378C3",
"O c #557BC5",
"+ c #557CC6",
"@ c #567CC6",
"# c #567DC6",
"$ c #577EC6",
"% c #577EC7",
"& c #5880C7",
"* c #5981C8",
"= c #5C87CB",
"- c #5F8BCC",
"; c #608CCE",
": c #618DCE",
"> c #6594D1",
", c #6A9BD5",
"< c #6C9DD6",
"1 c #6C9ED6",
"2 c #6C9FD6",
"3 c #6DA0D7",
"4 c #71A6DA",
"5 c #76ADDE",
"6 c #76AEDE",
"7 c #79B2E0",
"8 c #79B3E0",
"9 c #7AB4E1",
"0 c #7BB4E1",
"q c #7CB7E2",
"w c #7CB7E3",
"e c #7DB8E3",
"r c #7EBAE4",
/* pixels */
" .. rr r ",
" .. rr rr ",
" ... rrrrr ",
" ... rrrrr ",
" ........O2err ",
" ..........=6rr . ",
" rrr .. ",
" rr rrr ... ",
" rrr rq>X. ",
" rrr r4$X... ",
"rrrrrrrr :X..... ",
"rrrrrr7< ....... ",
" rre3$ ... ",
" rr9-o. .X ",
" rr $.. *$O ",
" rr ...2rrrr667rrrr ",
" r ..:7rrrrrrrrr ",
" ...$,rrrrrrrrr ",
" ..... rrr ",
" ... .. rr ",
" .. ... rr ",
" "
};

View File

@@ -1,7 +1,9 @@
Config {
position = Static { xpos = 0 , ypos = 0, width = 1805, height = 23 },
font = "xft:Fira Mono:style=Regular:antialias=true:pixelsize=16"
additionalFonts = [ "xft:Font Awesome 5 Free Solid:pixelsize=15", "xft:Font Awesome 5 Brands:pixelsize=15" ]
font = "xft:Fira Mono:style=Regular:antialias=true:pixelsize=16,Font Awesome 5 Brands:pixelsize=16,Font Awesome 5 Free:pixelsize=16:style=Solid,Lohit Devanagari:style=Regular:pixelsize=16,Lohit Gurmukhi:style=Regular:pixelsize=16,Noto Sans CJK JP:style=Regular:pixelsize=16,Noto Sans CJK KR:style=Regular:pixelsize=16,Noto Sans CJK SC:style=Regular:pixelsize=16"
additionalFonts = [ "xft:Font Awesome 5 Free:pixelsize=15:style=Solid",
"xft:Font Awesome 5 Brands:pixelsize=15"
]
bgColor = "#1d2021",
fgColor = "#d5c4a1",
lowerOnStart = False,
@@ -9,16 +11,17 @@ Config {
allDesktops = True,
persistent = True,
commands = [
Run MultiCpu ["-t","<fn=1>\xf2db</fn> <total>","-L","20","-H","80","-h","#D3869B","-l","#8EC07C","-n","#EBDBB2"] 10,
Run Memory ["-t","<fn=1>\xf538</fn> <usedratio>","-H","12288","-L","6144","-h","#D3869B","-l","#8EC07C","-n","#EBDBB2"] 10,
Run MultiCpu ["-t","<fn=1>\xf2db</fn> <total>%","-L","20","-H","80","-h","#D3869B","-l","#8EC07C","-n","#EBDBB2"] 10,
Run Memory ["-t","<fn=1>\xf538</fn> <usedratio>%","-H","12288","-L","6144","-h","#D3869B","-l","#8EC07C","-n","#EBDBB2"] 20,
Run BatteryP ["BAT1","BAT0","BAT2"] ["-t", "<acstatus>", "-L", "10", "-H", "80", "-l", "#D3869B", "-h", "#8EC07C", "-n", "#EBDBB2", "--", "-O", "Charging", "-o", "<left>%", "-a", "notify-send -u critical 'Battery running out!'", "-A", "5", "--lows", "<fn=1>\xf243</fn> ", "--mediums", "<fn=1>\xf242</fn> ", "--highs", "<fn=1>\xf240</fn> "] 300,
Run Network "wlp0s20f3" ["-t","<fn=1>\xf1eb</fn> <fc=#fabd2f><rx>/<tx></fc>"] 10,
Run Date "<fn=1>\xf073</fn> %b, %_d ║%l:%M:%S " "date" 10,
Run MPD ["-t", "<fn=1>\xf001</fn> <state>: <title>", "--", "-P", ">>", "-Z", "|", "-S", "><", "-h", "127.0.0.1", "-p", "6600"] 10,
Run Com "pamixer" ["--get-volume"] "" 10,
Run Date "<fn=1>\xf073 </fn>%a - %b, %_d ║%l:%M:%S " "date" 100,
Run MPD ["-t", "<fn=1>\xf001</fn> <statei><title>", "--", "-P", ">>: ", "-Z", "||: ", "-S", "Stopped", "-h", "127.0.0.1", "-p", "6600"] 10,
Run Com "pamixer" ["--get-volume"] "" 600,
Run UnsafeStdinReader
],
sepChar = "*",
alignSep = "--",
template = "*UnsafeStdinReader* ║ *mpd* -- *multicpu*% ║ *memory*% ║ *wlp0s20f3* ║ <fn=1></fn> <fc=#83a598>*pamixer*%</fc> ║ <fc=#ebdbb2>*date*</fc>"
template = "<action=`dmenu_run` button=1><icon=/home/natto/.xmonad/lib/nixos.xpm/></action> *UnsafeStdinReader* ║ *mpd* -- *multicpu* ║ *memory* ║ *wlp0s20f3* ║ *battery* ║ <fn=1></fn> <fc=#83a598>*pamixer*%</fc> ║ <fc=#ebdbb2>*date*</fc>"
}

View File

@@ -1,8 +1,7 @@
import System.IO
import System.Exit
import XMonad
import XMonad.Config.Desktop
import XMonad.Layout.Fullscreen
import XMonad.Hooks.SetWMName
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.DynamicLog
import XMonad.Layout.NoBorders
@@ -11,7 +10,6 @@ import XMonad.Layout.Spiral
import XMonad.Layout.Tabbed
import XMonad.Layout.ThreeColumns
import XMonad.Layout.ResizableTile
import XMonad.Layout.ToggleLayouts (ToggleLayout(..), toggleLayouts)
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run (spawnPipe)
import qualified XMonad.StackSet as W
@@ -24,10 +22,18 @@ myNormalBorderColor = "#1d2021"
myModMask = mod4Mask
myFocusedBorderColor = "#d5c4a1"
myManageHook = composeAll
[ className =? "mpv" --> doFloat
, className =? "Discord" --> doFloat ]
[ className =? "Discord" --> doFloat ]
myWorkspaces = clickable $ ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX" ]
tabConfig = defaultTheme {
activeTextColor = "#1d2021",
activeColor = "#d5c4a1",
inactiveTextColor = "#d5c4a1",
inactiveColor = "#1d2021"
}
myXmobarrc = "~/.xmonad/lib/xmobar.hs"
myWorkspaces = clickable $ ["\xf269", "\xf120", "\xf121", "\xf392", "\xf008", "\xf07b", "\xf11b", "\xf086", "\xf074" ]
where clickable l = ["<action=`xdotool key super+" ++ show (n) ++ "`>" ++ ws ++ "</action>" | (i,ws) <- zip [1..9] l, let n = i ]
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
@@ -74,7 +80,7 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
sendMessage NextLayout)
, ((modMask, xK_f),
sendMessage (Toggle "Full"))
toggleFullscreen)
, ((modMask .|. shiftMask, xK_space),
setLayout $ XMonad.layoutHook conf)
@@ -131,27 +137,58 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
| (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
myLayoutHook = toggleLayouts (noBorders Full) ( smartSpacing 8 $ smartBorders $ avoidStruts (
myLayoutHook = smartSpacing 8 $ smartBorders $ avoidStruts (
spiral (1/1) |||
tabbed shrinkText tabConfig |||
ThreeCol 1 (3/100) (1/2) |||
Tall 1 (3/100) (1/2) |||
Mirror (Tall 1 (3/100) (1/2)) |||
Full))
Full)
tabConfig = defaultTheme {
activeTextColor = "#1d2021",
activeColor = "#d5c4a1",
inactiveTextColor = "#d5c4a1",
inactiveColor = "#1d2021"
}
-- {{{source: https://github.com/liskin/dotfiles/commit/659af2ec68c26044f9e6ddf11655856613285685#diff-f3bd9f70ef878f30362ff11bbea7fd1d0d6abde1b4befa44b18cce5a27456204R190
toggleFullscreen =
withWindowSet $ \ws ->
withFocused $ \w -> do
let fullRect = W.RationalRect 0 0 1 1
let isFullFloat = w `M.lookup` W.floating ws == Just fullRect
windows $ if isFullFloat then W.sink w else W.float w fullRect
--}}}
--{{{
--couldnt get fullScreenEventHook to work normally so using this for now
--source code: https://github.com/xmonad/xmonad-contrib/blob/v0.16/XMonad/Hooks/EwmhDesktops.hs
myXmobarrc = "~/.xmonad/lib/xmobar.hs"
fullscreenFix :: XConfig a -> XConfig a
fullscreenFix c = c {
startupHook = startupHook c +++ setSupportedWithFullscreen
}
where x +++ y = mappend x y
setSupportedWithFullscreen :: X ()
setSupportedWithFullscreen = withDisplay $ \dpy -> do
r <- asks theRoot
a <- getAtom "_NET_SUPPORTED"
c <- getAtom "ATOM"
supp <- mapM getAtom ["_NET_WM_STATE_HIDDEN"
,"_NET_WM_STATE_FULLSCREEN"
,"_NET_NUMBER_OF_DESKTOPS"
,"_NET_CLIENT_LIST"
,"_NET_CLIENT_LIST_STACKING"
,"_NET_CURRENT_DESKTOP"
,"_NET_DESKTOP_NAMES"
,"_NET_ACTIVE_WINDOW"
,"_NET_WM_DESKTOP"
,"_NET_WM_STRUT"
]
io $ changeProperty32 dpy r a c propModeReplace (fmap fromIntegral supp)
setWMName "xmonad"
--}}}
main = do xmproc <- spawnPipe ("xmobar " ++ myXmobarrc)
xmonad $ ewmh desktopConfig
xmonad $ docks $ fullscreenFix $ ewmh def
{ borderWidth = myBorderWidth
, manageHook = manageDocks <+> myManageHook
, handleEventHook = handleEventHook def <+> fullscreenEventHook
, terminal = myTerminal
, focusFollowsMouse = myFocusFollowsMouse
, normalBorderColor = myNormalBorderColor
@@ -162,7 +199,7 @@ main = do xmproc <- spawnPipe ("xmobar " ++ myXmobarrc)
, workspaces = myWorkspaces
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppCurrent = xmobarColor "#b8bb26" "" . wrap "[" "]"
, ppCurrent = xmobarColor "#b8bb26" "" . wrap "+" ""
, ppVisible = xmobarColor "#b8bb26" ""
, ppHidden = xmobarColor "#d3869b" ""
, ppTitle = xmobarColor "#ebdbb2" "" . shorten 60

View File

@@ -88,6 +88,10 @@ in
source = ./config/dwm/bruhstatus.sh;
target = "${home}/.dwm/bruhstatus.sh";
};
dunstrc = {
source = ./config/dunst/dunstrc;
target = "${home}/.config/dunst/dunstrc";
};
};
};
}

View File

@@ -83,6 +83,7 @@ in
sticky = true;
icon_size = 23;
background = "#1d2021";
icon_gravity = "E";
};
extraConfig = ''
kludges force_icons_size

View File

@@ -16,6 +16,7 @@
config = ../config/xmonad/xmonad.hs;
libFiles = {
"xmobar.hs" = ../config/xmonad/xmobar.hs;
"nixos.xpm" = ../config/xmonad/nixos.xpm;
};
};
};

View File

@@ -23,6 +23,8 @@
fonts.fonts = with pkgs; [
fira-mono
noto-fonts-cjk
lohit-fonts.devanagari
lohit-fonts.gurmukhi
nerdfonts
font-awesome
];

View File

@@ -5,7 +5,7 @@ final: prev: {
url = "https://dl.suckless.org/tools/dmenu-5.0.tar.gz";
sha256 = "0gjjbh49j85rpbmiqj236g4c1zb1h8xh41mcjsvnzgwn72893mk6";
};
patches = [./suckless/dmenu.patch];
patches = [./patches/dmenu.patch];
});
dwm = prev.dwm.overrideAttrs (oldAttrs: rec {
@@ -13,7 +13,7 @@ final: prev: {
url = "https://dl.suckless.org/dwm/dwm-6.2.tar.gz";
sha256 = "0qdh8amfkjpvbwffar0byybcqi5w7v1wdqb39h75521haa6mh8xg";
};
patches = [./suckless/dwm.patch];
patches = [./patches/dwm.patch];
});
st = prev.st.overrideAttrs (oldAttrs: rec {
@@ -21,7 +21,7 @@ final: prev: {
url = "https://dl.suckless.org/st/st-0.8.4.tar.gz";
sha256 = "01z6i60fmdi5h6g80rgvqr6d00jxszphrldx07w4v6nq8cq2r4nr";
};
patches = [./suckless/st.patch];
patches = [./patches/st.patch];
});
kbd = prev.kbd.overrideAttrs (oldAttrs: rec{