Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
A committed Aug 8, 2023
1 parent 425246d commit 0cc102f
Show file tree
Hide file tree
Showing 6 changed files with 628 additions and 142 deletions.
2 changes: 1 addition & 1 deletion configs/kitty/kitty.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
allow_remote_control yes

cursor_blink_interval 0
background_opacity 0.6
background_opacity 0.8
dynamic_background_opacity no


Expand Down
2 changes: 1 addition & 1 deletion configs/nvim/lua/opts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ opt.writebackup = false

vim.cmd([[iabbrev <expr> ymd% strftime("%Y%m%d")]])

vim.api.nvim_create_autocmd({ "InsertEnter" }, { command = "hi CursorLine ctermbg=8" })
vim.api.nvim_create_autocmd({ "InsertEnter" }, { command = "hi CursorLine ctermbg=16" })
vim.api.nvim_create_autocmd({ "InsertLeave" }, { command = "hi CursorLine ctermbg=none" })
6 changes: 3 additions & 3 deletions configs/xmonad/config.d/30_xbanish.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
if [ -z "$(pgrep xbanish)" ] ; then
xbanish &
fi
# if [ -z "$(pgrep xbanish)" ] ; then
# xbanish &
# fi

5 changes: 4 additions & 1 deletion configs/xmonad/xmobarrc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ Config {
, additionalFonts = [
"xft:Sans Serif-10:normal"
]
, overrideRedirect = True
, allDesktops = True
, bgColor = "#282c34"
, fgColor = "#bbc2cf"
, position = TopH 24
, lowerOnStart = True
, commands = [
-- Run Com ".xmonad/scripts/covid-vietnam" [] "covid" 3000
Run Com ".xmonad/scripts/currency" [ "BTCUSD" ] "BTCUSD" 300
Expand Down Expand Up @@ -86,5 +88,6 @@ Config {
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ %NOTE% | %MEETING% | BTC = $%BTCUSD% | USD = %USDRUB%Р | EUR = %EURRUB%Р | %VVTS% | %cpu% %cpufreq% %coretemp% | %memory% | %battery% | %dynnetwork% | %date% | %kbd% " -- #69DFFA
-- , template = "%StdinReader% }{ %NOTE% | %MEETING% | BTC = $%BTCUSD% | USD = %USDRUB%Р | EUR = %EURRUB%Р | %VVTS% | %cpu% %cpufreq% %coretemp% | %memory% | %battery% | %dynnetwork% | %date% | %kbd% " -- #69DFFA
, template = " %NOTE% | %MEETING% }{ BTC = $%BTCUSD% | USD = %USDRUB%Р | EUR = %EURRUB%Р | %VVTS% | %cpu% %cpufreq% %coretemp% | %memory% | %battery% | %dynnetwork% | %date% | %kbd% " -- #69DFFA
}
171 changes: 35 additions & 136 deletions configs/xmonad/xmonad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import System.Exit
-- import Data.Char (isSpace, toUpper)

import XMonad
import XMonad.Config.Xfce
-- import XMonad.Config.Xfce
import XMonad.Actions.Navigation2D
import XMonad.Actions.UpdatePointer
import XMonad.Actions.Submap
Expand Down Expand Up @@ -35,6 +35,8 @@ import XMonad.Layout.SubLayouts
import XMonad.Layout.WindowNavigation
import XMonad.Prompt
import XMonad.Prompt.Input
import XMonad.Config.Kde

-- import XMonad.Layout.ZoomRow

-- import Control.Arrow (first)
Expand Down Expand Up @@ -262,31 +264,20 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
-- Custom key bindings
--
-- Start a terminal. Terminal to start is specified by myTerminal variable.
[ ((modMask .|. shiftMask, xK_Return),
spawn $ XMonad.terminal conf)


-- Apps Keybindings
, ((modMask, xK_a), submap . M.fromList $
[ ((0, xK_s), spawn "slack")
, ((0, xK_t), spawn "todoist")
, ((0, xK_m), spawn "telegram-desktop")
, ((0, xK_n), spawn "obsidian")
, ((0, xK_f), spawn "firefox")
, ((0, xK_p), spawn "1password")
, ((0, xK_c), spawnHere (myTerminal ++ " -t CMUS -e cmus") )
])

-- Rofi variants
, ((modMask, xK_equal),
spawn myCalc)

, ((modMask .|. controlMask, xK_space),
spawn myTodoList
)

, ((modMask, xK_o),
spawn myFinder)
[
((modMask .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)
, ((controlMask, xK_space), inputPrompt myXPConfig " TODO" ?+ \t -> spawnHere ("/home/a8ka/.bin/add-todo " ++ t))
, ((modMask .|. controlMask, xK_space), spawn myTodoList)
, ((modMask, xK_o), spawn myFinder)
, ((modMask, xK_d), spawn myLauncher)
, ((modMask, xK_s), spawn mySearch)
, ((modMask .|. shiftMask, xK_s), spawn mySelectScreenshot)
, ((0, xF86XK_AudioMute), spawn "amixer -q set Master toggle")
, ((0, xF86XK_AudioLowerVolume), spawn "amixer -q set Master 5%-")
, ((0, xF86XK_AudioRaiseVolume), spawn "amixer -q set Master 5%+")
, ((0, 0x1008FF16), spawn "")
, ((0, 0x1008FF14), spawn "")
, ((0, 0x1008FF17), spawn "")

-- Bookmarks
, ((modMask, xK_b), submap . M.fromList $
Expand All @@ -297,128 +288,36 @@ myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
, ((0, xK_d), spawn "kitty --class Oilbuku zsh -c 'oil -d; sleep .5'")
])

-- Lock the screen using command specified by myScreensaver.
-- , ((modMask, xK_0),
-- spawn myScreensaver)
, ((controlMask, xK_space), inputPrompt myXPConfig " TODO" ?+ \t -> spawnHere ("/home/a8ka/.bin/add-todo " ++ t))

-- Spawn the launcher using command specified by myLauncher.
-- Use this to launch programs without a key binding.
, ((modMask, xK_d),
spawn myLauncher)

, ((modMask, xK_s),
spawn mySearch)

-- Take a selective screenshot using the command specified by mySelectScreenshot.
, ((modMask .|. shiftMask, xK_s),
spawn mySelectScreenshot)

-- Toggle current focus window to fullscreen
, ((modMask .|. shiftMask, xK_c), kill)
, ((modMask, xK_f), sendMessage $ Toggle FULL)

-- Mute volume.
, ((0, xF86XK_AudioMute),
spawn "amixer -q set Master toggle")

-- Decrease volume.
, ((0, xF86XK_AudioLowerVolume),
spawn "amixer -q set Master 5%-")

-- Increase volume.
, ((0, xF86XK_AudioRaiseVolume),
spawn "amixer -q set Master 5%+")

-- Audio previous.
, ((0, 0x1008FF16),
spawn "")

-- Play/pause.
, ((0, 0x1008FF14),
spawn "")

-- Audio next.
, ((0, 0x1008FF17),
spawn "")

-- Eject CD tray.
, ((0, 0x1008FF2C),
spawn "eject -T")

--------------------------------------------------------------------
-- "Standard" xmonad key bindings
--

-- Close focused window.
, ((modMask .|. shiftMask, xK_c),
kill)

-- Cycle through the available layout algorithms.
, ((modMask, xK_space),
sendMessage NextLayout)

-- Reset the layouts on the current workspace to default.
, ((modMask .|. shiftMask, xK_space),
setLayout $ XMonad.layoutHook conf)
, ((modMask, xK_space), sendMessage NextLayout)
, ((modMask .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf)
, ((modMask, xK_j), windows W.focusDown)
, ((modMask, xK_k), windows W.focusUp)
, ((modMask, xK_m), windows W.focusMaster)
, ((modMask, xK_Return), windows W.swapMaster)
, ((modMask .|. shiftMask, xK_j), windows W.swapDown)
, ((modMask .|. shiftMask, xK_k), windows W.swapUp)
, ((modMask, xK_h), sendMessage Shrink)
, ((modMask, xK_l), sendMessage Expand)

-- Resize viewed windows to the correct size.
, ((modMask, xK_n),
refresh)

-- Move focus to the next window.
, ((modMask, xK_j),
windows W.focusDown)

-- Move focus to the previous window.
, ((modMask, xK_k),
windows W.focusUp )

-- Move focus to the master window.
, ((modMask, xK_m),
windows W.focusMaster )

-- Swap the focused window and the master window.
, ((modMask, xK_Return),
windows W.swapMaster)

-- Swap the focused window with the next window.
, ((modMask .|. shiftMask, xK_j),
windows W.swapDown )

-- Swap the focused window with the previous window.
, ((modMask .|. shiftMask, xK_k),
windows W.swapUp )

-- Shrink the master area.
, ((modMask, xK_h),
sendMessage Shrink)

-- Expand the master area.
, ((modMask, xK_l),
sendMessage Expand)
, ((modMask, xK_n), refresh)

-- Push window back into tiling.
, ((modMask, xK_t),
withFocused $ windows . W.sink)
, ((modMask, xK_t), withFocused $ windows . W.sink)

-- Increment the number of windows in the master area.
, ((modMask, xK_comma),
sendMessage (IncMasterN 1))
, ((modMask, xK_comma), sendMessage (IncMasterN 1))

-- Decrement the number of windows in the master area.
, ((modMask, xK_period),
sendMessage (IncMasterN (-1)))

-- Toggle the status bar gap.
-- TODO: update this binding with avoidStruts, ((modMask, xK_b),
, ((modMask, xK_period), sendMessage (IncMasterN (-1)))

-- Quit xmonad.
, ((modMask .|. shiftMask, xK_o),
io (exitWith ExitSuccess))
, ((modMask .|. shiftMask, xK_o), io (exitWith ExitSuccess))

-- Restart xmonad.
, ((modMask, xK_q),
restart "xmonad" True)
, ((modMask, xK_q), restart "xmonad" True)
]
++

Expand Down Expand Up @@ -559,7 +458,7 @@ main = do
--
-- No need to modify this.
--
defaults = xfceConfig{
defaults = kdeConfig{
-- simple stuff
terminal = myTerminal,
focusFollowsMouse = myFocusFollowsMouse,
Expand Down
Loading

0 comments on commit 0cc102f

Please sign in to comment.