Skip to content

Instantly share code, notes, and snippets.

@jclarsson
Created November 19, 2015 11:59
Show Gist options
  • Save jclarsson/7827221c827b2b06c080 to your computer and use it in GitHub Desktop.
Save jclarsson/7827221c827b2b06c080 to your computer and use it in GitHub Desktop.
workspace_names.php
<?php
/***********************************************************************/
/* Changes workspace names to dots. */
/* Uses https://mail.xfce.org/pipermail/xfce/2009-December/026489.html */
/***********************************************************************/
$id = time();
file_put_contents("/home/james/.config/workspace_names_start_time", $id);
while(file_get_contents("/home/james/.config/workspace_names_start_time") == $id){
$wmdata = strtolower(shell_exec("bspc control --get-status"));
$wmdata = explode(":", $wmdata);
print_r($wmdata);
echo "\n\n";
$output = "xfce-set-virtual-desktops";
for($i = 1; $i < count($wmdata)-1; $i++){
if(substr($wmdata[$i], 0, 1) == "o"){
$output .= " ●";
echo $wmdata[$i] . " will use closed circle\n\n";
}
if(substr($wmdata[$i], 0, 1) == "f"){
$output .= " ○";
echo $wmdata[$i] . " will use open circle\n\n";
}
}
echo $output . "\n\n\n";
echo shell_exec($output) . "\n\n\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment