Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 4ed9d818 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Trayer

parent 9a3692b4
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#!/bin/sh
# Copied from https://github.com/jaor/xmobar/issues/239#issuecomment-233206552
# Detects the width of running trayer-srg window (xprop name 'panel')
# and creates an XPM icon of that width, 1px height, and transparent.
# Outputs an <icon>-tag for use in xmobar to display the generated
# XPM icon.
#
# Run script from xmobar:
# `Run Com "/where/ever/trayer-padding-icon.sh" [] "trayerpad" 10`
# and use `%trayerpad%` in your template.
# Function to create a transparent Wx1 px XPM icon
create_xpm_icon () {
timestamp=$(date)
pixels=$(for i in `seq $1`; do echo -n "."; done)
cat << EOF > "$2"
/* XPM *
static char * trayer_pad_xpm[] = {
/* This XPM icon is used for padding in xmobar to */
/* leave room for trayer-srg. It is dynamically */
/* updated by by trayer-padding-icon.sh which is run */
/* by xmobar. */
/* Created: ${timestamp} */
/* <w/cols> <h/rows> <colors> <chars per pixel> */
"$1 1 1 1",
/* Colors (none: transparent) */
". c none",
/* Pixels */
"$pixels"
};
EOF
}
# Width of the trayer window
width=$(xprop -name panel | grep 'program specified minimum size' | cut -d ' ' -f 5)
# Icon file name
iconfile="/tmp/trayer-padding-${width}px.xpm"
# If the desired icon does not exist create it
if [ ! -f $iconfile ]; then
create_xpm_icon $width $iconfile
fi
# Output the icon tag for xmobar
echo "<icon=${iconfile}/>"
...@@ -19,10 +19,11 @@ Config { font = "xft:HackNerdFont:size=10:antialias=true,IPAPGothic:size=10: ...@@ -19,10 +19,11 @@ Config { font = "xft:HackNerdFont:size=10:antialias=true,IPAPGothic:size=10:
, Run Com "/home/kubat/.local/libexec/get_pa_volume.sh" [] "volume" 2 , Run Com "/home/kubat/.local/libexec/get_pa_volume.sh" [] "volume" 2
, Run Com "/home/kubat/.local/libexec/is_vpn_running.sh" [] "vpn" 50 , Run Com "/home/kubat/.local/libexec/is_vpn_running.sh" [] "vpn" 50
, Run Com "/usr/local/bin/lkt.sh" [ "current" ] "lektor" 5 , Run Com "/usr/local/bin/lkt.sh" [ "current" ] "lektor" 5
, Run Com "/home/kubat/.xmonad/trayer-padding-icon.sh" [] "trayerpad" 20
, Run StdinReader , Run StdinReader
] ]
, allDesktops = False , allDesktops = False
, sepChar = "%" , sepChar = "%"
, alignSep = "}{" , alignSep = "}{"
, template = " <icon=haskell_20.xpm/> %StdinReader% } %lektor% { %cpu% %coretemp% %memory% <fc=#b58900>Vol</fc> %volume% %vpn%%battery% | <fc=#b58900>%date%</fc> " , template = " <icon=haskell_20.xpm/> %StdinReader% } %lektor% { %cpu% %coretemp% %memory% <fc=#b58900>Vol</fc> %volume% %vpn%%battery% | <fc=#b58900>%date%</fc> %trayerpad%"
} }
...@@ -131,9 +131,11 @@ myStartupHook = do ...@@ -131,9 +131,11 @@ myStartupHook = do
spawnOnce "/home/kubat/.local/bin/xbanish" spawnOnce "/home/kubat/.local/bin/xbanish"
spawn "/home/kubat/.xmonad/init.sh" spawn "/home/kubat/.xmonad/init.sh"
spawn "xrdb /home/kubat/.Xresources" spawn "xrdb /home/kubat/.Xresources"
spawnOnce "twmnd &"
spawnOnce "nm-applet &"
spawnOnce "feh --bg-scale /home/kubat/.xmonad/wallpaper &" spawnOnce "feh --bg-scale /home/kubat/.xmonad/wallpaper &"
spawn "setxkbmap kubat" spawn "setxkbmap kubat"
spawnOnce "twmnd &" spawnOnce "trayer --edge top --align right --widthtype request --padding 6 --SetDockType true --SetPartialStrut true --expand true --monitor 1 --tint 0x002b36 --transparent true --alpha 0 --height 18 &"
myLayoutHook = myLayoutHook =
minimize $ boringAuto (toggleLayouts (noBorders Full) others) minimize $ boringAuto (toggleLayouts (noBorders Full) others)
...@@ -230,8 +232,8 @@ myAdditionalKeys = ...@@ -230,8 +232,8 @@ myAdditionalKeys =
]) ])
-- Volume, with pulseaudio -- Volume, with pulseaudio
, ((mod4Mask, xK_F11), spawn "pavolume voldown 5") , ((mod4Mask, xK_F11), spawn "pavolume voldown 5 --noshow")
, ((mod4Mask, xK_F12), spawn "pavolume volup 5") , ((mod4Mask, xK_F12), spawn "pavolume volup 5 --noshow")
, ((mod4Mask, xK_F10), spawn "pavolume mutetoggle") , ((mod4Mask, xK_F10), spawn "pavolume mutetoggle")
-- Lektord -- Lektord
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter