Hozzászólások
-
SzerzőBejegyzés
-
Na-na! Ne keverjük a szezont a fazonnal, meg a gizikét a gőzekével! Az mpd-s „játékom”:
Code:require(„lua_mpd”)
…
lol = luampd:new { host = „localhost” , port = 6600, debug = false }function hook_mpd_update ()
function song_output(current_song, status)
cur_time = string.sub(status.time,1,string.find(status.time,”:”)-1);
tot_time = string.sub(status.time,string.find(status.time,”:”)+1,-1);
cur_min = math.floor(cur_time/60)
cur_sec = cur_time-cur_min*60
tot_min = math.floor(tot_time/60)
tot_sec = tot_time-tot_min*60if current_song.artist then
song_str = current_song.artist
else
song_str = „unknown artist”
endif current_song.title then
song_str = song_str .. ” – ” .. current_song.title
else
song_str = song_str .. ” – unknown title”
endif not current_song.title and not current_song.artist then
song_str = string.gsub(current_song.file,”(.*/)”,””)
endreturn song_str .. ” (” ..
cur_min .. „:” .. string.format(„%02d”,cur_sec) .. „/” ..
tot_min .. „:” .. string.format(„%02d”,tot_sec) .. „)”
endlocal status = lol:status()
if status.state == „play” then
local cs = lol:currentsong()
tb_mpd.text = song_output(cs,status)
else if status.state == „stop” then
tb_mpd.text = „– not playing –”
else if status.state == „pause” then
tb_mpd.text = ” <>”
end end end
end…
awful.hooks.timer.register(1, hook_mpd_update)
Tehát lényegében meghívod az rc.lua-ból a szükséges függvényeket… Aztán azok kimenetével, visszaadott értékeivel azt kezdesz, amit akarsz. Akár ki is írathatod egy textbox-ba…
Vagy más.
zoltan22 wrote:KDEDIR is the KDE installation folder (prefix), usually „/usr” or „/opt/kde3”. [red]If you are not sure where it is, enter in a terminal the command below:
$ kde-config –prefix[/red]Vagy más.
zoltan22 wrote:KDEDIR is the KDE installation folder (prefix), usually „/usr” or „/opt/kde3”. [red]If you are not sure where it is, enter in a terminal the command below:
$ kde-config –prefix[/red]birno wrote:4. Az a gond, hogy több lua fájlt használ, külön van mailbox.lua, accounts.lua, options.lua stb, plusz a testreszabott config.lua, így kicsit bonyolultabb lenne integrálni, szerintem itt marad a régi módszer, majd wicked-el futtatom a scriptet.
Szerintem a mailbox.lua importálása elég, ui. az úgyis magával húzza a többit.birno wrote:4. Az a gond, hogy több lua fájlt használ, külön van mailbox.lua, accounts.lua, options.lua stb, plusz a testreszabott config.lua, így kicsit bonyolultabb lenne integrálni, szerintem itt marad a régi módszer, majd wicked-el futtatom a scriptet.
Szerintem a mailbox.lua importálása elég, ui. az úgyis magával húzza a többit.Persze gondolom annyi különbséggel, hogy
Code:text align=’right’helyett
Code:text align=’center’van 😉
Persze gondolom annyi különbséggel, hogy
Code:text align=’right’helyett
Code:text align=’center’van 😉
2. http://www.calmar.ws/dotfiles/dotfiledir/dot_awesome-status.rc
Code:$in_kbps„2. http://www.calmar.ws/dotfiles/dotfiledir/dot_awesome-status.rc
Code:$in_kbps„+1 necc:
Code:urxvt -fg white -tr -tint black -sh 40 +sb -name Mail -title Mail -e muttÍgy megy. Tehát a title meg a name opciót is használom.
-
SzerzőBejegyzés